Add support for NVP

This commit is contained in:
James Page 2013-10-16 11:47:19 +01:00
parent 9691de98c1
commit 05a4826946
6 changed files with 66 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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']
}
}

View File

@ -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

View File

@ -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_*?

View File

@ -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())