Remove support for nova-network

Nova has removed support for the network service in ocata

cf72bb8f90

This patch removes the option to deploy nova-network using
packstack. As such, it forces to enable neutron. Otherwise
it returns error.

Change-Id: If9365dc65548a0dc0d1b643df457514db6000c09
Closes-Bug: #1651776
This commit is contained in:
Alfredo Moralejo 2016-12-22 04:13:01 -05:00
parent 7b1d09f654
commit b546742f35
11 changed files with 33 additions and 425 deletions

View File

@ -51,7 +51,7 @@ Global Options
Specify 'y' to install OpenStack Compute (nova). ['y', 'n']
**CONFIG_NEUTRON_INSTALL**
Specify 'y' to install OpenStack Networking (neutron); otherwise, Compute Networking (nova) will be used. ['y', 'n']
Specify 'y' to install OpenStack Networking (neutron) ['y']
**CONFIG_HORIZON_INSTALL**
Specify 'y' to install OpenStack Dashboard (horizon). ['y', 'n']
@ -114,7 +114,7 @@ Global Options
Specify 'y' if you want to use unsupported parameters. This should be used only if you know what you are doing. Issues caused by using unsupported options will not be fixed before the next major release. ['y', 'n']
**CONFIG_USE_SUBNETS**
Specify 'y' if you want to use subnet addresses (in CIDR format) instead of interface names in following options: CONFIG_NOVA_COMPUTE_PRIVIF, CONFIG_NOVA_NETWORK_PRIVIF, CONFIG_NOVA_NETWORK_PUBIF, CONFIG_NEUTRON_OVS_BRIDGE_IFACES, CONFIG_NEUTRON_LB_INTERFACE_MAPPINGS, CONFIG_NEUTRON_OVS_TUNNEL_IF. This is useful for cases when interface names are not same on all installation hosts.
Specify 'y' if you want to use subnet addresses (in CIDR format) instead of interface names in following options: CONFIG_NEUTRON_OVS_BRIDGE_IFACES, CONFIG_NEUTRON_LB_INTERFACE_MAPPINGS, CONFIG_NEUTRON_OVS_TUNNEL_IF. This is useful for cases when interface names are not same on all installation hosts.
SSL setup
---------
@ -771,42 +771,6 @@ Nova Options
**CONFIG_VNC_SSL_KEY**
SSL keyfile corresponding to the certificate if one was entered. If CONFIG_HORIZON_SSL is set to 'n' this parameter is ignored.
Nova Network Options
--------------------
**CONFIG_NOVA_COMPUTE_PRIVIF**
Private interface for flat DHCP on the Compute servers.
**CONFIG_NOVA_NETWORK_MANAGER**
Compute Network Manager. ['^nova\\.network\\.manager\\.\\w+Manager$']
**CONFIG_NOVA_NETWORK_PUBIF**
Public interface on the Compute network server.
**CONFIG_NOVA_NETWORK_PRIVIF**
Private interface for flat DHCP on the Compute network server.
**CONFIG_NOVA_NETWORK_FIXEDRANGE**
IP Range for flat DHCP. ['^[\\:\\.\\da-fA-f]+(\\/\\d+){0,1}$']
**CONFIG_NOVA_NETWORK_FLOATRANGE**
IP Range for floating IP addresses. ['^[\\:\\.\\da-fA-f]+(\\/\\d+){0,1}$']
**CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP**
Specify 'y' to automatically assign a floating IP to new instances. ['y', 'n']
Nova Network VLAN Options
-------------------------
**CONFIG_NOVA_NETWORK_VLAN_START**
First VLAN for private networks (Compute networking).
**CONFIG_NOVA_NETWORK_NUMBER**
Number of networks to support (Compute networking).
**CONFIG_NOVA_NETWORK_SIZE**
Number of addresses in each private subnet (Compute networking).
Neutron config
--------------

View File

@ -748,15 +748,6 @@ def single_step_aio_install(options, logFile):
options.install_hosts = utils.get_localhost_ip()
# Also allow the command line to set values for any of these options
# by testing if they have been set before we set them here
if not options.novanetwork_pubif:
options.novanetwork_pubif = utils.device_from_ip(options.install_hosts)
if not options.novacompute_privif:
options.novacompute_privif = ''
if not options.novanetwork_privif:
options.novanetwork_privif = ''
single_step_install(options, logFile)

View File

@ -384,3 +384,15 @@ def validate_multi_export(param, options=None):
"""
for export in param.split(","):
validate_export(export)
def validate_neutron(param, options=None):
"""
Raises ParamValidationError if neutron is not enabled.
This is intended to make user aware nova-network has been removed
in ocata cycle.
"""
validate_options(param, options=options)
if param != 'y':
msg = ('Nova network support has been removed in Ocata. Neutron service must be enabled')
raise ParamValidationError(msg)

View File

@ -26,7 +26,6 @@ from packstack.installer import processors
from packstack.installer import utils
from packstack.installer import validators
from packstack.modules import common
from packstack.modules.common import filtered_hosts
from packstack.modules.documentation import update_params_usage
from packstack.modules.ospluginutils import deliver_ssl_file
@ -226,148 +225,9 @@ def initConfig(controller):
"NEED_CONFIRM": True,
"CONDITION": False},
],
"NOVA_NETWORK": [
{"CMD_OPTION": "novacompute-privif",
"PROMPT": ("Enter the Private interface for Flat DHCP on the Nova"
" compute servers"),
"OPTION_LIST": [],
"VALIDATORS": [],
"DEFAULT_VALUE": '',
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_COMPUTE_PRIVIF",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-manager",
"PROMPT": "Enter the Nova network manager",
"OPTION_LIST": [r'^nova\.network\.manager\.\w+Manager$'],
"VALIDATORS": [validators.validate_regexp],
"DEFAULT_VALUE": "nova.network.manager.FlatDHCPManager",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_MANAGER",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-pubif",
"PROMPT": "Enter the Public interface on the Nova network server",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": primary_netif,
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_PUBIF",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-privif",
"PROMPT": ("Enter the Private interface for network manager on "
"the Nova network server"),
"OPTION_LIST": [],
"VALIDATORS": [],
"DEFAULT_VALUE": '',
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_PRIVIF",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-fixed-range",
"PROMPT": "Enter the IP Range for network manager",
"OPTION_LIST": ["^[\:\.\da-fA-f]+(\/\d+){0,1}$"],
"PROCESSORS": [processors.process_cidr],
"VALIDATORS": [validators.validate_regexp],
"DEFAULT_VALUE": "192.168.32.0/22",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_FIXEDRANGE",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-floating-range",
"PROMPT": "Enter the IP Range for Floating IP's",
"OPTION_LIST": ["^[\:\.\da-fA-f]+(\/\d+){0,1}$"],
"PROCESSORS": [processors.process_cidr],
"VALIDATORS": [validators.validate_regexp],
"DEFAULT_VALUE": "10.3.4.0/22",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_FLOATRANGE",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-auto-assign-floating-ip",
"PROMPT": ("Should new instances automatically have a floating "
"IP assigned?"),
"OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options],
"DEFAULT_VALUE": "n",
"MASK_INPUT": False,
"LOOSE_VALIDATION": False,
"CONF_NAME": "CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
],
"NOVA_NETWORK_VLAN": [
{"CMD_OPTION": "novanetwork-vlan-start",
"PROMPT": "Enter first VLAN for private networks",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": 100,
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_VLAN_START",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-num-networks",
"PROMPT": "How many networks should be supported",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": 1,
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_NUMBER",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "novanetwork-network-size",
"PROMPT": "How many addresses should be in each private subnet",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": 255,
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_NOVA_NETWORK_SIZE",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
],
}
update_params_usage(basedefs.PACKSTACK_DOC, nova_params)
def use_nova_network(config):
return (config['CONFIG_NOVA_INSTALL'] == 'y' and
config['CONFIG_NEUTRON_INSTALL'] != 'y')
def use_nova_network_vlan(config):
manager = 'nova.network.manager.VlanManager'
return (config['CONFIG_NOVA_INSTALL'] == 'y' and
config['CONFIG_NEUTRON_INSTALL'] != 'y' and
config['CONFIG_NOVA_NETWORK_MANAGER'] == manager)
nova_groups = [
{"GROUP_NAME": "NOVA",
"DESCRIPTION": "Nova Options",
@ -375,20 +235,6 @@ def initConfig(controller):
"PRE_CONDITION_MATCH": "y",
"POST_CONDITION": False,
"POST_CONDITION_MATCH": True},
{"GROUP_NAME": "NOVA_NETWORK",
"DESCRIPTION": "Nova Network Options",
"PRE_CONDITION": use_nova_network,
"PRE_CONDITION_MATCH": True,
"POST_CONDITION": False,
"POST_CONDITION_MATCH": True},
{"GROUP_NAME": "NOVA_NETWORK_VLAN",
"DESCRIPTION": "Nova Network VLAN Options",
"PRE_CONDITION": use_nova_network_vlan,
"PRE_CONDITION_MATCH": True,
"POST_CONDITION": False,
"POST_CONDITION_MATCH": True},
]
for group in nova_groups:
params = nova_params[group["GROUP_NAME"]]
@ -403,9 +249,6 @@ def initSequences(controller):
network_title = ('Preparing OpenStack Network-related '
'Nova entries')
network_function = create_neutron_manifest
else:
network_title = 'Preparing Nova Network entries'
network_function = create_network_manifest
novaapisteps = [
{'title': 'Preparing Nova API entries',
@ -430,70 +273,6 @@ def initSequences(controller):
novaapisteps)
# ------------------------- helper functions -------------------------
def check_ifcfg(host, device):
"""
Raises ScriptRuntimeError if given host does not have give device.
"""
server = utils.ScriptRunner(host)
cmd = "ip addr show dev %s || ( echo Device %s does not exist && exit 1 )"
server.append(cmd % (device, device))
server.execute()
def bring_up_ifcfg(host, device):
"""
Brings given device up if it's down. Raises ScriptRuntimeError in case
of failure.
"""
server = utils.ScriptRunner(host)
server.append('ip link show up | grep "%s"' % device)
try:
server.execute()
except exceptions.ScriptRuntimeError:
server.clear()
cmd = 'ip link set dev %s up'
server.append(cmd % device)
try:
server.execute()
except exceptions.ScriptRuntimeError:
msg = ('Failed to bring up network interface %s on host %s.'
' Interface should be up so OpenStack can work'
' properly.' % (device, host))
raise exceptions.ScriptRuntimeError(msg)
def dummy_interface(host):
"""Creates dummy interface on given hosts.
Returns interface name.
"""
# Only single dummy interface will be created, hence the name is hardcoded
ifname = 'dummy'
script = (
'DEVICE={0}\n'
'BOOTPROTO=none\n'
'ONBOOT=yes\n'
'TYPE=Ethernet\n'
'NM_CONTROLLED=no\n'.format(ifname)
)
server = utils.ScriptRunner(host)
server.append(
'ip link show {ifname} || ('
'modprobe dummy && '
'ip link set name {ifname} dev dummy0 && '
'ip link set dev dummy address 06:66:DE:AF:66:60'
')'.format(**locals())
)
server.append(
'cat > /etc/sysconfig/network-scripts/ifcfg-{ifname} '
'<<EOF\n{script}EOF'.format(**locals())
)
server.execute()
return ifname
# ------------------------ Step Functions -------------------------
def create_ssh_keys(config, messages):
@ -633,23 +412,6 @@ def create_compute_manifest(config, messages):
config[cf_fw_qemu_mig_key] = fw_details
if config['CONFIG_NEUTRON_INSTALL'] != 'y':
key = 'CONFIG_NOVA_COMPUTE_PRIVIF'
if not config[key].strip():
config[key] = dummy_interface(host)
if config['CONFIG_USE_SUBNETS'] == 'y':
netface = common.cidr_to_ifname(
config[key], host, config
)
else:
netface = config[key]
check_ifcfg(host, netface)
try:
bring_up_ifcfg(host, netface)
except exceptions.ScriptRuntimeError as ex:
# just warn user to do it by himself
messages.append(str(ex))
if config['CONFIG_CEILOMETER_INSTALL'] == 'y':
if config['CONFIG_AMQP_ENABLE_SSL'] == 'y':
ssl_cert_file = config['CONFIG_CEILOMETER_SSL_CERT'] = (
@ -674,43 +436,6 @@ def create_compute_manifest(config, messages):
config['FIREWALL_NOVA_COMPUTE_RULES'] = fw_details
def create_network_manifest(config, messages):
global compute_hosts, network_hosts
if config['CONFIG_NEUTRON_INSTALL'] == "y":
return
# set default values for VlanManager in case this values are not in config
for key, value in [('CONFIG_NOVA_NETWORK_VLAN_START', 100),
('CONFIG_NOVA_NETWORK_SIZE', 255),
('CONFIG_NOVA_NETWORK_NUMBER', 1)]:
config[key] = config.get(key, value)
api_host = config['CONFIG_CONTROLLER_HOST']
multihost = len(network_hosts) > 1
config['CONFIG_NOVA_NETWORK_MULTIHOST'] = multihost and 'true' or 'false'
for host in network_hosts:
for i in ('CONFIG_NOVA_NETWORK_PRIVIF', 'CONFIG_NOVA_NETWORK_PUBIF'):
if not config[i].strip():
config[i] = dummy_interface(host)
netface = config[i]
if config['CONFIG_USE_SUBNETS'] == 'y':
netface = common.cidr_to_ifname(netface, host, config)
check_ifcfg(host, netface)
try:
bring_up_ifcfg(host, netface)
except exceptions.ScriptRuntimeError as ex:
# just warn user to do it by himself
messages.append(str(ex))
key = 'CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP'
config[key] = config[key] == "y"
# We need to explicitly set the network size
routing_prefix = config['CONFIG_NOVA_NETWORK_FIXEDRANGE'].split('/')[1]
net_size = 2 ** (32 - int(routing_prefix))
config['CONFIG_NOVA_NETWORK_FIXEDSIZE'] = str(net_size)
def create_sched_manifest(config, messages):
if config['CONFIG_IRONIC_INSTALL'] == 'y':
ram_alloc = '1.0'
@ -800,9 +525,6 @@ def create_common_manifest(config, messages):
def create_neutron_manifest(config, messages):
if config['CONFIG_NEUTRON_INSTALL'] != "y":
return
if config['CONFIG_IRONIC_INSTALL'] == 'y':
virt_driver = 'nova.virt.firewall.NoopFirewallDriver'
config['CONFIG_NOVA_LIBVIRT_VIF_DRIVER'] = virt_driver

View File

@ -166,7 +166,7 @@ def initConfig(controller):
"Should Packstack install OpenStack Networking (Neutron)"
),
"OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_options],
"VALIDATORS": [validators.validate_neutron],
"DEFAULT_VALUE": "y",
"MASK_INPUT": False,
"LOOSE_VALIDATION": False,

View File

@ -1,14 +0,0 @@
class packstack::nova::compute::flat ()
{
$nova_compute_privif = hiera('CONFIG_NOVA_COMPUTE_PRIVIF')
$use_subnets_value = hiera('CONFIG_USE_SUBNETS')
$use_subnets = $use_subnets_value ? {
'y' => true,
default => false,
}
nova_config {
'DEFAULT/flat_interface': value => force_interface($nova_compute_privif, $use_subnets);
}
}

View File

@ -1,57 +0,0 @@
class packstack::nova::network ()
{
$multihost = hiera('CONFIG_NOVA_NETWORK_MULTIHOST')
if $multihost {
nova_config {
'DEFAULT/send_arp_for_ha': value => true;
}
}
$manager = hiera('CONFIG_NOVA_NETWORK_MANAGER')
$nova_net_manager_list = [
'nova.network.manager.VlanManager',
'nova.network.manager.FlatDHCPManager',
]
$overrides = {}
$use_subnets_value = hiera('CONFIG_USE_SUBNETS')
$use_subnets = $use_subnets_value ? {
'y' => true,
default => false,
}
if $manager in $nova_net_manager_list {
$overrides['force_dhcp_release'] = false
}
if $manager == 'nova.network.manager.VlanManager' {
$overrides['vlan_start'] = hiera('CONFIG_NOVA_NETWORK_VLAN_START')
$net_size = hiera('CONFIG_NOVA_NETWORK_SIZE')
$net_num = hiera('CONFIG_NOVA_NETWORK_NUMBER')
} else {
$net_size = hiera('CONFIG_NOVA_NETWORK_FIXEDSIZE')
$net_num = 1
}
$nova_network_privif = hiera('CONFIG_NOVA_NETWORK_PRIVIF')
$nova_network_pubif = hiera('CONFIG_NOVA_NETWORK_PUBIF')
Class['::nova::keystone::auth'] -> Nova::Manage::Network<||>
class { '::nova::network':
enabled => true,
network_manager => $manager,
num_networks => $net_num ,
network_size => $net_size,
private_interface => force_interface($nova_network_privif, $use_subnets),
public_interface => force_interface($nova_network_pubif, $use_subnets),
fixed_range => hiera('CONFIG_NOVA_NETWORK_FIXEDRANGE'),
floating_range => hiera('CONFIG_NOVA_NETWORK_FLOATRANGE'),
config_overrides => $overrides,
auto_assign_floating_ip => hiera('CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP'),
multi_host => $multihost
}
ensure_packages(['dnsmasq'], {'ensure' => 'present'})
}

View File

@ -1,13 +0,0 @@
class packstack::nova::network::libvirt ()
{
$vmware_backend = hiera('CONFIG_VMWARE_BACKEND')
if $vmware_backend == 'n' {
exec { 'libvirtd_reload':
path => ['/usr/sbin/', '/sbin', '/usr/bin/'],
command => 'systemctl restart libvirtd',
logoutput => 'on_failure',
require => Class['::packstack::nova::compute::libvirt'],
}
}
}

View File

@ -56,19 +56,6 @@ if hiera('CONFIG_NEUTRON_INSTALL') == 'y' {
hiera ('CONFIG_NEUTRON_L2_AGENT') == 'openvswitch' {
include '::packstack::neutron::sriov'
}
} else {
include '::packstack::nova::network::libvirt'
$multihost = hiera('CONFIG_NOVA_NETWORK_MULTIHOST')
$network_hosts = split(hiera('CONFIG_NETWORK_HOSTS'),',')
if $multihost {
if ! member($network_hosts, choose_my_ip(hiera('HOST_LIST'))) {
include '::packstack::nova::metadata'
}
}
if ! member($network_hosts, choose_my_ip(hiera('HOST_LIST'))) {
include '::packstack::nova::compute::flat'
}
}
if hiera('CONFIG_NAGIOS_INSTALL') == 'y' {

View File

@ -82,8 +82,6 @@ if hiera('CONFIG_NOVA_INSTALL') == 'y' {
include '::packstack::nova::vncproxy'
if hiera('CONFIG_NEUTRON_INSTALL') == 'y' {
include '::packstack::nova::neutron'
} else {
include '::packstack::nova::network'
}
}

View File

@ -0,0 +1,18 @@
---
deprecations:
- |
Service nova-network has been removed in nova project
in Ocata. Packstack has removed support to deploying
this service, what implies some changes:
* CONFIG_NEUTRON_INSTALL must allways be set to y
* CONFIG_NOVA_COMPUTE_PRIVIF option has been removed.
* CONFIG_NOVA_NETWORK_MANAGER option has been removed.
* CONFIG_NOVA_NETWORK_PUBIF option has been removed.
* CONFIG_NOVA_NETWORK_PRIVIF option has been removed.
* CONFIG_NOVA_NETWORK_FIXEDRANGE option has been removed.
* CONFIG_NOVA_NETWORK_FLOATRANGE option has been removed.
* CONFIG_NOVA_NETWORK_AUTOASSIGNFLOATINGIP option has been removed.
* CONFIG_NOVA_NETWORK_VLAN_START option has been removed.
* CONFIG_NOVA_NETWORK_NUMBER option has been removed.
* CONFIG_NOVA_NETWORK_SIZE option has been removed.