From d92067aab52214419d38a383af5c082de8835dd6 Mon Sep 17 00:00:00 2001 From: Alberto Murillo Date: Wed, 23 Dec 2015 11:16:33 -0600 Subject: [PATCH] Deprecate support for nova-network --- clearstack/modules/neutron.py | 7 ++--- clearstack/modules/nova.py | 24 --------------- clearstack/plugins/nova_400.py | 45 ---------------------------- clearstack/templates/nova.py | 8 ----- clearstack/templates/nova_compute.py | 27 ----------------- clearstack/templates/provision.py | 13 ++------ 6 files changed, 5 insertions(+), 119 deletions(-) diff --git a/clearstack/modules/neutron.py b/clearstack/modules/neutron.py index 8f4fe5c..dfe82c4 100644 --- a/clearstack/modules/neutron.py +++ b/clearstack/modules/neutron.py @@ -206,11 +206,8 @@ class Neutron(OpenStackService): util.write_config("/etc/neutron/vpnaas_agent.ini", config) self._services += ['ipsec', 'neutron-vpn-agent'] - def create_network(self, name, public=None): - if public: - cidr = IPv4Network(CONF['CONFIG_NOVA_NETWORK_FLOATRANGE']) - else: - cidr = IPv4Network(CONF['CONFIG_NOVA_NETWORK_FIXEDRANGE']) + def create_network(self, name, network, public=None): + cidr = IPv4Network(network) cidr_e = cidr.exploded cidr_gw = (cidr.network_address + 1).exploded cidr_start = (cidr.network_address + 2).exploded diff --git a/clearstack/modules/nova.py b/clearstack/modules/nova.py index 1297038..2194440 100644 --- a/clearstack/modules/nova.py +++ b/clearstack/modules/nova.py @@ -53,30 +53,6 @@ class Nova(OpenStackService): LOG.debug("syncing database") util.run_command("su -s /bin/sh -c \"nova-manage db sync\" nova") - def create_network(self): - LOG.debug("Creating network") - command = ("nova-manage network create --bridge=br100" - "--label=demo-net --fixed_range_v4=%s" - % CONF['CONFIG_NOVA_NETWORK_FIXEDRANGE']) - try: - util.run_command("nova network-show demo-net", environ=self._env) - except: - command = ("nova-manage network create --bridge=br100 " - "--label=demo-net --fixed_range_v4=%s" - % CONF['CONFIG_NOVA_NETWORK_FIXEDRANGE']) - if util.str2bool(CONF['CONFIG_NOVA_NETWORK_MULTIHOST']): - command += " --multi_host=T" - util.run_command(command, environ=self._env) - - def create_floating_ips(self): - LOG.debug("Creating floating ips") - try: - util.run_command("nova floating-ip-pool-list | grep nova") - except: - cmd = ("nova-manage floating create --pool nova " - "--ip_range=%s" % CONF['CONFIG_NOVA_NETWORK_FLOATRANGE']) - util.run_command(cmd, environ=self._env) - def ceilometer_enable(self, configfile): ceilometer = Ceilometer.get() ceilometer_cfg = "/etc/ceilometer/ceilometer.conf" diff --git a/clearstack/plugins/nova_400.py b/clearstack/plugins/nova_400.py index be812b7..17f43a8 100644 --- a/clearstack/plugins/nova_400.py +++ b/clearstack/plugins/nova_400.py @@ -38,51 +38,6 @@ def init_config(): "CONFIG_NOVA_KS_PW", utils.generate_random_pw(), validators=[validators.not_empty]) - ], - "NOVA_NETWORK": [ - Argument("nova-compute-privif", - "Private interface for Flat DHCP on" - " the Nova compute servers", - "CONFIG_NOVA_COMPUTE_PRIVIF", - util.get_net_interface(), - validators=[validators.not_empty]), - Argument("nova-network-manager", - "Nova network manager", - "CONFIG_NOVA_NETWORK_MANAGER", - "nova.network.manager.FlatDHCPManager", - validators=[validators.not_empty]), - Argument("nova-network-pubif", - "Public interface on the Nova network server", - "CONFIG_NOVA_NETWORK_PUBIF", - util.get_net_interface(), - validators=[validators.not_empty]), - Argument("nova-network-fixed-range", - "IP Range for flat DHCP.", - "CONFIG_NOVA_NETWORK_FIXEDRANGE", - "192.168.32.0/22", - validators=[validators.cidr]), - Argument("nova-network-floating-range", - "IP Range for floating IP addresses.", - "CONFIG_NOVA_NETWORK_FLOATRANGE", - "10.3.4.0/22", - validators=[validators.cidr]), - Argument("nova-network-auto-assign-floating-ip", - "Specify 'y' to automatically assign a floating IP to " - "new instances ['y', 'n']", - "CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP", - "n", - options=['y', 'n'], - validators=[validators.y_or_n]), - Argument("nova-network-size", - "Number of addresses in each private subnet", - "CONFIG_NOVA_NETWORK_SIZE", - "255", - validators=[validators.digit]), - Argument("nova-network-multihost", - "Nova network multihost", - "CONFIG_NOVA_NETWORK_MULTIHOST", - "True", - validators=[validators.true_or_false]) ] } diff --git a/clearstack/templates/nova.py b/clearstack/templates/nova.py index 14dd54e..3445e48 100644 --- a/clearstack/templates/nova.py +++ b/clearstack/templates/nova.py @@ -52,14 +52,6 @@ config = \ "host=%s\n" % CONF['CONFIG_CONTROLLER_HOST'] util.write_config(config_file, config) -# Setup nova-network if neutron is not installed -if not util.str2bool(CONF['CONFIG_NEUTRON_INSTALL']): - config = \ - "[DEFAULT]\n" + \ - "network_api_class = nova.network.api.API\n" + \ - "security_group_api = nova\n" - util.write_config(config_file, config) - if CONF['CONFIG_HTTP_SERVICE'] == 'nginx': util.link_file('/usr/share/nginx/conf.d/nova-api.template', '/etc/nginx/nova-api.conf') diff --git a/clearstack/templates/nova_compute.py b/clearstack/templates/nova_compute.py index 2d47651..a0ee5c6 100644 --- a/clearstack/templates/nova_compute.py +++ b/clearstack/templates/nova_compute.py @@ -63,33 +63,6 @@ if not clearlinux.support_hw_acceleration(): util.write_config(config_file, config) -# Setup compute Networking -if not util.str2bool(CONF['CONFIG_NEUTRON_INSTALL']): - services.append("nova-network") - network_manager = CONF['CONFIG_NOVA_NETWORK_MANAGER'] - network_size = CONF['CONFIG_NOVA_NETWORK_SIZE'] - multihost = CONF['CONFIG_NOVA_NETWORK_MULTIHOST'] - network_pubif = CONF['CONFIG_NOVA_NETWORK_PUBIF'] - network_privif = CONF['CONFIG_NOVA_COMPUTE_PRIVIF'] - config = \ - "[DEFAULT]\n" + \ - "network_api_class=nova.network.api.API\n" + \ - "security_group_api=nova\n" + \ - "firewall_driver=" + \ - "nova.virt.libvirt.firewall.IptablesFirewallDriver\n" + \ - "network_size=%s\n" % network_size + \ - "allow_same_net_traffic=False\n" + \ - "multi_host=%s\n" % multihost + \ - "send_arp_for_ha=True\n" + \ - "share_dhcp_address=True\n" + \ - "force_dhcp_release=True\n" + \ - "flat_network_bridge=br100\n" + \ - "public_interface=%s\n" % network_pubif + \ - "flat_interface=%s\n" % network_privif - if util.str2bool(CONF['CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP']): - config += "auto_assign_floating_ip = True\n" - util.write_config(config_file, config) - if util.str2bool(CONF['CONFIG_CEILOMETER_INSTALL']): nova.ceilometer_enable(config_file) diff --git a/clearstack/templates/provision.py b/clearstack/templates/provision.py index 27c04a5..98e67e6 100644 --- a/clearstack/templates/provision.py +++ b/clearstack/templates/provision.py @@ -31,14 +31,7 @@ if util.str2bool(CONF['CONFIG_PROVISION_DEMO']): format = CONF['CONFIG_PROVISION_IMAGE_FORMAT'] url = CONF['CONFIG_PROVISION_IMAGE_URL'] glance.create_image(name, format, url, public=True) - - fr = CONF['CONFIG_PROVISION_DEMO_FLOATRANGE'] - CONF['CONFIG_NOVA_NETWORK_FLOATRANGE'] = fr - -if not util.str2bool(CONF['CONFIG_NEUTRON_INSTALL']): - nova.create_network() - nova.create_floating_ips() -else: - neutron.create_network('private', public=False) - neutron.create_network('public', public=True) + floating_range = CONF['CONFIG_PROVISION_DEMO_FLOATRANGE'] + neutron.create_network('private', '10.0.0.0/24', public=False) + neutron.create_network('public', floating_range, public=True) neutron.create_router('router', gw='public', interfaces=['private'])