diff --git a/charm-helpers.yaml b/charm-helpers.yaml index 30ff4ca7..0ebaaf0d 100644 --- a/charm-helpers.yaml +++ b/charm-helpers.yaml @@ -1,4 +1,4 @@ -branch: lp:charm-helpers +branch: ../charm-helpers destination: hooks/charmhelpers include: - core @@ -7,5 +7,4 @@ include: - contrib.storage - contrib.hahelpers: - apache - - ceph - payload.execd diff --git a/config.yaml b/config.yaml index c734d12b..5bbae565 100644 --- a/config.yaml +++ b/config.yaml @@ -69,6 +69,7 @@ options: Quantum plugin to use for network management; supports . ovs - OpenvSwitch Plugin + nvp - Nicira Network Virtualization Platform . This configuration only has context when used with network-manager Quantum. @@ -125,3 +126,31 @@ options: ssl_key: type: string description: SSL key to use with certificate specified as ssl_cert. + # Neutron NVP Plugin configuration + nvp-controllers: + type: string + description: Space delimited addresses of NVP controllers + nvp-username: + type: string + default: admin + description: Username to connect to NVP controllers with + nvp-password: + type: string + default: admin + description: Password to connect to NVP controllers with + nvp-cluster-name: + type: string + default: example + description: Name of the NVP cluster configuration to create (grizzly only) + nvp-tz-uuid: + type: string + description: | + This is uuid of the default NVP Transport zone that will be used for + creating tunneled isolated Quantum networks. It needs to be created + in NVP before starting Quantum with the nvp plugin. + nvp-l3-uuid: + type: string + description: | + This is uuid of the default NVP L3 Gateway Service. + # end of NVP configuration + diff --git a/hooks/charmhelpers/contrib/openstack/neutron.py b/hooks/charmhelpers/contrib/openstack/neutron.py index a27ce953..8d32bd00 100644 --- a/hooks/charmhelpers/contrib/openstack/neutron.py +++ b/hooks/charmhelpers/contrib/openstack/neutron.py @@ -34,13 +34,23 @@ def quantum_plugins(): 'services': ['quantum-plugin-openvswitch-agent'], 'packages': [[headers_package(), 'openvswitch-datapath-dkms'], ['quantum-plugin-openvswitch-agent']], + 'server_packages': ['quantum-server', + 'quantum-plugin-openvswitch'], + 'server_services': ['quantum-server'] }, 'nvp': { 'config': '/etc/quantum/plugins/nicira/nvp.ini', 'driver': 'quantum.plugins.nicira.nicira_nvp_plugin.' 'QuantumPlugin.NvpPluginV2', + 'contexts': [ + context.SharedDBContext(user=config('neutron-database-user'), + database=config('neutron-database'), + relation_prefix='neutron')], 'services': [], 'packages': [], + 'server_packages': ['quantum-server', + 'quantum-plugin-nicira'], + 'server_services': ['quantum-server'] } } @@ -60,13 +70,23 @@ def neutron_plugins(): 'services': ['neutron-plugin-openvswitch-agent'], 'packages': [[headers_package(), 'openvswitch-datapath-dkms'], ['quantum-plugin-openvswitch-agent']], + 'server_packages': ['neutron-server', + 'neutron-plugin-openvswitch'], + 'server_services': ['neutron-server'] }, 'nvp': { 'config': '/etc/neutron/plugins/nicira/nvp.ini', 'driver': 'neutron.plugins.nicira.nicira_nvp_plugin.' 'NeutronPlugin.NvpPluginV2', + 'contexts': [ + context.SharedDBContext(user=config('neutron-database-user'), + database=config('neutron-database'), + relation_prefix='neutron')], 'services': [], 'packages': [], + 'server_packages': ['neutron-server', + 'neutron-plugin-nicira'], + 'server_services': ['neutron-server'] } } diff --git a/hooks/nova_cc_context.py b/hooks/nova_cc_context.py index ccbc0923..72d0d145 100644 --- a/hooks/nova_cc_context.py +++ b/hooks/nova_cc_context.py @@ -139,6 +139,16 @@ class NeutronCCContext(context.NeutronContext): def __call__(self): ctxt = super(NeutronCCContext, self).__call__() ctxt['external_network'] = config('neutron-external-network') + if 'nvp' in [config('quantum-plugin'), config('neutron-plugin')]: + _config = config() + for k, v in _config.iteritems(): + if k.startswith('nvp'): + ctxt[k.replace('-', '_')] = v + if 'nvp-controllers' in _config: + ctxt['nvp_controllers'] = \ + ','.join(_config['nvp-controllers'].split()) + ctxt['nvp_controllers_list'] = \ + _config['nvp-controllers'].split() return ctxt diff --git a/hooks/nova_cc_hooks.py b/hooks/nova_cc_hooks.py index 9008121c..75308007 100755 --- a/hooks/nova_cc_hooks.py +++ b/hooks/nova_cc_hooks.py @@ -286,14 +286,9 @@ def quantum_joined(rid=None): if not eligible_leader(CLUSTER_RES): return - if network_manager() == 'quantum': - pkg = 'quantum-server' - else: - pkg = 'neutron-server' - - required_pkg = filter_installed_packages([pkg]) - if required_pkg: - apt_install(required_pkg) + pkgs = neutron_plugin_attribute(neutron_plugin(), 'server_packages', + network_manager()) + apt_install(filter_installed_packages(pkgs)) url = canonical_url(CONFIGS) + ':9696' # XXX: Can we rename to neutron_*? diff --git a/hooks/nova_cc_utils.py b/hooks/nova_cc_utils.py index 430eeaee..b2a259e6 100644 --- a/hooks/nova_cc_utils.py +++ b/hooks/nova_cc_utils.py @@ -166,11 +166,12 @@ def resource_map(): plugin = neutron_plugin() if plugin: conf = neutron_plugin_attribute(plugin, 'config', net_manager) - service = '%s-server' % net_manager ctxts = (neutron_plugin_attribute(plugin, 'contexts', net_manager) or []) + services = neutron_plugin_attribute(plugin, 'server_services', + net_manager) resource_map[conf] = {} - resource_map[conf]['services'] = [service] + resource_map[conf]['services'] = services resource_map[conf]['contexts'] = ctxts resource_map[conf]['contexts'].append( nova_cc_context.NeutronCCContext())