Commit 11d036b4 authored by David Johnson's avatar David Johnson

Setup the OpenStack metadata service flows, depending on OS config.

Users can configuration the metadata service to either hook into the
dhcp server port, or into the router port.  In the Cloudlab openstack
profile, I guess I set it up to run the metadata proxy through the
router port.  So we just stick with that.

This means that capnet/openstack in cloudlab users will have to always
add a router to their capnet networks.
parent cfd26116
Pipeline #1206 skipped
......@@ -55,6 +55,9 @@ crudini --set /etc/neutron/neutron.conf DEFAULT api_extensions_path \
crudini --set /etc/neutron/plugins/ml2/ml2_conf_capnet.ini capnet pythonpath \
/opt/tcloud/capnet/lib/python2.7/site-packages
crudini --set /etc/neutron/plugins/ml2/ml2_conf_capnet.ini capnet \
neutron_metadata_service_location l3
##
## Setup our physical Capnet connections
##
......
......@@ -63,6 +63,9 @@ crudini --set /etc/neutron/metering_agent.ini DEFAULT interface_driver \
crudini --set /etc/neutron/plugins/ml2/ml2_conf_capnet.ini capnet pythonpath \
/opt/tcloud/capnet/lib/python2.7/site-packages
crudini --set /etc/neutron/plugins/ml2/ml2_conf_capnet.ini capnet \
neutron_metadata_service_location l3
##
## Setup our physical Capnet connections
##
......
......@@ -108,6 +108,10 @@ capnet_opts = [
cfg.BoolOpt('impotent_mode',default=False,
help="Do not set the bridges' controllers to Capnet controller; just install a NORMAL L2 forwarding flow."),
cfg.StrOpt('neutron_metadata_service_location',
default="",
help="Specify where, if any, the Neutron metadata service proxy is running. This is configurable in Neutron to run either in the DHCP agent or in the L3 agent. Thus, here you can set either 'dhcp', 'l3', or '' (if you don't want the metadata service to be automatically enabled."),
]
......
......@@ -368,6 +368,8 @@ class CapnetControllerMetadataManager(object):
# {'role':role,'line':<line>,'binding':<bindingdict>}
self.metadata = {}
self.metadatafile_base = "%s/cnc.metadata" % (self.rundir,)
self.neutron_metadata_service_location = \
conf.CAPNET.neutron_metadata_service_location
pass
def _write_metadata(self,datapath_id=None):
......@@ -413,6 +415,25 @@ class CapnetControllerMetadataManager(object):
role = "%s:dhcp" % (role,)
pass
extra_role = ''
if self.neutron_metadata_service_location == 'dhcp' \
and 'port' in binding and 'device_owner' in binding['port'] \
and binding['port']['device_owner'] == 'network:dhcp':
extra_role = "osmetadata"
elif self.neutron_metadata_service_location == 'l3' \
and 'port' in binding and 'device_owner' in binding['port'] \
and binding['port']['device_owner'] == 'network:router_interface':
extra_role = "osmetadata"
pass
if not extra_role == '':
if role.find(':') > -1:
role = "%s,%s" % (role,extra_role)
else:
role = "%s:%s" % (role,extra_role)
pass
pass
# Uplinks are special!
if role == 'uplink':
port_id = binding['port_id']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment