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
=== modified file 'config.yaml'
--- config.yaml 2014-04-16 08:47:14 +0000
+++ config.yaml 2014-05-02 20:16:31 +0000
@@ -70,6 +70,7 @@
70 .70 .
71 ovs - OpenvSwitch Plugin71 ovs - OpenvSwitch Plugin
72 nvp - Nicira Network Virtualization Platform72 nvp - Nicira Network Virtualization Platform
73 n1kv - Cisco Nexus1000v Network Virtualization Platform
73 .74 .
74 This configuration only has context when used with75 This configuration only has context when used with
75 network-manager Quantum.76 network-manager Quantum.
@@ -163,4 +164,23 @@
163 description: |164 description: |
164 This is uuid of the default NVP L3 Gateway Service.165 This is uuid of the default NVP L3 Gateway Service.
165 # end of NVP configuration166 # end of NVP configuration
167 n1kv-vsm-username:
168 type: string
169 default: admin
170 description: Username to connect to Cisco Nexus1000v VSM
171 n1kv-vsm-password:
172 type: string
173 default: abc123
174 description: Password to connect to Cisco Nexus1000v VSM
175 n1kv-vsm-ip:
176 default: 10.10.10.10
177 description: IP address to connect to Cisco Nexus1000v VSM
178 keystone-usrname:
179 type: string
180 default: admin
181 description: Username to connect to keystone
182 keystone-password:
183 type: string
184 default: openstack
185 description: Password to connect to keystone
166186
167187
=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
--- hooks/charmhelpers/contrib/openstack/context.py 2014-04-16 08:25:14 +0000
+++ hooks/charmhelpers/contrib/openstack/context.py 2014-05-02 20:16:31 +0000
@@ -541,6 +541,24 @@
541541
542 return nvp_ctxt542 return nvp_ctxt
543543
544 def n1kv_ctxt(self):
545 driver = neutron_plugin_attribute(self.plugin, 'driver',
546 self.network_manager)
547 n1kv_config = neutron_plugin_attribute(self.plugin, 'config',
548 self.network_manager)
549 n1kv_ctxt = {
550 'core_plugin': driver,
551 'neutron_plugin': 'n1kv',
552 'neutron_security_groups': self.neutron_security_groups,
553 'local_ip': unit_private_ip(),
554 'config': n1kv_config,
555 'vsm_ip': config('n1kv-vsm-ip'),
556 'vsm_username': config('n1kv-vsm-username'),
557 'vsm_password': config('n1kv-vsm-password'),
558 }
559
560 return n1kv_ctxt
561
544 def neutron_ctxt(self):562 def neutron_ctxt(self):
545 if https():563 if https():
546 proto = 'https'564 proto = 'https'
@@ -572,6 +590,8 @@
572 ctxt.update(self.ovs_ctxt())590 ctxt.update(self.ovs_ctxt())
573 elif self.plugin == 'nvp':591 elif self.plugin == 'nvp':
574 ctxt.update(self.nvp_ctxt())592 ctxt.update(self.nvp_ctxt())
593 elif self.plugin == 'n1kv':
594 ctxt.update(self.n1kv_ctxt())
575595
576 alchemy_flags = config('neutron-alchemy-flags')596 alchemy_flags = config('neutron-alchemy-flags')
577 if alchemy_flags:597 if alchemy_flags:
578598
=== modified file 'hooks/charmhelpers/contrib/openstack/neutron.py'
--- hooks/charmhelpers/contrib/openstack/neutron.py 2014-04-16 08:25:14 +0000
+++ hooks/charmhelpers/contrib/openstack/neutron.py 2014-05-02 20:16:31 +0000
@@ -73,6 +73,20 @@
73 'server_packages': ['quantum-server',73 'server_packages': ['quantum-server',
74 'quantum-plugin-nicira'],74 'quantum-plugin-nicira'],
75 'server_services': ['quantum-server']75 'server_services': ['quantum-server']
76 },
77 'n1kv': {
78 'config': '/etc/quantum/plugins/cisco/cisco_plugins.ini',
79 'driver': 'quantum.plugins.cisco.network_plugin.PluginV2',
80 'contexts': [
81 context.SharedDBContext(user=config('neutron-database-user'),
82 database=config('neutron-database'),
83 relation_prefix='neutron',
84 ssl_dir=QUANTUM_CONF_DIR)],
85 'services': ['quantum-plugin-cisco'],
86 'packages': [['quantum-plugin-cisco']],
87 'server_packages': ['quantum-server',
88 'quantum-plugin-cisco'],
89 'server_services': ['quantum-server']
76 }90 }
77 }91 }
7892
@@ -114,6 +128,20 @@
114 'server_packages': ['neutron-server',128 'server_packages': ['neutron-server',
115 'neutron-plugin-nicira'],129 'neutron-plugin-nicira'],
116 'server_services': ['neutron-server']130 'server_services': ['neutron-server']
131 },
132 'n1kv': {
133 'config': '/etc/neutron/plugins/cisco/cisco_plugins.ini',
134 'driver': 'neutron.plugins.cisco.network_plugin.PluginV2',
135 'contexts': [
136 context.SharedDBContext(user=config('neutron-database-user'),
137 database=config('neutron-database'),
138 relation_prefix='neutron',
139 ssl_dir=QUANTUM_CONF_DIR)],
140 'services': ['neutron-plugin-cisco'],
141 'packages': [['neutron-plugin-cisco']],
142 'server_packages': ['neutron-server',
143 'neutron-plugin-cisco'],
144 'server_services': ['neutron-server']
117 }145 }
118 }146 }
119 # NOTE: patch in ml2 plugin for icehouse onwards147 # NOTE: patch in ml2 plugin for icehouse onwards
120148
=== modified file 'hooks/nova_cc_context.py'
--- hooks/nova_cc_context.py 2014-04-12 21:25:19 +0000
+++ hooks/nova_cc_context.py 2014-05-02 20:16:31 +0000
@@ -193,6 +193,12 @@
193 ctxt['region'] = config('region')193 ctxt['region'] = config('region')
194 return ctxt194 return ctxt
195195
196class OpenrcContext(context.IdentityServiceContext):
197 def __call__(self):
198 ctxt = {}
199 ctxt['os_username'] = config('keystone-usrname')
200 ctxt['os_password'] = config('keystone-password')
201 return ctxt
196202
197class NovaPostgresqlDBContext(context.PostgresqlDBContext):203class NovaPostgresqlDBContext(context.PostgresqlDBContext):
198 interfaces = ['pgsql-nova-db']204 interfaces = ['pgsql-nova-db']
199205
=== modified file 'hooks/nova_cc_hooks.py'
--- hooks/nova_cc_hooks.py 2014-04-11 16:41:42 +0000
+++ hooks/nova_cc_hooks.py 2014-05-02 20:16:31 +0000
@@ -4,6 +4,7 @@
4import shutil4import shutil
5import sys5import sys
6import uuid6import uuid
7import subprocess
78
8from subprocess import check_call9from subprocess import check_call
9from urlparse import urlparse10from urlparse import urlparse
@@ -82,6 +83,11 @@
82@hooks.hook()83@hooks.hook()
83def install():84def install():
84 execd_preinstall()85 execd_preinstall()
86 plugin = config('quantum-plugin')
87 if (plugin == 'n1kv'):
88 command = "cp templates/havana/openrc /root/"
89 process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
90 process.communicate()[0]
85 configure_installation_source(config('openstack-origin'))91 configure_installation_source(config('openstack-origin'))
86 apt_update()92 apt_update()
87 apt_install(determine_packages(), fatal=True)93 apt_install(determine_packages(), fatal=True)
8894
=== modified file 'hooks/nova_cc_utils.py'
--- hooks/nova_cc_utils.py 2014-05-02 10:06:23 +0000
+++ hooks/nova_cc_utils.py 2014-05-02 20:16:31 +0000
@@ -87,6 +87,7 @@
87HAPROXY_CONF = '/etc/haproxy/haproxy.cfg'87HAPROXY_CONF = '/etc/haproxy/haproxy.cfg'
88APACHE_CONF = '/etc/apache2/sites-available/openstack_https_frontend'88APACHE_CONF = '/etc/apache2/sites-available/openstack_https_frontend'
89APACHE_24_CONF = '/etc/apache2/sites-available/openstack_https_frontend.conf'89APACHE_24_CONF = '/etc/apache2/sites-available/openstack_https_frontend.conf'
90OPENRC = '/root/openrc'
90NEUTRON_DEFAULT = '/etc/default/neutron-server'91NEUTRON_DEFAULT = '/etc/default/neutron-server'
91QUANTUM_DEFAULT = '/etc/default/quantum-server'92QUANTUM_DEFAULT = '/etc/default/quantum-server'
9293
@@ -167,6 +168,10 @@
167 'contexts': [nova_cc_context.ApacheSSLContext()],168 'contexts': [nova_cc_context.ApacheSSLContext()],
168 'services': ['apache2'],169 'services': ['apache2'],
169 }),170 }),
171 (OPENRC, {
172 'contexts': [nova_cc_context.OpenrcContext(), context.IdentityServiceContext()],
173 'services': [],
174 }),
170])175])
171176
172CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'177CA_CERT_PATH = '/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt'
173178
=== added file 'templates/havana/cisco_plugins.ini'
--- templates/havana/cisco_plugins.ini 1970-01-01 00:00:00 +0000
+++ templates/havana/cisco_plugins.ini 2014-05-02 20:16:31 +0000
@@ -0,0 +1,139 @@
1[cisco_plugins]
2
3# (StrOpt) Period-separated module path to the plugin class to use for
4# the Cisco Nexus switches.
5#
6# nexus_plugin = neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
7
8# (StrOpt) Period-separated module path to the plugin class to use for
9# the virtual switches on compute nodes.
10#
11# vswitch_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
12
13
14[cisco]
15
16# (StrOpt) A short prefix to prepend to the VLAN number when creating a
17# VLAN interface. For example, if an interface is being created for
18# VLAN 2001 it will be named 'q-2001' using the default prefix.
19#
20# vlan_name_prefix = q-
21# Example: vlan_name_prefix = vnet-
22
23# (StrOpt) A short prefix to prepend to the VLAN number when creating a
24# provider VLAN interface. For example, if an interface is being created
25# for provider VLAN 3003 it will be named 'p-3003' using the default prefix.
26#
27# provider_vlan_name_prefix = p-
28# Example: provider_vlan_name_prefix = PV-
29
30# (BoolOpt) A flag indicating whether Openstack networking should manage the
31# creation and removal of VLAN interfaces for provider networks on the Nexus
32# switches. If the flag is set to False then Openstack will not create or
33# remove VLAN interfaces for provider networks, and the administrator needs
34# to manage these interfaces manually or by external orchestration.
35#
36# provider_vlan_auto_create = True
37
38# (BoolOpt) A flag indicating whether Openstack networking should manage
39# the adding and removing of provider VLANs from trunk ports on the Nexus
40# switches. If the flag is set to False then Openstack will not add or
41# remove provider VLANs from trunk ports, and the administrator needs to
42# manage these operations manually or by external orchestration.
43#
44# provider_vlan_auto_trunk = True
45
46# (StrOpt) Period-separated module path to the model class to use for
47# the Cisco neutron plugin.
48#
49# model_class = neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2
50
51# (StrOpt) Period-separated module path to the driver class to use for
52# the Cisco Nexus switches.
53#
54# If no value is configured, a fake driver will be used.
55# nexus_driver = neutron.plugins.cisco.test.nexus.fake_nexus_driver.CiscoNEXUSFakeDriver
56# With real hardware, use the CiscoNEXUSDriver class:
57# nexus_driver = neutron.plugins.cisco.nexus.cisco_nexus_network_driver_v2.CiscoNEXUSDriver
58
59# (BoolOpt) A flag to enable round robin scheduling of routers for SVI.
60# svi_round_robin = False
61
62
63# Cisco Nexus Switch configurations.
64# Each switch to be managed by Openstack Neutron must be configured here.
65#
66# Cisco Nexus Switch Format.
67# [NEXUS_SWITCH:<IP address of switch>]
68# <hostname>=<port> (1)
69# ssh_port=<ssh port> (2)
70# username=<credential username> (3)
71# password=<credential password> (4)
72#
73# (1) For each host connected to a port on the switch, specify the hostname
74# and the Nexus physical port (interface) it is connected to.
75# (2) The TCP port for connecting via SSH to manage the switch. This is
76# port number 22 unless the switch has been configured otherwise.
77# (3) The username for logging into the switch to manage it.
78# (4) The password for logging into the switch to manage it.
79#
80# Example:
81# [NEXUS_SWITCH:1.1.1.1]
82# compute1=1/1
83# compute2=1/2
84# ssh_port=22
85# username=admin
86# password=mySecretPassword
87
88#
89# N1KV Format.
90# [N1KV:<IP address of VSM>]
91# username=<credential username>
92# password=<credential password>
93#
94# Example:
95# [N1KV:2.2.2.2]
96# username=admin
97# password=mySecretPassword
98
99[cisco_n1k]
100
101# (StrOpt) Specify the name of the integration bridge to which the VIFs are
102# attached.
103#
104integration_bridge = br-int
105
106# (StrOpt) Name of the policy profile to be associated with a port when no
107# policy profile is specified during port creates.
108#
109default_policy_profile = default-pp
110# Example: default_policy_profile = service_profile
111
112# (StrOpt) Name of the policy profile to be associated with a port owned by
113# network node (dhcp, router).
114#
115network_node_policy_profile = default-pp
116# Example: network_node_policy_profile = dhcp_pp
117
118# (StrOpt) Name of the network profile to be associated with a network when no
119# network profile is specified during network creates. Admin should pre-create
120# a network profile with this name.
121#
122# default_network_profile =
123# Example: default_network_profile = network_pool
124
125# (StrOpt) Time in seconds for which the plugin polls the VSM for updates in
126# policy profiles.
127#
128poll_duration = 10
129# Example: poll_duration = 180
130
131[database]
132connection = mysql://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}
133
134[CISCO_PLUGINS]
135vswitch_plugin = neutron.plugins.cisco.n1kv.n1kv_neutron_plugin.N1kvNeutronPluginV2
136
137[N1KV:{{ vsm_ip }}]
138password = {{ vsm_password }}
139username = {{ vsm_username }}
0140
=== modified file 'templates/havana/neutron.conf'
--- templates/havana/neutron.conf 2014-04-16 08:25:14 +0000
+++ templates/havana/neutron.conf 2014-05-02 20:16:31 +0000
@@ -27,6 +27,12 @@
2727
28{% include "parts/rabbitmq" %}28{% include "parts/rabbitmq" %}
2929
30{% if neutron_plugin and neutron_plugin == 'n1kv' -%}
31rpc_backend = neutron.openstack.common.rpc.impl_kombu
32api_extensions_path = /usr/share/pyshared/neutron/plugins/cisco/extensions
33network_auto_schedule = False
34{% endif %}
35
30[quotas]36[quotas]
31quota_driver = neutron.db.quota_db.DbQuotaDriver37quota_driver = neutron.db.quota_db.DbQuotaDriver
32{% if neutron_security_groups -%}38{% if neutron_security_groups -%}
3339
=== added file 'templates/havana/openrc'
--- templates/havana/openrc 1970-01-01 00:00:00 +0000
+++ templates/havana/openrc 2014-05-02 20:16:31 +0000
@@ -0,0 +1,15 @@
1#!/bin/sh
2#This is an example of openrc
3# READ:http://docs.openstack.org/user-guide/content/cli_openrc.html
4export OS_NO_CACHE=true
5export OS_TENANT_NAME=admin
6export OS_USERNAME={{ os_username }}
7export OS_PASSWORD={{ os_password }}
8export OS_AUTH_URL=http://{{ service_host }}:{{ service_port }}/v2.0/
9export OS_AUTH_STRATEGY=keystone
10export OS_REGION_NAME=RegionOne
11export CINDER_ENDPOINT_TYPE=publicURL
12export GLANCE_ENDPOINT_TYPE=publicURL
13export KEYSTONE_ENDPOINT_TYPE=publicURL
14export NOVA_ENDPOINT_TYPE=publicURL
15export QUANTUM_ENDPOINT_TYPE=publicURL
016
=== modified file 'templates/icehouse/neutron.conf'
--- templates/icehouse/neutron.conf 2014-04-09 07:58:21 +0000
+++ templates/icehouse/neutron.conf 2014-05-02 20:16:31 +0000
@@ -29,6 +29,12 @@
2929
30{% include "parts/rabbitmq" %}30{% include "parts/rabbitmq" %}
3131
32{% if neutron_plugin and neutron_plugin == 'n1kv' -%}
33rpc_backend = neutron.openstack.common.rpc.impl_kombu
34api_extensions_path = /usr/share/pyshared/neutron/plugins/cisco/extensions
35network_auto_schedule = False
36{% endif %}
37
32notify_nova_on_port_status_changes = True38notify_nova_on_port_status_changes = True
33notify_nova_on_port_data_changes = True39notify_nova_on_port_data_changes = True
34nova_url = {{ nova_url }}40nova_url = {{ nova_url }}
@@ -68,4 +74,4 @@
68[service_providers]74[service_providers]
69service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default75service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
70service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default76service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
71service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
72\ No newline at end of file77\ No newline at end of file
78service_provider=FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default

Subscribers

People subscribed via source and target branches