Deprecate support for nova-network

This commit is contained in:
Alberto Murillo
2015-12-23 11:16:33 -06:00
parent 69764f8de3
commit d92067aab5
6 changed files with 5 additions and 119 deletions
+2 -5
View File
@@ -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
-24
View File
@@ -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"
-45
View File
@@ -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])
]
}
-8
View File
@@ -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')
-27
View File
@@ -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)
+3 -10
View File
@@ -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'])