Remove neutron service parameters

Neutron is now containerized, so this cleans up
sysinv for most of the unused neutron code.

Removes all neutron service parameters.
Removes unwanted references to service parameters in
the helm overrides.
Removes neutron DB references from upgrades.
Removes unused validators, utility functions and constants.

Change-Id: I36d31eebe9978a515a9c68d821f1b80e94cabc5e
Story: 2004764
Task: 30948
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit is contained in:
Al Bailey 2019-07-05 11:55:55 -05:00
parent d1939669b9
commit 31b07c469c
11 changed files with 5 additions and 695 deletions

View File

@ -78,9 +78,6 @@ def get_db_credentials(shared_services, from_release):
'heat': {'hiera_user_key': 'heat::db::postgresql::user',
'keyring_password_key': 'heat',
},
'neutron': {'hiera_user_key': 'neutron::db::postgresql::user',
'keyring_password_key': 'neutron',
},
'nova': {'hiera_user_key': 'nova::db::postgresql::user',
'keyring_password_key': 'nova',
},
@ -516,10 +513,6 @@ def migrate_databases(from_release, shared_services, db_credentials,
f.write("[database]\n")
f.write(get_connection_string(db_credentials, 'heat'))
with open("/etc/neutron/neutron-dbsync.conf", "w") as f:
f.write("[database]\n")
f.write(get_connection_string(db_credentials, 'neutron'))
with open("/etc/nova/nova-dbsync.conf", "w") as f:
f.write("[database]\n")
f.write(get_connection_string(db_credentials, 'nova'))
@ -548,10 +541,6 @@ def migrate_databases(from_release, shared_services, db_credentials,
# Migrate heat
('heat',
'heat-manage --config-file /etc/heat/heat-dbsync.conf db_sync'),
# Migrate neutron
('neutron',
'neutron-db-manage --config-file /etc/neutron/neutron-dbsync.conf ' +
'upgrade heads'),
# Migrate nova
('nova',
'nova-manage --config-file /etc/nova/nova-dbsync.conf db sync'),

View File

@ -31,8 +31,6 @@ import xml.etree.ElementTree as ET
import xml.etree.ElementTree as et
from xml.dom import minidom as dom
from sqlalchemy.orm.exc import NoResultFound
import jsonpatch
import netaddr
import pecan
@ -3345,148 +3343,6 @@ class HostController(rest.RestController):
continue
self._semantic_check_sriov_interface(ihost, iif, force_unlock)
def _semantic_check_data_addresses(self, ihost):
"""
Perform semantic checks against data addresses to ensure validity of
the node configuration prior to unlocking it. Ensure that there is
only 1 IP address configured when SDN is configured otherwise the SDN
controller will be confused on won't know how to map the VXLAN VTEP
endpoints.
"""
sdn_enabled = utils.get_sdn_enabled()
if not sdn_enabled:
return
address_count = 0
interfaces = pecan.request.dbapi.iinterface_get_by_ihost(ihost['uuid'])
for iface in interfaces:
if iface.ifclass != constants.INTERFACE_TYPE_DATA:
continue
addresses = (
pecan.request.dbapi.addresses_get_by_interface(iface['uuid']))
address_count += len(addresses)
if address_count > 1:
msg = _("Can not unlock a worker host with multiple data "
"addresses while in SDN mode.")
raise wsme.exc.ClientSideError(msg)
@staticmethod
def _semantic_check_data_vrs_attributes(ihost):
"""
Perform semantic checks against data-vrs specific attributes to ensure
validity of the node configuration prior to unlocking it.
"""
vswitch_type = utils.get_vswitch_type()
if vswitch_type != constants.VSWITCH_TYPE_NUAGE_VRS:
return
# Check whether the vsc_controllers have been configured
if not ihost['vsc_controllers']:
raise wsme.exc.ClientSideError(
_("Can not unlock worker host %s without "
"vsc_controllers. Action: Configure "
"vsc_controllers for this host prior to unlock."
% ihost['hostname']))
def _semantic_check_data_routes(self, ihost):
"""
Perform semantic checks against data routes to ensure that any routes
that are configured are reachable via some local address. This check
is already performed before allowing routes to be added but is repeated
here because local static IP addresses are not preserved when interface
profiles are used. This is a reminder to the operator that even though
a profile was used to setup interfaces and routes they still need to
configure IP addresses. Alternatively, the operation can setup an IP
address pool and link that to the interface and addresses will
automatically be added when the profile is applied.
"""
routes = pecan.request.dbapi.routes_get_by_host(ihost['id'])
for r in routes:
route = r.as_dict()
try:
self.routes._check_reachable_gateway(
route['interface_id'], route)
except exception.RouteGatewayNotReachable:
msg = _("Can not unlock a worker host with routes that are "
"not reachable via a local IP address. Add an IP "
"address in the same subnet as each route gateway "
"address before re-attempting this command.")
raise wsme.exc.ClientSideError(msg)
def _semantic_check_sdn_attributes(self, ihost):
"""
Perform semantic checks when SDN Networking is configured to ensure
that at least one SDN controller is configured. Additionally,
check if the Neutron service parameters for ML2 driver,
and L2 Agent have been configured properly.
"""
sdn_enabled = utils.get_sdn_enabled()
if not sdn_enabled:
return
# check sdn controller list
try:
msg = _("An enabled SDN controller is required when SDN is configured. "
"Please configure an SDN controller before re-attempting this "
"command.")
sdn_controllers = pecan.request.dbapi.sdn_controller_get_list()
if not sdn_controllers or len(sdn_controllers) == 0:
raise wsme.exc.ClientSideError(msg)
for controller in sdn_controllers:
if (controller and (controller.state ==
constants.SDN_CONTROLLER_STATE_ENABLED)):
break
else:
raise wsme.exc.ClientSideError(msg)
except NoResultFound:
raise wsme.exc.ClientSideError(msg)
# check to see if Neutron ML2 service parameters have been configured
neutron_parameters = []
for section in [constants.SERVICE_PARAM_SECTION_NETWORK_ML2,
constants.SERVICE_PARAM_SECTION_NETWORK_ML2_ODL,
constants.SERVICE_PARAM_SECTION_NETWORK_DEFAULT]:
try:
parm_list = pecan.request.dbapi.service_parameter_get_all(
service=constants.SERVICE_TYPE_NETWORK,
section=section)
neutron_parameters = neutron_parameters + parm_list
except NoResultFound:
msg = _("Cannot unock a worker host without %s->%s "
",SDN service parameters being configured. "
"Add appropriate service parameters before "
"re-attempting this command." %
(constants.SERVICE_TYPE_NETWORK, section))
raise wsme.exc.ClientSideError(msg)
# The service parameter general semantic checks for Mandatory
# parameters happen within the service parameter schema. However
# doing it there for Neutron ML2 would require us to seed the
# DB with default values for these service params as well
# as add further complexity to the parameter validation logic.
#
# It is simpler to do that check here prior to Unlock.
sdn_service_parameters = \
constants.SERVICE_PARAM_NETWORK_ML2_COMPULSORY
for sdn_param in sdn_service_parameters:
found = False
for param in neutron_parameters:
# value validation is done in service_parameter
if param['name'] == sdn_param:
found = True
break
if not found:
msg = _("Cannot unlock a worker host without "
"\"%s\" SDN service parameter configured. "
"Add service parameter before re-attempting "
"this command." % sdn_param)
raise wsme.exc.ClientSideError(msg)
@staticmethod
def _auto_adjust_memory_for_node(ihost, node):
"""

View File

@ -19,11 +19,9 @@
# Copyright (c) 2013-2017 Wind River Systems, Inc.
#
from sqlalchemy.orm.exc import NoResultFound
import jsonpatch
import six
import os
import six
import pecan
from pecan import rest
@ -239,23 +237,6 @@ class SystemController(rest.RestController):
"configured.")
raise wsme.exc.ClientSideError(msg)
# Check if SDN Controller service parameters
neutron_parameters = []
for section in [constants.SERVICE_PARAM_SECTION_NETWORK_ML2,
constants.SERVICE_PARAM_SECTION_NETWORK_ML2_ODL,
constants.SERVICE_PARAM_SECTION_NETWORK_DEFAULT]:
try:
parm_list = pecan.request.dbapi.service_parameter_get_all(
service=constants.SERVICE_TYPE_NETWORK,
section=section)
neutron_parameters = neutron_parameters + parm_list
except NoResultFound:
continue
if neutron_parameters:
msg = _("SDN cannot be disabled when SDN service parameters "
"are configured.")
raise wsme.exc.ClientSideError(msg)
def _verify_sdn_enabled(self):
# If SDN is enabled then OAM and Management network
# must belong to the same Address Family

View File

@ -327,22 +327,6 @@ def get_sdn_enabled():
return system.capabilities.get('sdn_enabled', False)
def get_sdn_l3_mode_enabled():
try:
sdn_l3_mode = pecan.request.dbapi.service_parameter_get_one(
service=constants.SERVICE_TYPE_NETWORK,
section=constants.SERVICE_PARAM_SECTION_NETWORK_DEFAULT,
name=constants.
SERVICE_PARAM_NAME_DEFAULT_SERVICE_PLUGINS)
if not sdn_l3_mode:
return False
allowed_vals = constants.SERVICE_PLUGINS_SDN
return (any(sp in allowed_vals
for sp in sdn_l3_mode.value.split(',')))
except exception.SysinvException:
return False
def get_region_config():
system = pecan.request.dbapi.isystem_get_one()
# TODO(mpeters): this should to be updated to return a boolean value

View File

@ -900,7 +900,6 @@ SERVICE_TYPE_IDENTITY = 'identity'
SERVICE_TYPE_KEYSTONE = 'keystone'
SERVICE_TYPE_IMAGE = 'image'
SERVICE_TYPE_VOLUME = 'volume'
SERVICE_TYPE_NETWORK = 'network'
SERVICE_TYPE_HORIZON = "horizon"
SERVICE_TYPE_CEPH = 'ceph'
SERVICE_TYPE_CINDER = 'cinder'
@ -918,13 +917,6 @@ SERVICE_PARAM_SECTION_IDENTITY_CONFIG = 'config'
SERVICE_PARAM_IDENTITY_CONFIG_TOKEN_EXPIRATION = 'token_expiration'
SERVICE_PARAM_IDENTITY_CONFIG_TOKEN_EXPIRATION_DEFAULT = 3600
SERVICE_PARAM_SECTION_NETWORK_DEFAULT = 'default'
SERVICE_PARAM_SECTION_NETWORK_ML2 = 'ml2'
SERVICE_PARAM_SECTION_NETWORK_ML2_ODL = 'ml2_odl'
SERVICE_PARAM_SECTION_NETWORK_BGP = 'bgp'
SERVICE_PARAM_SECTION_NETWORK_SFC = 'sfc'
SERVICE_PARAM_SECTION_NETWORK_DHCP = 'dhcp'
SERVICE_PARAM_PARAMETER_NAME_EXTERNAL_ADMINURL = 'external-admin-url'
SERVICE_PARAM_SECTION_HORIZON_AUTH = 'auth'
@ -935,78 +927,6 @@ SERVICE_PARAM_HORIZON_AUTH_LOCKOUT_RETRIES = \
SERVICE_PARAM_HORIZON_AUTH_LOCKOUT_PERIOD_SEC_DEFAULT = 300
SERVICE_PARAM_HORIZON_AUTH_LOCKOUT_RETRIES_DEFAULT = 3
# NEUTRON Service Parameters
SERVICE_PARAM_NAME_ML2_EXTENSION_DRIVERS = 'extension_drivers'
SERVICE_PARAM_NAME_ML2_MECHANISM_DRIVERS = 'mechanism_drivers'
SERVICE_PARAM_NAME_ML2_TENANT_NETWORK_TYPES = 'tenant_network_types'
SERVICE_PARAM_NAME_ML2_ODL_URL = 'url'
SERVICE_PARAM_NAME_ML2_ODL_USERNAME = 'username'
SERVICE_PARAM_NAME_ML2_ODL_PASSWORD = 'password'
SERVICE_PARAM_NAME_ML2_PORT_BINDING_CONTROLLER = 'port_binding_controller'
SERVICE_PARAM_NAME_DEFAULT_SERVICE_PLUGINS = 'service_plugins'
SERVICE_PARAM_NAME_BASE_MAC = 'base_mac'
SERVICE_PARAM_NAME_DVR_BASE_MAC = 'dvr_base_mac'
SERVICE_PARAM_NAME_DHCP_FORCE_METADATA = 'force_metadata'
# the compulsory set of service parameters when SDN is
# configured (required for semantic check on Compute unlock)
SERVICE_PARAM_NETWORK_ML2_COMPULSORY = \
[SERVICE_PARAM_NAME_ML2_MECHANISM_DRIVERS,
SERVICE_PARAM_NAME_ML2_ODL_URL,
SERVICE_PARAM_NAME_ML2_ODL_USERNAME,
SERVICE_PARAM_NAME_ML2_ODL_PASSWORD]
# a subset of the Neutron mechanism driver endpoints that we support
SERVICE_PARAM_NETWORK_ML2_MECH_DRIVERS = \
['openvswitch', 'vswitch', 'sriovnicswitch', 'opendaylight',
'l2population', 'opendaylight_v2']
# a subset of the Neutron extensions that we support
SERVICE_PARAM_NETWORK_ML2_EXT_DRIVERS_PORT_SECURITY = 'port_security'
SERVICE_PARAM_NETWORK_ML2_EXT_DRIVERS = \
['dns', 'port_security']
# a subset of Neutron's tenant network types that we support
SERVICE_PARAM_NETWORK_ML2_TENANT_TYPES = \
['vlan', 'vxlan']
# service plugin for neutron network segment range feature
NEUTRON_PLUGIN_NETWORK_SEGMENT_RANGE = 'network_segment_range'
# a subset of Neutron service plugins that are supported
SERVICE_PARAM_NETWORK_DEFAULT_SERVICE_PLUGINS = \
['odl-router',
'networking_odl.l3.l3_odl.OpenDaylightL3RouterPlugin',
'odl-router_v2',
'networking_odl.l3.l3_odl_v2:OpenDaylightL3RouterPlugin',
'neutron_dynamic_routing.services.bgp.bgp_plugin.BgpPlugin',
'networking_bgpvpn.neutron.services.plugin.BGPVPNPlugin',
'router',
NEUTRON_PLUGIN_NETWORK_SEGMENT_RANGE]
# Neutron service plugins for SDN
SERVICE_PLUGINS_SDN = \
['odl-router',
'networking_odl.l3.l3_odl.OpenDaylightL3RouterPlugin',
'odl-router_v2',
'networking_odl.l3.l3_odl_v2:OpenDaylightL3RouterPlugin']
# sfc parameters
SERVICE_PARAM_NAME_SFC_QUOTA_FLOW_CLASSIFIER = 'sfc_quota_flow_classifier'
SERVICE_PARAM_NAME_SFC_QUOTA_PORT_CHAIN = 'sfc_quota_port_chain'
SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR_GROUP = 'sfc_quota_port_pair_group'
SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR = 'sfc_quota_port_pair'
SERVICE_PARAM_NAME_SFC_SFC_DRIVERS = 'sfc_drivers'
SERVICE_PARAM_NAME_SFC_FLOW_CLASSIFIER_DRIVERS = "flowclassifier_drivers"
# bgp parameters
SERVICE_PARAM_NAME_BGP_ROUTER_ID_C0 = 'bgp_router_id_c0'
SERVICE_PARAM_NAME_BGP_ROUTER_ID_C1 = 'bgp_router_id_c1'
# Set dns_domain for internal_dns
SERVICE_PARAM_NAME_DEFAULT_DNS_DOMAIN = 'dns_domain'
# Platform Service Parameters
SERVICE_PARAM_SECTION_PLATFORM_MAINTENANCE = 'maintenance'
SERVICE_PARAM_SECTION_PLATFORM_SYSINV = 'sysinv'

View File

@ -14,7 +14,6 @@ import rpm
import six
import wsme
from six.moves.urllib.parse import urlparse
from sysinv.common import constants
from sysinv.common import exception
from sysinv.common.storage_backend_conf import StorageBackendConfig
@ -97,64 +96,6 @@ def _validate_zero_or_range(name, value, min, max):
"Parameter '%s' must be an integer value." % name))
def _validate_neutron_ml2_mech(name, value):
allowed = constants.SERVICE_PARAM_NETWORK_ML2_MECH_DRIVERS
# can accept multiple comma separated values
values = value.split(',')
for item in values:
if item not in allowed:
raise wsme.exc.ClientSideError(_(
"Neutron ML2 mechanism driver must be one of: %s" % allowed))
def _validate_neutron_ml2_ext(name, value):
allowed = constants.SERVICE_PARAM_NETWORK_ML2_EXT_DRIVERS
# can accept multiple comma separated values
values = value.split(',')
for item in values:
if item not in allowed:
raise wsme.exc.ClientSideError(_(
"Neutron ML2 extension driver must be one of: %s" % allowed))
def _validate_neutron_network_types(name, value):
allowed = constants.SERVICE_PARAM_NETWORK_ML2_TENANT_TYPES
# can accept multiple comma separated values
values = value.split(',')
for item in values:
if item not in allowed:
raise wsme.exc.ClientSideError(_(
"Neutron tenant network type must be one of: %s" % allowed))
def _validate_neutron_service_plugins(name, value):
allowed = constants.SERVICE_PARAM_NETWORK_DEFAULT_SERVICE_PLUGINS
# can accept multiple comma separated values
values = value.split(',')
for item in values:
if item not in allowed:
raise wsme.exc.ClientSideError(_(
"Neutron service plugins must be one of: %s" % allowed))
def _validate_odl_connection_uri(name, value):
url = urlparse(value)
if cutils.is_valid_ip(url.hostname):
try:
ip_addr = netaddr.IPNetwork(url.hostname)
except netaddr.core.AddrFormatError:
raise wsme.exc.ClientSideError(_(
"Invalid IP address for ODL connection URI"))
if ip_addr.is_loopback():
raise wsme.exc.ClientSideError(_(
"SDN controller must not be loopback."))
elif url.hostname:
if constants.LOCALHOST_HOSTNAME in url.hostname.lower():
raise wsme.exc.ClientSideError(_(
"SDN controller must not be localhost."))
def _validate_value_in_set(name, value, _set):
if value not in _set:
raise wsme.exc.ClientSideError(_(
@ -417,8 +358,6 @@ def _validate_domain(name, value):
(name, value)))
NETWORK_ODL_PROTECTED_PARAMETERS = [constants.SERVICE_PARAM_NAME_ML2_ODL_PASSWORD]
NOVA_PCI_ALIAS_PARAMETER_OPTIONAL = [
constants.SERVICE_PARAM_NAME_NOVA_PCI_ALIAS_GPU,
constants.SERVICE_PARAM_NAME_NOVA_PCI_ALIAS_GPU_PF,
@ -491,154 +430,6 @@ HORIZON_AUTH_PARAMETER_RESOURCE = {
constants.SERVICE_PARAM_HORIZON_AUTH_LOCKOUT_RETRIES: 'openstack::horizon::params::lockout_retries',
}
# Neutron Service Parameters (optional)
NEUTRON_ML2_PARAMETER_OPTIONAL = [
constants.SERVICE_PARAM_NAME_ML2_MECHANISM_DRIVERS,
constants.SERVICE_PARAM_NAME_ML2_EXTENSION_DRIVERS,
constants.SERVICE_PARAM_NAME_ML2_TENANT_NETWORK_TYPES,
]
NEUTRON_ML2_ODL_PARAMETER_OPTIONAL = [
constants.SERVICE_PARAM_NAME_ML2_ODL_URL,
constants.SERVICE_PARAM_NAME_ML2_ODL_USERNAME,
constants.SERVICE_PARAM_NAME_ML2_ODL_PASSWORD,
constants.SERVICE_PARAM_NAME_ML2_PORT_BINDING_CONTROLLER,
]
NETWORK_BGP_PARAMETER_OPTIONAL = [
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C0,
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C1,
]
NETWORK_SFC_PARAMETER_OPTIONAL = [
constants.SERVICE_PARAM_NAME_SFC_QUOTA_FLOW_CLASSIFIER,
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_CHAIN,
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR_GROUP,
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR,
constants.SERVICE_PARAM_NAME_SFC_SFC_DRIVERS,
constants.SERVICE_PARAM_NAME_SFC_FLOW_CLASSIFIER_DRIVERS,
]
NETWORK_DHCP_PARAMETER_OPTIONAL = [
constants.SERVICE_PARAM_NAME_DHCP_FORCE_METADATA,
]
NETWORK_DEFAULT_PARAMETER_OPTIONAL = [
constants.SERVICE_PARAM_NAME_DEFAULT_SERVICE_PLUGINS,
constants.SERVICE_PARAM_NAME_DEFAULT_DNS_DOMAIN,
constants.SERVICE_PARAM_NAME_BASE_MAC,
constants.SERVICE_PARAM_NAME_DVR_BASE_MAC,
]
NEUTRON_ML2_PARAMETER_VALIDATOR = {
constants.SERVICE_PARAM_NAME_ML2_MECHANISM_DRIVERS:
_validate_neutron_ml2_mech,
constants.SERVICE_PARAM_NAME_ML2_EXTENSION_DRIVERS:
_validate_neutron_ml2_ext,
constants.SERVICE_PARAM_NAME_ML2_TENANT_NETWORK_TYPES:
_validate_neutron_network_types,
}
NEUTRON_ML2_ODL_PARAMETER_VALIDATOR = {
constants.SERVICE_PARAM_NAME_ML2_ODL_URL:
_validate_odl_connection_uri,
constants.SERVICE_PARAM_NAME_ML2_ODL_USERNAME:
_validate_not_empty,
constants.SERVICE_PARAM_NAME_ML2_ODL_PASSWORD:
_validate_not_empty,
constants.SERVICE_PARAM_NAME_ML2_PORT_BINDING_CONTROLLER:
_validate_not_empty,
}
NETWORK_BGP_PARAMETER_VALIDATOR = {
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C0:
_validate_ipv4,
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C1:
_validate_ipv4,
}
NETWORK_SFC_PARAMETER_VALIDATOR = {
constants.SERVICE_PARAM_NAME_SFC_QUOTA_FLOW_CLASSIFIER:
_validate_integer,
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_CHAIN:
_validate_integer,
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR_GROUP:
_validate_integer,
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR:
_validate_integer,
constants.SERVICE_PARAM_NAME_SFC_SFC_DRIVERS:
_validate_not_empty,
constants.SERVICE_PARAM_NAME_SFC_FLOW_CLASSIFIER_DRIVERS:
_validate_not_empty,
}
NETWORK_DHCP_PARAMETER_VALIDATOR = {
constants.SERVICE_PARAM_NAME_DHCP_FORCE_METADATA:
_validate_boolean
}
NETWORK_DEFAULT_PARAMETER_VALIDATOR = {
constants.SERVICE_PARAM_NAME_DEFAULT_SERVICE_PLUGINS:
_validate_neutron_service_plugins,
constants.SERVICE_PARAM_NAME_DEFAULT_DNS_DOMAIN:
_validate_not_empty,
constants.SERVICE_PARAM_NAME_BASE_MAC:
_validate_mac_address,
constants.SERVICE_PARAM_NAME_DVR_BASE_MAC:
_validate_mac_address,
}
NEUTRON_ML2_PARAMETER_RESOURCE = {
constants.SERVICE_PARAM_NAME_ML2_MECHANISM_DRIVERS: 'neutron::plugins::ml2::mechanism_drivers',
constants.SERVICE_PARAM_NAME_ML2_EXTENSION_DRIVERS: 'neutron::plugins::ml2::extension_drivers',
constants.SERVICE_PARAM_NAME_ML2_TENANT_NETWORK_TYPES: 'neutron::plugins::ml2::tenant_network_types',
}
NEUTRON_ML2_ODL_PARAMETER_RESOURCE = {
constants.SERVICE_PARAM_NAME_ML2_ODL_URL: 'openstack::neutron::odl::params::url',
constants.SERVICE_PARAM_NAME_ML2_ODL_USERNAME: 'openstack::neutron::odl::params::username',
constants.SERVICE_PARAM_NAME_ML2_ODL_PASSWORD: 'openstack::neutron::odl::params::password',
constants.SERVICE_PARAM_NAME_ML2_PORT_BINDING_CONTROLLER: 'openstack::neutron::odl::params::port_binding_controller',
}
NETWORK_BGP_PARAMETER_RESOURCE = {
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C0: 'openstack::neutron::params::bgp_router_id',
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C1: 'openstack::neutron::params::bgp_router_id',
}
NETWORK_DHCP_PARAMETER_RESOURCE = {
constants.SERVICE_PARAM_NAME_DHCP_FORCE_METADATA: 'neutron::agents::dhcp::enable_force_metadata',
}
NETWORK_BGP_PARAMETER_DATA_FORMAT = {
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C0: SERVICE_PARAMETER_DATA_FORMAT_SKIP,
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C1: SERVICE_PARAMETER_DATA_FORMAT_SKIP,
}
NETWORK_SFC_PARAMETER_RESOURCE = {
constants.SERVICE_PARAM_NAME_SFC_QUOTA_FLOW_CLASSIFIER: 'openstack::neutron::sfc::sfc_quota_flow_classifier',
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_CHAIN: 'openstack::neutron::sfc::sfc_quota_port_chain',
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR_GROUP: 'openstack::neutron::sfc::sfc_quota_port_pair_group',
constants.SERVICE_PARAM_NAME_SFC_QUOTA_PORT_PAIR: 'openstack::neutron::sfc::sfc_quota_port_pair',
constants.SERVICE_PARAM_NAME_SFC_SFC_DRIVERS: 'openstack::neutron::sfc::sfc_drivers',
constants.SERVICE_PARAM_NAME_SFC_FLOW_CLASSIFIER_DRIVERS: 'openstack::neutron::sfc::flowclassifier_drivers',
}
NETWORK_DHCP_PARAMETER_DATA_FORMAT = {
constants.SERVICE_PARAM_NAME_DHCP_FORCE_METADATA: SERVICE_PARAMETER_DATA_FORMAT_BOOLEAN
}
NETWORK_DEFAULT_PARAMETER_RESOURCE = {
constants.SERVICE_PARAM_NAME_DEFAULT_SERVICE_PLUGINS: 'neutron::service_plugins',
constants.SERVICE_PARAM_NAME_DEFAULT_DNS_DOMAIN: 'neutron::dns_domain',
constants.SERVICE_PARAM_NAME_BASE_MAC: 'neutron::base_mac',
constants.SERVICE_PARAM_NAME_DVR_BASE_MAC: 'neutron::dvr_base_mac',
}
NETWORK_DEFAULT_PARAMETER_DATA_FORMAT = {
constants.SERVICE_PARAM_NAME_DEFAULT_SERVICE_PLUGINS: SERVICE_PARAMETER_DATA_FORMAT_ARRAY,
}
# Maintenance Service Parameters
PLATFORM_MTCE_PARAMETER_MANDATORY = [
constants.SERVICE_PARAM_PLAT_MTCE_WORKER_BOOT_TIMEOUT,
@ -843,42 +634,6 @@ SERVICE_PARAMETER_SCHEMA = {
SERVICE_PARAM_RESOURCE: HORIZON_AUTH_PARAMETER_RESOURCE,
},
},
constants.SERVICE_TYPE_NETWORK: {
constants.SERVICE_PARAM_SECTION_NETWORK_ML2: {
SERVICE_PARAM_OPTIONAL: NEUTRON_ML2_PARAMETER_OPTIONAL,
SERVICE_PARAM_VALIDATOR: NEUTRON_ML2_PARAMETER_VALIDATOR,
SERVICE_PARAM_RESOURCE: NEUTRON_ML2_PARAMETER_RESOURCE,
},
constants.SERVICE_PARAM_SECTION_NETWORK_ML2_ODL: {
SERVICE_PARAM_OPTIONAL: NEUTRON_ML2_ODL_PARAMETER_OPTIONAL,
SERVICE_PARAM_VALIDATOR: NEUTRON_ML2_ODL_PARAMETER_VALIDATOR,
SERVICE_PARAM_RESOURCE: NEUTRON_ML2_ODL_PARAMETER_RESOURCE,
SERVICE_PARAM_PROTECTED: NETWORK_ODL_PROTECTED_PARAMETERS,
},
constants.SERVICE_PARAM_SECTION_NETWORK_BGP: {
SERVICE_PARAM_OPTIONAL: NETWORK_BGP_PARAMETER_OPTIONAL,
SERVICE_PARAM_VALIDATOR: NETWORK_BGP_PARAMETER_VALIDATOR,
SERVICE_PARAM_RESOURCE: NETWORK_BGP_PARAMETER_RESOURCE,
},
constants.SERVICE_PARAM_SECTION_NETWORK_SFC: {
SERVICE_PARAM_OPTIONAL: NETWORK_SFC_PARAMETER_OPTIONAL,
SERVICE_PARAM_VALIDATOR: NETWORK_SFC_PARAMETER_VALIDATOR,
SERVICE_PARAM_RESOURCE: NETWORK_SFC_PARAMETER_RESOURCE,
},
constants.SERVICE_PARAM_SECTION_NETWORK_DHCP: {
SERVICE_PARAM_OPTIONAL: NETWORK_DHCP_PARAMETER_OPTIONAL,
SERVICE_PARAM_VALIDATOR: NETWORK_DHCP_PARAMETER_VALIDATOR,
SERVICE_PARAM_RESOURCE: NETWORK_DHCP_PARAMETER_RESOURCE,
SERVICE_PARAM_DATA_FORMAT: NETWORK_DHCP_PARAMETER_DATA_FORMAT,
},
constants.SERVICE_PARAM_SECTION_NETWORK_DEFAULT: {
SERVICE_PARAM_OPTIONAL: NETWORK_DEFAULT_PARAMETER_OPTIONAL,
SERVICE_PARAM_VALIDATOR: NETWORK_DEFAULT_PARAMETER_VALIDATOR,
SERVICE_PARAM_RESOURCE: NETWORK_DEFAULT_PARAMETER_RESOURCE,
SERVICE_PARAM_DATA_FORMAT: NETWORK_DEFAULT_PARAMETER_DATA_FORMAT,
},
},
constants.SERVICE_TYPE_NOVA: {
constants.SERVICE_PARAM_SECTION_NOVA_PCI_ALIAS: {
SERVICE_PARAM_OPTIONAL: NOVA_PCI_ALIAS_PARAMETER_OPTIONAL,

View File

@ -2014,18 +2014,6 @@ def is_initial_config_complete():
return os.path.isfile(tsc.INITIAL_CONFIG_COMPLETE_FLAG)
def recur_update(orig_dict, new_dict):
for key, val in new_dict.iteritems():
if isinstance(val, collections.Mapping):
tmp = recur_update(orig_dict.get(key, {}), val)
orig_dict[key] = tmp
elif isinstance(val, list) and isinstance(orig_dict.get(key), list):
orig_dict[key] = orig_dict.get[key] + val
else:
orig_dict[key] = new_dict[key]
return orig_dict
def is_default_huge_pages_required(host):
if not host_has_function(host, constants.WORKER):
return False

View File

@ -6983,20 +6983,7 @@ class ConductorManager(service.PeriodicService):
# On service parameter add just update the host profile
# for personalities pertinent to that service
if service == constants.SERVICE_TYPE_NETWORK:
if tsc.system_type == constants.TIS_AIO_BUILD:
personalities = [constants.CONTROLLER]
# AIO hosts must be rebooted following service reconfig
config_uuid = self._config_update_hosts(context, personalities,
reboot=True)
else:
# worker hosts must be rebooted following service reconfig
self._config_update_hosts(context, [constants.WORKER],
reboot=True)
# controller hosts will actively apply the manifests
config_uuid = self._config_update_hosts(context,
[constants.CONTROLLER])
elif service == constants.SERVICE_TYPE_NOVA:
if service == constants.SERVICE_TYPE_NOVA:
config_uuid = self._config_update_hosts(context,
[constants.CONTROLLER,
constants.WORKER])
@ -7029,15 +7016,6 @@ class ConductorManager(service.PeriodicService):
}
self._config_apply_runtime_manifest(context, config_uuid, config_dict)
elif service == constants.SERVICE_TYPE_NETWORK:
if not self._config_is_reboot_required(config_uuid):
personalities = [constants.CONTROLLER]
config_dict = {
"personalities": personalities,
"classes": ['openstack::neutron::server::runtime']
}
self._config_apply_runtime_manifest(context, config_uuid, config_dict)
elif service == constants.SERVICE_TYPE_PLATFORM:
config_dict = {
"personalities": personalities,
@ -7127,7 +7105,7 @@ class ConductorManager(service.PeriodicService):
[constants.CONTROLLER])
config_dict = {
"personalities": [constants.CONTROLLER],
"classes": ['openstack::neutron::server::runtime'],
"classes": [],
}
self._config_apply_runtime_manifest(context, config_uuid, config_dict)
@ -7141,8 +7119,7 @@ class ConductorManager(service.PeriodicService):
personalities = [constants.CONTROLLER]
config_dict = {
"personalities": personalities,
"classes": ['platform::sysctl::controller::runtime',
'openstack::neutron::server::runtime']
"classes": ['platform::sysctl::controller::runtime']
}
config_uuid = self._config_update_hosts(context, personalities)
self._config_apply_runtime_manifest(context, config_uuid, config_dict)
@ -8756,8 +8733,7 @@ class ConductorManager(service.PeriodicService):
config_dict = {
"personalities": [constants.CONTROLLER],
"classes": ['openstack::nova::controller::runtime',
'openstack::neutron::server::runtime'],
"classes": ['openstack::nova::controller::runtime'],
}
self._config_apply_runtime_manifest(context, config_uuid, config_dict)

View File

@ -11,8 +11,6 @@ from sysinv.openstack.common import log as logging
from sysinv.helm import common
from sysinv.helm import openstack
from sqlalchemy.orm.exc import NoResultFound
LOG = logging.getLogger(__name__)
DATA_NETWORK_TYPES = [constants.NETWORK_TYPE_DATA]
@ -68,10 +66,6 @@ class NeutronHelm(openstack.OpenstackBaseHelm):
}
}
self.update_dynamic_options(overrides[common.HELM_NS_OPENSTACK]['conf'])
self.update_from_service_parameters(overrides[common.HELM_NS_OPENSTACK]['conf'])
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
elif namespace:
@ -80,106 +74,6 @@ class NeutronHelm(openstack.OpenstackBaseHelm):
else:
return overrides
def _get_service_parameters(self, service=None):
service_parameters = []
if self.dbapi is None:
return service_parameters
try:
service_parameters = self.dbapi.service_parameter_get_all(
service=service)
except NoResultFound:
pass
return service_parameters
def update_dynamic_options(self, overrides):
if utils.is_virtual():
utils.recur_update(overrides, {
'plugins': {
'ml2_conf': {
'ovs_driver': {
'vhost_user_enabled': False
}
}
}
})
def update_from_service_parameters(self, overrides):
service_parameters = self._get_service_parameters(service=constants.SERVICE_TYPE_NETWORK)
for param in service_parameters:
if param.section == constants.SERVICE_PARAM_SECTION_NETWORK_DEFAULT:
if param.name == constants.SERVICE_PARAM_NAME_DEFAULT_SERVICE_PLUGINS:
overrides.update({
'neutron': {
'DEFAULT': {
'service_plugins': str(param.value)
}
}
})
if param.name == constants.SERVICE_PARAM_NAME_DEFAULT_DNS_DOMAIN:
overrides.update({
'neutron': {
'DEFAULT': {
'dns_domain': str(param.value)
}
}
})
if param.name == constants.SERVICE_PARAM_NAME_BASE_MAC:
overrides.update({
'neutron': {
'DEFAULT': {
'base_mac': str(param.value)
}
}
})
if param.name == constants.SERVICE_PARAM_NAME_DVR_BASE_MAC:
overrides.update({
'neutron': {
'DEFAULT': {
'dvr_base_mac': str(param.value)
}
}
})
elif param.section == constants.SERVICE_PARAM_SECTION_NETWORK_ML2:
if param.name == constants.SERVICE_PARAM_NAME_ML2_MECHANISM_DRIVERS:
overrides.update({
'plugins': {
'ml2_conf': {
'ml2': {
'mechanism_drivers': str(param.value)
}
}
}
})
if param.name == constants.SERVICE_PARAM_NAME_ML2_EXTENSION_DRIVERS:
overrides.update({
'plugins': {
'ml2_conf': {
'ml2': {
'extension_drivers': str(param.value)
}
}
}
})
if param.name == constants.SERVICE_PARAM_NAME_ML2_TENANT_NETWORK_TYPES:
overrides.update({
'plugins': {
'ml2_conf': {
'ml2': {
'tenant_network_types': str(param.value)
}
}
}
})
elif param.section == constants.SERVICE_PARAM_SECTION_NETWORK_DHCP:
if param.name == constants.SERVICE_PARAM_NAME_DHCP_FORCE_METADATA:
overrides.update({
'dhcp_agent': {
'DEFAULT': {
'force_metadata': str(param.value)
}
}
})
def _get_per_host_overrides(self):
host_list = []
hosts = self.dbapi.ihost_get_list()

View File

@ -180,33 +180,6 @@ class NeutronPuppet(openstack.OpenstackBasePuppet):
'neutron::agents::ml2::sriov::physical_device_mappings':
device_mappings,
}
if host.personality == constants.CONTROLLER:
service_parameters = self._get_service_parameter_configs(
constants.SERVICE_TYPE_NETWORK)
if service_parameters is None:
return config
# check if neutron bgp speaker is configured
if host.hostname == constants.CONTROLLER_0_HOSTNAME:
bgp_router_id = self._service_parameter_lookup_one(
service_parameters,
constants.SERVICE_PARAM_SECTION_NETWORK_BGP,
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C0,
None)
else:
bgp_router_id = self._service_parameter_lookup_one(
service_parameters,
constants.SERVICE_PARAM_SECTION_NETWORK_BGP,
constants.SERVICE_PARAM_NAME_BGP_ROUTER_ID_C1,
None)
if bgp_router_id is not None:
config.update({
'openstack::neutron::params::bgp_router_id':
bgp_router_id})
return config
def get_public_url(self):

View File

@ -16,7 +16,6 @@ import testtools
from six.moves import http_client
from sysinv.api.controllers.v1 import interface as api_if_v1
from sysinv.api.controllers.v1 import utils as api_utils
from sysinv.common import constants
from sysinv.conductor import rpcapi
from sysinv.tests.api import base
@ -161,11 +160,6 @@ class InterfaceTestCase(base.FunctionalTest):
self.mock_iinterface_get_providernets.return_value = providernet_list
self.addCleanup(p.stop)
p = mock.patch.object(api_utils, 'get_sdn_l3_mode_enabled')
self.mock_sdn_l3_mode_enabled = p.start()
self.mock_sdn_l3_mode_enabled.return_value = True
self.addCleanup(p.stop)
self._setup_context()
def _get_path(self, path=None):