From bead0f87a0e19c88634d656b28dff271deed23f2 Mon Sep 17 00:00:00 2001 From: Subbarayudu Mukkamala Date: Fri, 3 Oct 2014 20:15:38 -0700 Subject: [PATCH 01/14] update nuage vsp charmhelpers neutron.py context.py --- hooks/charmhelpers/contrib/openstack/context.py | 16 ++++++++++++++++ hooks/charmhelpers/contrib/openstack/neutron.py | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/hooks/charmhelpers/contrib/openstack/context.py b/hooks/charmhelpers/contrib/openstack/context.py index 755e1a25..432407ac 100644 --- a/hooks/charmhelpers/contrib/openstack/context.py +++ b/hooks/charmhelpers/contrib/openstack/context.py @@ -642,6 +642,20 @@ class NeutronContext(OSContextGenerator): return ovs_ctxt + def nuage_ctxt(self): + driver = neutron_plugin_attribute(self.plugin, 'driver', + self.network_manager) + config = neutron_plugin_attribute(self.plugin, 'config', + self.network_manager) + nuage_ctxt = { + 'core_plugin': driver, + 'neutron_plugin': 'vsp', + 'neutron_security_groups': self.neutron_security_groups, + 'local_ip': unit_private_ip(), + 'config': config + } + return nuage_ctxt + def nvp_ctxt(self): driver = neutron_plugin_attribute(self.plugin, 'driver', self.network_manager) @@ -706,6 +720,8 @@ class NeutronContext(OSContextGenerator): if self.plugin == 'ovs': ctxt.update(self.ovs_ctxt()) + elif self.plugin == 'vsp': + ctxt.update(self.nuage_ctxt()) elif self.plugin in ['nvp', 'nsx']: ctxt.update(self.nvp_ctxt()) elif self.plugin == 'n1kv': diff --git a/hooks/charmhelpers/contrib/openstack/neutron.py b/hooks/charmhelpers/contrib/openstack/neutron.py index 84d97bca..e9dd488b 100644 --- a/hooks/charmhelpers/contrib/openstack/neutron.py +++ b/hooks/charmhelpers/contrib/openstack/neutron.py @@ -142,6 +142,20 @@ def neutron_plugins(): 'server_packages': ['neutron-server', 'neutron-plugin-cisco'], 'server_services': ['neutron-server'] + }, + 'vsp': { + 'config': '/etc/neutron/plugins/nuage/nuage_plugin.ini', + 'driver': 'neutron.plugins.nuage.plugin.NuagePlugin', + 'contexts': [ + context.SharedDBContext(user=config('neutron-database-user'), + database=config('neutron-database'), + relation_prefix='neutron', + ssl_dir=NEUTRON_CONF_DIR)], + 'services': [], + 'packages': [], + 'server_packages': ['neutron-server', + 'neutron-plugin-nuage'], + 'server_services': ['neutron-server'] } } if release >= 'icehouse': From 75df7093178857887e64cc6cc134a3f431a47c01 Mon Sep 17 00:00:00 2001 From: Subbarayudu Mukkamala Date: Tue, 4 Nov 2014 06:54:10 -0800 Subject: [PATCH 02/14] nova.conf fixes --- templates/juno/nova.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/juno/nova.conf b/templates/juno/nova.conf index 7e51a503..83d650bd 100644 --- a/templates/juno/nova.conf +++ b/templates/juno/nova.conf @@ -57,6 +57,13 @@ firewall_driver = nova.virt.firewall.NoopFirewallDriver {% endif -%} {% endif -%} +{% if neutron_plugin and neutron_plugin == 'vsp' -%} +network_api_class=nova.network.neutronv2.api.API +libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver +neutron_ovs_bridge=alubr0 +security_group_api=nova +{% endif -%} + {% if neutron_plugin and (neutron_plugin == 'nvp' or neutron_plugin == 'nsx') -%} libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtOpenVswitchVirtualPortDriver security_group_api = neutron From d12ae7244660cf7bdcbfb0adadccc7211e51502c Mon Sep 17 00:00:00 2001 From: Aniket Bhat Date: Tue, 4 Nov 2014 10:42:08 -0500 Subject: [PATCH 03/14] Added firewall_driver conf option to nova-compute config --- templates/juno/nova.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/juno/nova.conf b/templates/juno/nova.conf index 83d650bd..5cc4715a 100644 --- a/templates/juno/nova.conf +++ b/templates/juno/nova.conf @@ -62,6 +62,7 @@ network_api_class=nova.network.neutronv2.api.API libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver neutron_ovs_bridge=alubr0 security_group_api=nova +firewall_driver = nova.virt.firewall.NoopFirewallDriver {% endif -%} {% if neutron_plugin and (neutron_plugin == 'nvp' or neutron_plugin == 'nsx') -%} From a1caee10a7beab19d39d203df8b0201c1f992271 Mon Sep 17 00:00:00 2001 From: Aniket Bhat Date: Tue, 4 Nov 2014 14:12:49 -0500 Subject: [PATCH 04/14] Adding nova.conf to icehouse --- templates/icehouse/nova.conf | 125 +++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 templates/icehouse/nova.conf diff --git a/templates/icehouse/nova.conf b/templates/icehouse/nova.conf new file mode 100644 index 00000000..5cc4715a --- /dev/null +++ b/templates/icehouse/nova.conf @@ -0,0 +1,125 @@ +# havana +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +{% if restart_trigger -%} +# restart trigger: {{ restart_trigger }} +{% endif -%} +############################################################################### +[DEFAULT] +dhcpbridge_flagfile=/etc/nova/nova.conf +dhcpbridge=/usr/bin/nova-dhcpbridge +logdir=/var/log/nova +state_path=/var/lib/nova +lock_path=/var/lock/nova +force_dhcp_release=True +libvirt_use_virtio_for_bridges=True +verbose=True +use_syslog = {{ use_syslog }} +ec2_private_dns_show_ip=True +api_paste_config=/etc/nova/api-paste.ini +enabled_apis=ec2,osapi_compute,metadata +auth_strategy=keystone +compute_driver=libvirt.LibvirtDriver + +{% include "parts/database" %} + +{% include "parts/rabbitmq" %} + +{% if glance_api_servers -%} +glance_api_servers = {{ glance_api_servers }} +{% endif -%} + +{% if console_vnc_type -%} +vnc_enabled = True +novnc_enabled = True +vnc_keymap = {{ console_keymap }} +vncserver_listen = 0.0.0.0 +vncserver_proxyclient_address = {{ console_listen_addr }} +{% if console_access_protocol == 'novnc' or console_access_protocol == 'vnc' -%} +novncproxy_base_url = {{ novnc_proxy_address }} +{% endif -%} +{% if console_access_protocol == 'xvpvnc' or console_access_protocol == 'vnc' -%} +xvpvncproxy_port = {{ xvpvnc_proxy_port }} +xvpvncproxy_host = {{ xvpvnc_proxy_host }} +xvpvncproxy_base_url = {{ xvpvnc_proxy_address }} +{% endif -%} +{% else -%} +vnc_enabled = False +novnc_enabled = False +{% endif -%} + +{% if neutron_plugin and neutron_plugin == 'ovs' -%} +libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtGenericVIFDriver +{% if neutron_security_groups -%} +security_group_api = neutron +firewall_driver = nova.virt.firewall.NoopFirewallDriver +{% endif -%} +{% endif -%} + +{% if neutron_plugin and neutron_plugin == 'vsp' -%} +network_api_class=nova.network.neutronv2.api.API +libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver +neutron_ovs_bridge=alubr0 +security_group_api=nova +firewall_driver = nova.virt.firewall.NoopFirewallDriver +{% endif -%} + +{% if neutron_plugin and (neutron_plugin == 'nvp' or neutron_plugin == 'nsx') -%} +libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtOpenVswitchVirtualPortDriver +security_group_api = neutron +firewall_driver = nova.virt.firewall.NoopFirewallDriver +{% endif -%} + +{% if network_manager_config -%} +{% for key, value in network_manager_config.iteritems() -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif -%} + +{% if network_manager == 'neutron' -%} +network_api_class = nova.network.neutronv2.api.API +{% else -%} +network_manager = nova.network.manager.FlatDHCPManager +{% endif -%} + +{% if volume_service -%} +volume_api_class = nova.volume.cinder.API +{% endif -%} + +{% if user_config_flags -%} +{% for key, value in user_config_flags.iteritems() -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif -%} + +{% if instances_path -%} +instances_path = {{ instances_path }} +{% endif -%} + +{% if sections and 'DEFAULT' in sections -%} +{% for key, value in sections['DEFAULT'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif -%} + +{% if console_access_protocol == 'spice' -%} +[spice] +agent_enabled = True +enabled = True +html5proxy_base_url = {{ spice_proxy_address }} +keymap = {{ console_keymap }} +server_listen = 0.0.0.0 +server_proxyclient_address = {{ console_listen_addr }} +{% endif -%} + +[libvirt] +{% if rbd_pool -%} +rbd_pool = {{ rbd_pool }} +rbd_user = {{ rbd_user }} +rbd_secret_uuid = {{ rbd_secret_uuid }} +{% endif -%} +{% if live_migration_uri -%} +live_migration_uri = {{ live_migration_uri }} +{% endif -%} + From 5b4680a8eeacc10f2cf41010da0fe774c3929415 Mon Sep 17 00:00:00 2001 From: Subbarayudu Mukkamala Date: Wed, 11 Feb 2015 08:04:42 -0800 Subject: [PATCH 05/14] Fix Merge related syntax error: missing }, --- hooks/charmhelpers/contrib/openstack/neutron.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hooks/charmhelpers/contrib/openstack/neutron.py b/hooks/charmhelpers/contrib/openstack/neutron.py index 102a0ad5..6821ed4b 100644 --- a/hooks/charmhelpers/contrib/openstack/neutron.py +++ b/hooks/charmhelpers/contrib/openstack/neutron.py @@ -173,6 +173,7 @@ def neutron_plugins(): 'server_packages': ['neutron-server', 'neutron-plugin-nuage'], 'server_services': ['neutron-server'] + }, 'Calico': { 'config': '/etc/neutron/plugins/ml2/ml2_conf.ini', 'driver': 'neutron.plugins.ml2.plugin.Ml2Plugin', From 49e5d472769c9d3e7b72fdbc0efff8ffa8a99429 Mon Sep 17 00:00:00 2001 From: Subbarayudu Mukkamala Date: Wed, 11 Feb 2015 20:20:50 -0800 Subject: [PATCH 06/14] Fix default for disable-neutron-security-groups --- config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index 013d86b3..427afe5f 100644 --- a/config.yaml +++ b/config.yaml @@ -124,7 +124,7 @@ options: this allows you to differentiate between them. disable-neutron-security-groups: type: boolean - default: + default: False description: | Disable neutron based security groups - setting this configuration option will override any settings configured via the nova-cloud-controller charm. From 01f69e8a4bf5cd3ecc99f4318230b7e0805a865a Mon Sep 17 00:00:00 2001 From: Subbarayudu Mukkamala Date: Thu, 9 Apr 2015 20:20:43 -0700 Subject: [PATCH 07/14] templates/icehouse/nova.conf with template comment: replace havana with icehouse --- templates/icehouse/nova.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/icehouse/nova.conf b/templates/icehouse/nova.conf index 5cc4715a..d5913ab5 100644 --- a/templates/icehouse/nova.conf +++ b/templates/icehouse/nova.conf @@ -1,4 +1,4 @@ -# havana +# icehouse ############################################################################### # [ WARNING ] # Configuration file maintained by Juju. Local changes may be overwritten. From debd75032258404635f3a1f8d789ecaf4a92c02c Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Mon, 13 Apr 2015 13:22:05 +0100 Subject: [PATCH 08/14] [trivial] make debug and verbose configurable --- config.yaml | 8 ++++++++ hooks/nova_compute_utils.py | 3 ++- templates/havana/nova.conf | 3 ++- templates/icehouse/nova.conf | 3 ++- templates/juno/nova.conf | 3 ++- templates/kilo/nova.conf | 3 ++- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/config.yaml b/config.yaml index 91db1a8a..60f04628 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,12 @@ options: + debug: + default: False + type: boolean + description: "Enable debug logging" + verbose: + default: False + type: boolean + description: "Enable verbose logging" openstack-origin: default: distro type: string diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index b3dbeb51..e4c0d46e 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -104,7 +104,8 @@ BASE_RESOURCE_MAP = { context.ZeroMQContext(), context.NotificationDriverContext(), MetadataServiceContext(), - HostIPContext()], + HostIPContext(), + context.LogLevelContext()], }, } diff --git a/templates/havana/nova.conf b/templates/havana/nova.conf index e88b92c5..2e0808aa 100644 --- a/templates/havana/nova.conf +++ b/templates/havana/nova.conf @@ -7,6 +7,8 @@ {% endif -%} ############################################################################### [DEFAULT] +verbose={{ verbose }} +debug={{ debug }} dhcpbridge_flagfile=/etc/nova/nova.conf dhcpbridge=/usr/bin/nova-dhcpbridge logdir=/var/log/nova @@ -21,7 +23,6 @@ libvirt_disk_prefix=vd libvirt_use_virtio_for_bridges=True {% endif -%} -verbose=True use_syslog = {{ use_syslog }} ec2_private_dns_show_ip=True api_paste_config=/etc/nova/api-paste.ini diff --git a/templates/icehouse/nova.conf b/templates/icehouse/nova.conf index ff4c2dd3..0cf8720f 100644 --- a/templates/icehouse/nova.conf +++ b/templates/icehouse/nova.conf @@ -7,6 +7,8 @@ {% endif -%} ############################################################################### [DEFAULT] +verbose={{ verbose }} +debug={{ debug }} dhcpbridge_flagfile=/etc/nova/nova.conf dhcpbridge=/usr/bin/nova-dhcpbridge logdir=/var/log/nova @@ -21,7 +23,6 @@ libvirt_disk_prefix=vd libvirt_use_virtio_for_bridges=True {% endif -%} -verbose=True use_syslog = {{ use_syslog }} ec2_private_dns_show_ip=True api_paste_config=/etc/nova/api-paste.ini diff --git a/templates/juno/nova.conf b/templates/juno/nova.conf index ee198197..56e056cd 100644 --- a/templates/juno/nova.conf +++ b/templates/juno/nova.conf @@ -7,6 +7,8 @@ {% endif -%} ############################################################################### [DEFAULT] +verbose={{ verbose }} +debug={{ debug }} dhcpbridge_flagfile=/etc/nova/nova.conf dhcpbridge=/usr/bin/nova-dhcpbridge logdir=/var/log/nova @@ -21,7 +23,6 @@ libvirt_disk_prefix=vd libvirt_use_virtio_for_bridges=True {% endif -%} -verbose=True use_syslog = {{ use_syslog }} ec2_private_dns_show_ip=True api_paste_config=/etc/nova/api-paste.ini diff --git a/templates/kilo/nova.conf b/templates/kilo/nova.conf index db8abf42..fd756250 100644 --- a/templates/kilo/nova.conf +++ b/templates/kilo/nova.conf @@ -7,12 +7,13 @@ {% endif -%} ############################################################################### [DEFAULT] +verbose={{ verbose }} +debug={{ debug }} dhcpbridge_flagfile=/etc/nova/nova.conf dhcpbridge=/usr/bin/nova-dhcpbridge logdir=/var/log/nova state_path=/var/lib/nova force_dhcp_release=True -verbose=True use_syslog = {{ use_syslog }} ec2_private_dns_show_ip=True api_paste_config=/etc/nova/api-paste.ini From 89a899b27233bb129a1e2cdb2764373c4091a1c2 Mon Sep 17 00:00:00 2001 From: "james.page@ubuntu.com" <> Date: Mon, 13 Apr 2015 13:46:16 +0100 Subject: [PATCH 09/14] [trivial] Restore dropped peer relation --- metadata.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metadata.yaml b/metadata.yaml index 27962a38..8b7f916d 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -33,3 +33,6 @@ requires: zeromq-configuration: interface: zeromq-configuration scope: container +peers: + compute-peer: + interface: nova From 189912518a6ecac8674243ecdbbb70ab79f3626a Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Tue, 14 Apr 2015 05:16:31 +0000 Subject: [PATCH 10/14] sync charm helpers --- hooks/charmhelpers/contrib/openstack/templates/git.upstart | 4 ++++ hooks/charmhelpers/core/strutils.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hooks/charmhelpers/contrib/openstack/templates/git.upstart b/hooks/charmhelpers/contrib/openstack/templates/git.upstart index da94ad12..4bed404b 100644 --- a/hooks/charmhelpers/contrib/openstack/templates/git.upstart +++ b/hooks/charmhelpers/contrib/openstack/templates/git.upstart @@ -9,5 +9,9 @@ respawn exec start-stop-daemon --start --chuid {{ user_name }} \ --chdir {{ start_dir }} --name {{ process_name }} \ --exec {{ executable_name }} -- \ + {% for config_file in config_files -%} --config-file={{ config_file }} \ + {% endfor -%} + {% if log_file -%} --log-file={{ log_file }} + {% endif -%} diff --git a/hooks/charmhelpers/core/strutils.py b/hooks/charmhelpers/core/strutils.py index efc4402e..a2a784aa 100644 --- a/hooks/charmhelpers/core/strutils.py +++ b/hooks/charmhelpers/core/strutils.py @@ -33,9 +33,9 @@ def bool_from_string(value): value = value.strip().lower() - if value in ['y', 'yes', 'true', 't']: + if value in ['y', 'yes', 'true', 't', 'on']: return True - elif value in ['n', 'no', 'false', 'f']: + elif value in ['n', 'no', 'false', 'f', 'off']: return False msg = "Unable to interpret string value '%s' as boolean" % (value) From 57ef9b2454e702df0bf72cc6d7bfab482d49708d Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Tue, 14 Apr 2015 05:16:59 +0000 Subject: [PATCH 11/14] flip amulet test debug on --- tests/basic_deployment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index aeb2fafe..b9f6980f 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -14,7 +14,7 @@ from charmhelpers.contrib.openstack.amulet.utils import ( ) # Use DEBUG to turn on debug logging -u = OpenStackAmuletUtils(ERROR) +u = OpenStackAmuletUtils(DEBUG) class NovaBasicDeployment(OpenStackAmuletDeployment): From f6f44e153a530fb7cd9d3a5ddd35429fd9d36515 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Tue, 14 Apr 2015 05:17:22 +0000 Subject: [PATCH 12/14] flip amulet next charm on --- tests/basic_deployment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index b9f6980f..0fd8ece5 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -20,7 +20,7 @@ u = OpenStackAmuletUtils(DEBUG) class NovaBasicDeployment(OpenStackAmuletDeployment): """Amulet tests on a basic nova compute deployment.""" - def __init__(self, series=None, openstack=None, source=None, stable=True): + def __init__(self, series=None, openstack=None, source=None, stable=False): """Deploy the entire test environment.""" super(NovaBasicDeployment, self).__init__(series, openstack, source, stable) self._add_services() From 5babd7e1c198401083c11e8c129b2d803e4a722a Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Tue, 14 Apr 2015 05:21:40 +0000 Subject: [PATCH 13/14] explicitly install librbd1 re: bug 1440953 --- hooks/nova_compute_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index e4c0d46e..3d1aa712 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -57,6 +57,7 @@ TEMPLATES = 'templates/' BASE_PACKAGES = [ 'nova-compute', 'genisoimage', # was missing as a package dependency until raring. + 'librbd1', # bug 1440953 'python-six', ] From f8d2ca8352bdebb250deb94bf7db74b4a88b8a13 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Tue, 14 Apr 2015 05:26:04 +0000 Subject: [PATCH 14/14] delint --- hooks/nova_compute_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index 3d1aa712..56dc1074 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -57,7 +57,7 @@ TEMPLATES = 'templates/' BASE_PACKAGES = [ 'nova-compute', 'genisoimage', # was missing as a package dependency until raring. - 'librbd1', # bug 1440953 + 'librbd1', # bug 1440953 'python-six', ]