Improve l3 agent support

This patch improves the L3 agent support by:
 * Initialise router_scheduler in the l3 NAT mixin
 * Add l3_agent_scheduler to the supported extensions APIs
 * Use q-l3 service to run df-l3-agent as some checks in
   neutron/devstack are q-l3 specific

Change-Id: I19b4910049c7cee1ae04e3ca553190a720050a9d
Closes-Bug: 1574631
Closes-Bug: 1581946
This commit is contained in:
Omer Anson 2016-05-13 18:31:46 +03:00
parent 8b96a42ebf
commit 0836b716ac
6 changed files with 12 additions and 21 deletions

View File

@ -17,7 +17,7 @@
# http://git.openstack.org/cgit/openstack-infra/project-config/tree/jenkins/jobs/dragonflow.yaml
#
export OVERRIDE_ENABLED_SERVICES=key,n-api,n-cpu,n-cond,n-sch,n-crt,n-cauth,n-obj,g-api,g-reg,c-sch,c-api,c-vol,horizon,rabbit,mysql,dstat,df-controller,df-etcd,df-etcd-server,q-svc,q-l3,df-zmq-publisher-service
export OVERRIDE_ENABLED_SERVICES=key,n-api,n-cpu,n-cond,n-sch,n-crt,n-cauth,n-obj,g-api,g-reg,c-sch,c-api,c-vol,horizon,rabbit,mysql,dstat,df-controller,df-etcd,df-etcd-server,q-svc,df-l3-agent,df-zmq-publisher-service
export DEVSTACK_LOCAL_CONFIG+=$'\n'"DF_RUNNING_IN_GATE=True"
if [ -z "${RALLY_SCENARIO}" ] ; then

View File

@ -0,0 +1,6 @@
if is_service_enabled df-l3-agent ; then
Q_L3_ENABLED=${Q_L3_ENABLED:-True}
AGENT_L3_BINARY=${AGENT_L3_BINARY:-"df-l3-agent"}
enable_service q-l3
fi

View File

@ -326,23 +326,6 @@ function stop_pubsub_service {
stop_process df-publisher-service
}
# start_df_l3_agent() - Start running processes, including screen
function start_df_l3_agent {
echo "Starting Dragonflow l3 agent"
if is_service_enabled df-l3-agent ; then
_configure_neutron_l3_agent
run_process df-l3-agent "python $DF_L3_BINARY --config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE"
fi
}
# stop_df_l3_agent() - Stop running processes (non-screen)
function stop_df_l3_agent {
if is_service_enabled df-l3-agent ; then
stop_process df-l3-agent
fi
}
# main loop
if [[ "$Q_ENABLE_DRAGONFLOW_LOCAL_CONTROLLER" == "True" ]]; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then
@ -383,7 +366,6 @@ if [[ "$Q_ENABLE_DRAGONFLOW_LOCAL_CONTROLLER" == "True" ]]; then
start_pubsub_service
fi
start_df_l3_agent
start_df
fi
@ -395,7 +377,5 @@ if [[ "$Q_ENABLE_DRAGONFLOW_LOCAL_CONTROLLER" == "True" ]]; then
if [[ "$DF_PUB_SUB" == "True" ]]; then
stop_pubsub_service
fi
stop_df_l3_agent
fi
fi

View File

@ -22,6 +22,7 @@ SUPPORTED_API_EXTENSIONS = [
'security-group',
'external-net',
'router',
'l3_agent_scheduler',
'subnet_allocation',
'dvr',
'port-security',

View File

@ -48,6 +48,8 @@ class DfL3NATAgentWithStateReport(agent.L3NATAgentWithStateReport):
}
if is_distributed_router(router):
kwargs['agent'] = self
kwargs['host'] = self.host
return DfDvrRouter(*args, **kwargs)
return super(DfL3NATAgentWithStateReport, self)._create_router(

View File

@ -115,6 +115,8 @@ class DFPlugin(db_base_plugin_v2.NeutronDbPluginV2,
router=l3_db.Router,
floatingip=l3_db.FloatingIP)
def __init__(self):
self.router_scheduler = importutils.import_object(
cfg.CONF.router_scheduler_driver)
super(DFPlugin, self).__init__()
LOG.info(_LI("Starting DFPlugin"))
self.vif_type = portbindings.VIF_TYPE_OVS