Drop lib/neutron module

Module lib/neutron was introduced long time ago as new module to deploy
neutron. It was intended to replace old lib/neutron-legacy module. But
since very long time it wasn't really finished and used by anyone and
lib/neutron-legacy is defacto standard module used by everyone to deploy
neutron with devstack.
In [1] unfinished lib/neutron was deprecated and now it's time to remove
it from the devstack code.

This patch also renames old "lib/neutron-legacy" module to be
"lib/neutron" now.

Previously "old" lib/neutron-legacy module was accepting neutron
services names wit "q-" prefix and "new" lib/neutron module was accepting
services with "neutron-" prefix. Now, as there is only one module it
accepts both prefixes.
For historical reasons and to be consistent with old lib/neutron-legacy
which was widely used everywhere, services will be named with "q-"
prefix but both prefixes will be accepted to enable or disable services.

This patch also moves _configure_neutron_service function to be called
at the end of the "configure_neutron" after all agents and service
plugins are already configured.

[1] https://review.opendev.org/c/openstack/devstack/+/823653

Related-bug: #1996748

Change-Id: Ibf1c8b2ee6b6618f77cd8486e9c687993d7cb4a0
This commit is contained in:
Slawek Kaplonski 2022-11-18 11:39:56 +01:00
parent 2d71d54814
commit a52041cd3f
14 changed files with 994 additions and 1706 deletions

View File

@ -50,7 +50,6 @@ source $TOP_DIR/lib/placement
source $TOP_DIR/lib/cinder
source $TOP_DIR/lib/swift
source $TOP_DIR/lib/neutron
source $TOP_DIR/lib/neutron-legacy
set -o xtrace

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ Plugin specific configuration variables should be in this file.
functions
---------
``lib/neutron-legacy`` calls the following functions when the ``$Q_PLUGIN`` is enabled
``lib/neutron`` calls the following functions when the ``$Q_PLUGIN`` is enabled
* ``neutron_plugin_create_nova_conf`` :
optionally set options in nova_conf

View File

@ -67,7 +67,7 @@ function has_neutron_plugin_security_group {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
}
# Restore xtrace

View File

@ -72,7 +72,7 @@ function has_neutron_plugin_security_group {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
}
# Restore xtrace

View File

@ -97,7 +97,7 @@ function neutron_plugin_setup_interface_driver {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
}
# Restore xtrace

View File

@ -67,7 +67,7 @@ function neutron_plugin_configure_common {
Q_PLUGIN_CLASS="ml2"
# The ML2 plugin delegates L3 routing/NAT functionality to
# the L3 service plugin which must therefore be specified.
_neutron_service_plugin_class_add $ML2_L3_PLUGIN
neutron_service_plugin_class_add $ML2_L3_PLUGIN
}
function neutron_plugin_configure_service {

View File

@ -68,7 +68,7 @@ function neutron_plugin_setup_interface_driver {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
}
# Restore xtrace

View File

@ -348,7 +348,7 @@ function compile_ovn {
# OVN service sanity check
function ovn_sanity_check {
if is_service_enabled q-agt neutron-agt; then
if is_service_enabled q-agt neutron-agent; then
die $LINENO "The q-agt/neutron-agt service must be disabled with OVN."
elif is_service_enabled q-l3 neutron-l3; then
die $LINENO "The q-l3/neutron-l3 service must be disabled with OVN."
@ -461,7 +461,7 @@ function filter_network_api_extensions {
function configure_ovn_plugin {
echo "Configuring Neutron for OVN"
if is_service_enabled q-svc ; then
if is_service_enabled q-svc neutron-api; then
filter_network_api_extensions
populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_geneve max_header_size=$OVN_GENEVE_OVERHEAD
populate_ml2_config /$Q_PLUGIN_CONF_FILE ovn ovn_nb_connection="$OVN_NB_REMOTE"
@ -485,7 +485,7 @@ function configure_ovn_plugin {
inicomment /$Q_PLUGIN_CONF_FILE network_log local_output_log_base="$Q_LOG_DRIVER_LOG_BASE"
fi
if is_service_enabled q-ovn-metadata-agent; then
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
populate_ml2_config /$Q_PLUGIN_CONF_FILE ovn ovn_metadata_enabled=True
else
populate_ml2_config /$Q_PLUGIN_CONF_FILE ovn ovn_metadata_enabled=False
@ -506,7 +506,7 @@ function configure_ovn_plugin {
fi
if is_service_enabled n-api-meta ; then
if is_service_enabled q-ovn-metadata-agent ; then
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
iniset $NOVA_CONF neutron service_metadata_proxy True
fi
fi
@ -539,7 +539,7 @@ function configure_ovn {
fi
# Metadata
if is_service_enabled q-ovn-metadata-agent && is_service_enabled ovn-controller; then
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent && is_service_enabled ovn-controller; then
sudo install -d -o $STACK_USER $NEUTRON_CONF_DIR
mkdir -p $NEUTRON_DIR/etc/neutron/plugins/ml2
@ -551,7 +551,7 @@ function configure_ovn {
iniset $OVN_META_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
iniset $OVN_META_CONF DEFAULT nova_metadata_host $OVN_META_DATA_HOST
iniset $OVN_META_CONF DEFAULT metadata_workers $API_WORKERS
iniset $OVN_META_CONF DEFAULT state_path $NEUTRON_STATE_PATH
iniset $OVN_META_CONF DEFAULT state_path $DATA_DIR/neutron
iniset $OVN_META_CONF ovs ovsdb_connection tcp:$OVSDB_SERVER_LOCAL_HOST:6640
iniset $OVN_META_CONF ovn ovn_sb_connection $OVN_SB_REMOTE
if is_service_enabled tls-proxy; then
@ -680,7 +680,7 @@ function _start_ovn_services {
if is_service_enabled ovs-vtep ; then
_start_process "devstack@ovs-vtep.service"
fi
if is_service_enabled q-ovn-metadata-agent; then
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent ; then
_start_process "devstack@q-ovn-metadata-agent.service"
fi
}
@ -743,7 +743,7 @@ function start_ovn {
fi
fi
if is_service_enabled q-ovn-metadata-agent; then
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
run_process q-ovn-metadata-agent "$NEUTRON_OVN_BIN_DIR/$NEUTRON_OVN_METADATA_BINARY --config-file $OVN_META_CONF"
# Format logging
setup_logging $OVN_META_CONF
@ -767,7 +767,7 @@ function _stop_process {
}
function stop_ovn {
if is_service_enabled q-ovn-metadata-agent; then
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
sudo pkill -9 -f haproxy || :
_stop_process "devstack@q-ovn-metadata-agent.service"
fi

View File

@ -323,7 +323,7 @@ function _neutron_configure_router_v4 {
openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" router set --external-gateway $EXT_NET_ID $ROUTER_ID
# This logic is specific to using OVN or the l3-agent for layer 3
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-server) || is_service_enabled q-l3 neutron-l3; then
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-api) || is_service_enabled q-l3 neutron-l3; then
# Configure and enable public bridge
local ext_gw_interface="none"
if is_neutron_ovs_base_plugin; then
@ -372,7 +372,7 @@ function _neutron_configure_router_v6 {
fi
# This logic is specific to using OVN or the l3-agent for layer 3
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-server) || is_service_enabled q-l3 neutron-l3; then
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-api) || is_service_enabled q-l3 neutron-l3; then
# if the Linux host considers itself to be a router then it will
# ignore all router advertisements
# Ensure IPv6 RAs are accepted on interfaces with a default route.

View File

@ -12,7 +12,7 @@ AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent"
METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin"
function neutron_agent_metering_configure_common {
_neutron_service_plugin_class_add $METERING_PLUGIN
neutron_service_plugin_class_add $METERING_PLUGIN
}
function neutron_agent_metering_configure_agent {

View File

@ -6,7 +6,7 @@ function configure_qos_service_plugin {
function configure_qos_core_plugin {
configure_qos_$NEUTRON_CORE_PLUGIN
configure_qos_$Q_PLUGIN
}

View File

@ -737,12 +737,12 @@ function configure_tempest {
# Neutron API Extensions
# disable metering if we didn't enable the service
if ! is_service_enabled q-metering; then
if ! is_service_enabled q-metering neutron-metering; then
DISABLE_NETWORK_API_EXTENSIONS+=", metering"
fi
# disable l3_agent_scheduler if we didn't enable L3 agent
if ! is_service_enabled q-l3; then
if ! is_service_enabled q-l3 neutron-l3; then
DISABLE_NETWORK_API_EXTENSIONS+=", l3_agent_scheduler"
fi