Add undercloud_and_charm_setup configure step
The neutron ``basic_overcloud_network`` setup job performs both undercloud and charm configuration prior to configuring the overcloud network. The undercloud and charm configuration steps are useful outside the context of OpenStack Neutron. Split undercloud and charm setup into a new configure step.
This commit is contained in:
@@ -69,29 +69,19 @@ DEFAULT_UNDERCLOUD_NETWORK_CONFIG = {
|
||||
}
|
||||
|
||||
|
||||
def basic_overcloud_network(limit_gws=None):
|
||||
"""Run setup for neutron networking.
|
||||
|
||||
Configure the following:
|
||||
The overcloud network using subnet pools
|
||||
def undercloud_and_charm_setup(limit_gws=None):
|
||||
"""Perform undercloud and charm setup for network plumbing.
|
||||
|
||||
:param limit_gws: Limit the number of gateways that get a port attached
|
||||
:type limit_gws: int
|
||||
"""
|
||||
cli_utils.setup_logging()
|
||||
|
||||
# Get network configuration settings
|
||||
network_config = {}
|
||||
# Declared overcloud settings
|
||||
network_config.update(OVERCLOUD_NETWORK_CONFIG)
|
||||
# Default undercloud settings
|
||||
network_config.update(DEFAULT_UNDERCLOUD_NETWORK_CONFIG)
|
||||
# Environment specific settings
|
||||
network_config.update(generic_utils.get_undercloud_env_vars())
|
||||
|
||||
# Get keystone session
|
||||
keystone_session = openstack_utils.get_overcloud_keystone_session()
|
||||
|
||||
# Get optional use_juju_wait for network option
|
||||
options = (lifecycle_utils
|
||||
.get_charm_config(fatal=False)
|
||||
@@ -120,6 +110,33 @@ def basic_overcloud_network(limit_gws=None):
|
||||
' charm network configuration.'
|
||||
.format(provider_type))
|
||||
|
||||
|
||||
def basic_overcloud_network(limit_gws=None):
|
||||
"""Run setup for neutron networking.
|
||||
|
||||
Configure the following:
|
||||
The overcloud network using subnet pools
|
||||
|
||||
:param limit_gws: Limit the number of gateways that get a port attached
|
||||
:type limit_gws: int
|
||||
"""
|
||||
cli_utils.setup_logging()
|
||||
|
||||
# Get network configuration settings
|
||||
network_config = {}
|
||||
# Declared overcloud settings
|
||||
network_config.update(OVERCLOUD_NETWORK_CONFIG)
|
||||
# Default undercloud settings
|
||||
network_config.update(DEFAULT_UNDERCLOUD_NETWORK_CONFIG)
|
||||
# Environment specific settings
|
||||
network_config.update(generic_utils.get_undercloud_env_vars())
|
||||
|
||||
# Get keystone session
|
||||
keystone_session = openstack_utils.get_overcloud_keystone_session()
|
||||
|
||||
# Perform undercloud and charm setup for network plumbing
|
||||
undercloud_and_charm_setup(limit_gws=limit_gws)
|
||||
|
||||
# Configure the overcloud network
|
||||
network.setup_sdn(network_config, keystone_session=keystone_session)
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ from zaza.openstack.utilities import (
|
||||
generic as generic_utils,
|
||||
openstack as openstack_utils,
|
||||
)
|
||||
import zaza.openstack.utilities.exceptions
|
||||
|
||||
import zaza.utilities.juju as juju_utils
|
||||
|
||||
@@ -276,14 +277,19 @@ def setup_gateway_ext_port(network_config, keystone_session=None,
|
||||
else:
|
||||
net_id = None
|
||||
|
||||
# If we're using netplan, we need to add the new interface to the guest
|
||||
current_release = openstack_utils.get_os_release()
|
||||
bionic_queens = openstack_utils.get_os_release('bionic_queens')
|
||||
if current_release >= bionic_queens:
|
||||
logging.warn("Adding second interface for dataport to guest netplan "
|
||||
"for bionic-queens and later")
|
||||
add_dataport_to_netplan = True
|
||||
else:
|
||||
try:
|
||||
# If we're using netplan, we need to add the new interface to the guest
|
||||
current_release = openstack_utils.get_os_release()
|
||||
bionic_queens = openstack_utils.get_os_release('bionic_queens')
|
||||
if current_release >= bionic_queens:
|
||||
logging.warn("Adding second interface for dataport to guest "
|
||||
"netplan for bionic-queens and later")
|
||||
add_dataport_to_netplan = True
|
||||
else:
|
||||
add_dataport_to_netplan = False
|
||||
except zaza.openstack.utilities.exceptions.ApplicationNotFound:
|
||||
# The setup_gateway_ext_port helper may be used with non-OpenStack
|
||||
# workloads.
|
||||
add_dataport_to_netplan = False
|
||||
|
||||
logging.info("Configuring network for OpenStack undercloud/provider")
|
||||
|
||||
Reference in New Issue
Block a user