Merge lp:~springfield-team/charms/precise/nova-cloud-controller/trunk into lp:~openstack-charmers-archive/charms/precise/nova-cloud-controller/trunk

Proposed by ChingWei Chang
Status: Superseded
Proposed branch: lp:~springfield-team/charms/precise/nova-cloud-controller/trunk
Merge into: lp:~openstack-charmers-archive/charms/precise/nova-cloud-controller/trunk
Diff against target: 388 lines (+252/-1)
10 files modified
config.yaml (+20/-0)
hooks/charmhelpers/contrib/openstack/context.py (+20/-0)
hooks/charmhelpers/contrib/openstack/neutron.py (+28/-0)
hooks/nova_cc_context.py (+6/-0)
hooks/nova_cc_hooks.py (+6/-0)
hooks/nova_cc_utils.py (+5/-0)
templates/havana/cisco_plugins.ini (+139/-0)
templates/havana/neutron.conf (+6/-0)
templates/havana/openrc (+15/-0)
templates/icehouse/neutron.conf (+7/-1)
To merge this branch: bzr merge lp:~springfield-team/charms/precise/nova-cloud-controller/trunk
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Abstain
OpenStack Charmers Pending
Review via email: mp+217533@code.launchpad.net

This proposal has been superseded by a proposal from 2014-05-02.

Description of the change

This merge proposal is prepared to enable N1KV plugin to install with charm logic for nova-cloud-controller.
Similar to ovs and nvp, n1kv (Nexus 1000V) is another layer 2 virtual switch provided by Cisco Nexus 1000V engineering team, which is a host side VM switching fabric building block we call it VEM (Virtual Ethernet Switch). 1+ VEM work in tandem with a VSM (Virtual Switch Module) to form a virtual chassis in a data center.
Please also refer to the VEM/VSM charm and Cisco Nexus1000V related document for its detail.

config.yaml
- added n1kv as a possible value for quantum-plugin
- added n1kv-vsm-username, n1kv-vsm-password, n1kv-vsm-ip to communicate with its supervisor module with (VSM)

hooks/charmhelpers/contrib/openstack/context.py
- Added n1kv related dictionary for context look-up

hooks/charmhelpers/contrib/openstack/neutron.py
- Added n1kv related plugin logic data formation

hooks/nova_cc_hooks.py
- Added copy logic to copy Cisco n1kv template to /root

templates/havana/cisco_plugins.ini
- New file for Cisco Plugin related parameters

templates/havana/neutron.conf
- Added customized system parameters for N1KV plugin to run with

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

Leaving for openstack-charmers, thanks!

review: Abstain
75. By Shiv Prasad Rao

Cisco N1KV changes for Icehouse

76. By Shiv Prasad Rao

[niedbalski] fixup unit tests for key management
[niedbalski] Force use of http for key imports

77. By Shiv Prasad Rao

Cisco N1KV changes

78. By Shiv Prasad Rao

Adding support for PostgreSQL for cisco_plugin.ini

79. By Shiv Prasad Rao

Adding configurable option for n1kv_restrict_policy_profiles

80. By Shiv Prasad Rao

n1kv-config-flags parameter added to add key=value configs to cisco_plugins.ini

81. By Shiv Prasad Rao

Changes for supporting secuirty groups with N1KV

82. By Shiv Prasad Rao

creating seperate n1kv_user_config_flags context variable for n1kv

83. By Shiv Prasad Rao

security group api change for n1kv

84. By Shiv Prasad Rao

Security Groups support for N1kv

85. By Dulanjalie Ganegedara

adding charmhelper support to use --keyserver option for public PPA

Unmerged revisions

85. By Dulanjalie Ganegedara

adding charmhelper support to use --keyserver option for public PPA

84. By Shiv Prasad Rao

Security Groups support for N1kv

83. By Shiv Prasad Rao

security group api change for n1kv

82. By Shiv Prasad Rao

creating seperate n1kv_user_config_flags context variable for n1kv

81. By Shiv Prasad Rao

Changes for supporting secuirty groups with N1KV

80. By Shiv Prasad Rao

n1kv-config-flags parameter added to add key=value configs to cisco_plugins.ini

79. By Shiv Prasad Rao

Adding configurable option for n1kv_restrict_policy_profiles

78. By Shiv Prasad Rao

Adding support for PostgreSQL for cisco_plugin.ini

77. By Shiv Prasad Rao

Cisco N1KV changes

76. By Shiv Prasad Rao

[niedbalski] fixup unit tests for key management
[niedbalski] Force use of http for key imports

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2014-04-16 08:47:14 +0000
3+++ config.yaml 2014-05-02 20:16:31 +0000
4@@ -70,6 +70,7 @@
5 .
6 ovs - OpenvSwitch Plugin
7 nvp - Nicira Network Virtualization Platform
8+ n1kv - Cisco Nexus1000v Network Virtualization Platform
9 .
10 This configuration only has context when used with
11 network-manager Quantum.
12@@ -163,4 +164,23 @@
13 description: |
14 This is uuid of the default NVP L3 Gateway Service.
15 # end of NVP configuration
16+ n1kv-vsm-username:
17+ type: string
18+ default: admin
19+ description: Username to connect to Cisco Nexus1000v VSM
20+ n1kv-vsm-password:
21+ type: string
22+ default: abc123
23+ description: Password to connect to Cisco Nexus1000v VSM
24+ n1kv-vsm-ip:
25+ default: 10.10.10.10
26+ description: IP address to connect to Cisco Nexus1000v VSM
27+ keystone-usrname:
28+ type: string
29+ default: admin
30+ description: Username to connect to keystone
31+ keystone-password:
32+ type: string
33+ default: openstack
34+ description: Password to connect to keystone
35
36
37=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
38--- hooks/charmhelpers/contrib/openstack/context.py 2014-04-16 08:25:14 +0000
39+++ hooks/charmhelpers/contrib/openstack/context.py 2014-05-02 20:16:31 +0000
40@@ -541,6 +541,24 @@
41
42 return nvp_ctxt
43
44+ def n1kv_ctxt(self):
45+ driver = neutron_plugin_attribute(self.plugin, 'driver',
46+ self.network_manager)
47+ n1kv_config = neutron_plugin_attribute(self.plugin, 'config',
48+ self.network_manager)
49+ n1kv_ctxt = {
50+ 'core_plugin': driver,
51+ 'neutron_plugin': 'n1kv',
52+ 'neutron_security_groups': self.neutron_security_groups,
53+ 'local_ip': unit_private_ip(),
54+ 'config': n1kv_config,
55+ 'vsm_ip': config('n1kv-vsm-ip'),
56+ 'vsm_username': config('n1kv-vsm-username'),
57+ 'vsm_password': config('n1kv-vsm-password'),
58+ }
59+
60+ return n1kv_ctxt
61+
62 def neutron_ctxt(self):
63 if https():
64 proto = 'https'
65@@ -572,6 +590,8 @@
66 ctxt.update(self.ovs_ctxt())
67 elif self.plugin == 'nvp':
68 ctxt.update(self.nvp_ctxt())
69+ elif self.plugin == 'n1kv':
70+ ctxt.update(self.n1kv_ctxt())
71
72 alchemy_flags = config('neutron-alchemy-flags')
73 if alchemy_flags:
74
75=== modified file 'hooks/charmhelpers/contrib/openstack/neutron.py'
76--- hooks/charmhelpers/contrib/openstack/neutron.py 2014-04-16 08:25:14 +0000
77+++ hooks/charmhelpers/contrib/openstack/neutron.py 2014-05-02 20:16:31 +0000
78@@ -73,6 +73,20 @@
79 'server_packages': ['quantum-server',
80 'quantum-plugin-nicira'],
81 'server_services': ['quantum-server']
82+ },
83+ 'n1kv': {
84+ 'config': '/etc/quantum/plugins/cisco/cisco_plugins.ini',
85+ 'driver': 'quantum.plugins.cisco.network_plugin.PluginV2',
86+ 'contexts': [
87+ context.SharedDBContext(user=config('neutron-database-user'),
88+ database=config('neutron-database'),
89+ relation_prefix='neutron',
90+ ssl_dir=QUANTUM_CONF_DIR)],
91+ 'services': ['quantum-plugin-cisco'],
92+ 'packages': [['quantum-plugin-cisco']],
93+ 'server_packages': ['quantum-server',
94+ 'quantum-plugin-cisco'],
95+ 'server_services': ['quantum-server']
96 }
97 }
98
99@@ -114,6 +128,20 @@
100 'server_packages': ['neutron-server',
101 'neutron-plugin-nicira'],
102 'server_services': ['neutron-server']
103+ },
104+ 'n1kv': {
105+ 'config': '/etc/neutron/plugins/cisco/cisco_plugins.ini',
106+ 'driver': 'neutron.plugins.cisco.network_plugin.PluginV2',
107+ 'contexts': [
108+ context.SharedDBContext(user=config('neutron-database-user'),
109+ database=config('neutron-database'),
110+ relation_prefix='neutron',
111+ ssl_dir=QUANTUM_CONF_DIR)],
112+ 'services': ['neutron-plugin-cisco'],
113+ 'packages': [['neutron-plugin-cisco']],
114+ 'server_packages': ['neutron-server',
115+ 'neutron-plugin-cisco'],
116+ 'server_services': ['neutron-server']
117 }
118 }
119 # NOTE: patch in ml2 plugin for icehouse onwards
120
121=== modified file 'hooks/nova_cc_context.py'
122--- hooks/nova_cc_context.py 2014-04-12 21:25:19 +0000
123+++ hooks/nova_cc_context.py 2014-05-02 20:16:31 +0000
124@@ -193,6 +193,12 @@
125 ctxt['region'] = config('region')
126 return ctxt
127
128+class OpenrcContext(context.IdentityServiceContext):
129+ def __call__(self):
130+ ctxt = {}
131+ ctxt['os_username'] = config('keystone-usrname')
132+ ctxt['os_password'] = config('keystone-password')
133+ return ctxt
134
135 class NovaPostgresqlDBContext(context.PostgresqlDBContext):
136 interfaces = ['pgsql-nova-db']
137
138=== modified file 'hooks/nova_cc_hooks.py'
139--- hooks/nova_cc_hooks.py 2014-04-11 16:41:42 +0000
140+++ hooks/nova_cc_hooks.py 2014-05-02 20:16:31 +0000
141@@ -4,6 +4,7 @@
142 import shutil
143 import sys
144 import uuid
145+import subprocess
146
147 from subprocess import check_call
148 from urlparse import urlparse
149@@ -82,6 +83,11 @@
150 @hooks.hook()
151 def install():
152 execd_preinstall()
153+ plugin = config('quantum-plugin')
154+ if (plugin == 'n1kv'):
155+ command = "cp templates/havana/openrc /root/"
156+ process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
157+ process.communicate()[0]
158 configure_installation_source(config('openstack-origin'))
159 apt_update()
160 apt_install(determine_packages(), fatal=True)
161
162=== modified file 'hooks/nova_cc_utils.py'
163--- hooks/nova_cc_utils.py 2014-05-02 10:06:23 +0000
164+++ hooks/nova_cc_utils.py 2014-05-02 20:16:31 +0000
165@@ -87,6 +87,7 @@
166 HAPROXY_CONF = '/etc/haproxy/haproxy.cfg'
167 APACHE_CONF = '/etc/apache2/sites-available/openstack_https_frontend'
168 APACHE_24_CONF = '/etc/apache2/sites-available/openstack_https_frontend.conf'
169+OPENRC = '/root/openrc'
170 NEUTRON_DEFAULT = '/etc/default/neutron-server'
171 QUANTUM_DEFAULT = '/etc/default/quantum-server'
172
173@@ -167,6 +168,10 @@
174 'contexts': [nova_cc_context.ApacheSSLContext()],
175 'services': ['apache2'],
176 }),
177+ (OPENRC, {
178+ 'contexts': [nova_cc_context.OpenrcContext(), context.IdentityServiceContext()],
179+ 'services': [],
180+ }),
181 ])
182
183 CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'
184
185=== added file 'templates/havana/cisco_plugins.ini'
186--- templates/havana/cisco_plugins.ini 1970-01-01 00:00:00 +0000
187+++ templates/havana/cisco_plugins.ini 2014-05-02 20:16:31 +0000
188@@ -0,0 +1,139 @@
189+[cisco_plugins]
190+
191+# (StrOpt) Period-separated module path to the plugin class to use for
192+# the Cisco Nexus switches.
193+#
194+# nexus_plugin = neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
195+
196+# (StrOpt) Period-separated module path to the plugin class to use for
197+# the virtual switches on compute nodes.
198+#
199+# vswitch_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
200+
201+
202+[cisco]
203+
204+# (StrOpt) A short prefix to prepend to the VLAN number when creating a
205+# VLAN interface. For example, if an interface is being created for
206+# VLAN 2001 it will be named 'q-2001' using the default prefix.
207+#
208+# vlan_name_prefix = q-
209+# Example: vlan_name_prefix = vnet-
210+
211+# (StrOpt) A short prefix to prepend to the VLAN number when creating a
212+# provider VLAN interface. For example, if an interface is being created
213+# for provider VLAN 3003 it will be named 'p-3003' using the default prefix.
214+#
215+# provider_vlan_name_prefix = p-
216+# Example: provider_vlan_name_prefix = PV-
217+
218+# (BoolOpt) A flag indicating whether Openstack networking should manage the
219+# creation and removal of VLAN interfaces for provider networks on the Nexus
220+# switches. If the flag is set to False then Openstack will not create or
221+# remove VLAN interfaces for provider networks, and the administrator needs
222+# to manage these interfaces manually or by external orchestration.
223+#
224+# provider_vlan_auto_create = True
225+
226+# (BoolOpt) A flag indicating whether Openstack networking should manage
227+# the adding and removing of provider VLANs from trunk ports on the Nexus
228+# switches. If the flag is set to False then Openstack will not add or
229+# remove provider VLANs from trunk ports, and the administrator needs to
230+# manage these operations manually or by external orchestration.
231+#
232+# provider_vlan_auto_trunk = True
233+
234+# (StrOpt) Period-separated module path to the model class to use for
235+# the Cisco neutron plugin.
236+#
237+# model_class = neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2
238+
239+# (StrOpt) Period-separated module path to the driver class to use for
240+# the Cisco Nexus switches.
241+#
242+# If no value is configured, a fake driver will be used.
243+# nexus_driver = neutron.plugins.cisco.test.nexus.fake_nexus_driver.CiscoNEXUSFakeDriver
244+# With real hardware, use the CiscoNEXUSDriver class:
245+# nexus_driver = neutron.plugins.cisco.nexus.cisco_nexus_network_driver_v2.CiscoNEXUSDriver
246+
247+# (BoolOpt) A flag to enable round robin scheduling of routers for SVI.
248+# svi_round_robin = False
249+
250+
251+# Cisco Nexus Switch configurations.
252+# Each switch to be managed by Openstack Neutron must be configured here.
253+#
254+# Cisco Nexus Switch Format.
255+# [NEXUS_SWITCH:<IP address of switch>]
256+# <hostname>=<port> (1)
257+# ssh_port=<ssh port> (2)
258+# username=<credential username> (3)
259+# password=<credential password> (4)
260+#
261+# (1) For each host connected to a port on the switch, specify the hostname
262+# and the Nexus physical port (interface) it is connected to.
263+# (2) The TCP port for connecting via SSH to manage the switch. This is
264+# port number 22 unless the switch has been configured otherwise.
265+# (3) The username for logging into the switch to manage it.
266+# (4) The password for logging into the switch to manage it.
267+#
268+# Example:
269+# [NEXUS_SWITCH:1.1.1.1]
270+# compute1=1/1
271+# compute2=1/2
272+# ssh_port=22
273+# username=admin
274+# password=mySecretPassword
275+
276+#
277+# N1KV Format.
278+# [N1KV:<IP address of VSM>]
279+# username=<credential username>
280+# password=<credential password>
281+#
282+# Example:
283+# [N1KV:2.2.2.2]
284+# username=admin
285+# password=mySecretPassword
286+
287+[cisco_n1k]
288+
289+# (StrOpt) Specify the name of the integration bridge to which the VIFs are
290+# attached.
291+#
292+integration_bridge = br-int
293+
294+# (StrOpt) Name of the policy profile to be associated with a port when no
295+# policy profile is specified during port creates.
296+#
297+default_policy_profile = default-pp
298+# Example: default_policy_profile = service_profile
299+
300+# (StrOpt) Name of the policy profile to be associated with a port owned by
301+# network node (dhcp, router).
302+#
303+network_node_policy_profile = default-pp
304+# Example: network_node_policy_profile = dhcp_pp
305+
306+# (StrOpt) Name of the network profile to be associated with a network when no
307+# network profile is specified during network creates. Admin should pre-create
308+# a network profile with this name.
309+#
310+# default_network_profile =
311+# Example: default_network_profile = network_pool
312+
313+# (StrOpt) Time in seconds for which the plugin polls the VSM for updates in
314+# policy profiles.
315+#
316+poll_duration = 10
317+# Example: poll_duration = 180
318+
319+[database]
320+connection = mysql://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
321+
322+[CISCO_PLUGINS]
323+vswitch_plugin = neutron.plugins.cisco.n1kv.n1kv_neutron_plugin.N1kvNeutronPluginV2
324+
325+[N1KV:{{ vsm_ip }}]
326+password = {{ vsm_password }}
327+username = {{ vsm_username }}
328
329=== modified file 'templates/havana/neutron.conf'
330--- templates/havana/neutron.conf 2014-04-16 08:25:14 +0000
331+++ templates/havana/neutron.conf 2014-05-02 20:16:31 +0000
332@@ -27,6 +27,12 @@
333
334 {% include "parts/rabbitmq" %}
335
336+{% if neutron_plugin and neutron_plugin == 'n1kv' -%}
337+rpc_backend = neutron.openstack.common.rpc.impl_kombu
338+api_extensions_path = /usr/share/pyshared/neutron/plugins/cisco/extensions
339+network_auto_schedule = False
340+{% endif %}
341+
342 [quotas]
343 quota_driver = neutron.db.quota_db.DbQuotaDriver
344 {% if neutron_security_groups -%}
345
346=== added file 'templates/havana/openrc'
347--- templates/havana/openrc 1970-01-01 00:00:00 +0000
348+++ templates/havana/openrc 2014-05-02 20:16:31 +0000
349@@ -0,0 +1,15 @@
350+#!/bin/sh
351+#This is an example of openrc
352+# READ:http://docs.openstack.org/user-guide/content/cli_openrc.html
353+export OS_NO_CACHE=true
354+export OS_TENANT_NAME=admin
355+export OS_USERNAME={{ os_username }}
356+export OS_PASSWORD={{ os_password }}
357+export OS_AUTH_URL=http://{{ service_host }}:{{ service_port }}/v2.0/
358+export OS_AUTH_STRATEGY=keystone
359+export OS_REGION_NAME=RegionOne
360+export CINDER_ENDPOINT_TYPE=publicURL
361+export GLANCE_ENDPOINT_TYPE=publicURL
362+export KEYSTONE_ENDPOINT_TYPE=publicURL
363+export NOVA_ENDPOINT_TYPE=publicURL
364+export QUANTUM_ENDPOINT_TYPE=publicURL
365
366=== modified file 'templates/icehouse/neutron.conf'
367--- templates/icehouse/neutron.conf 2014-04-09 07:58:21 +0000
368+++ templates/icehouse/neutron.conf 2014-05-02 20:16:31 +0000
369@@ -29,6 +29,12 @@
370
371 {% include "parts/rabbitmq" %}
372
373+{% if neutron_plugin and neutron_plugin == 'n1kv' -%}
374+rpc_backend = neutron.openstack.common.rpc.impl_kombu
375+api_extensions_path = /usr/share/pyshared/neutron/plugins/cisco/extensions
376+network_auto_schedule = False
377+{% endif %}
378+
379 notify_nova_on_port_status_changes = True
380 notify_nova_on_port_data_changes = True
381 nova_url = {{ nova_url }}
382@@ -68,4 +74,4 @@
383 [service_providers]
384 service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
385 service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
386-service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
387\ No newline at end of file
388+service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default

Subscribers

People subscribed via source and target branches