Stop using DHCP for o-hm0 interface in devstack

We know the IP address allocated to the o-hm0 interface by neutron, so
there is no need to use DHCP on this interface. Some distributions are
changing DHCP clients and the current code fails on those new releases.

Closes-Bug: #2072593
Change-Id: Ie46a5d9620c8ef2b6da04976a742df9c71752e08
This commit is contained in:
Michael Johnson 2024-07-09 21:18:05 +00:00
parent 1c027c840c
commit f5b73d8e00
3 changed files with 26 additions and 22 deletions

View File

@ -435,10 +435,6 @@ function octavia_configure {
iniset $OCTAVIA_CONF oslo_policy policy_file $OCTAVIA_CONF_DIR/policy.yaml
fi
# create dhclient.conf file for dhclient
sudo mkdir -m755 -p $OCTAVIA_DHCLIENT_DIR
sudo cp $OCTAVIA_DIR/etc/dhcp/dhclient.conf $OCTAVIA_DHCLIENT_CONF
if [[ "$OCTAVIA_USE_MOD_WSGI" == "True" ]]; then
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
_configure_octavia_apache_uwsgi
@ -628,15 +624,19 @@ function configure_rsyslog {
function octavia_start {
if ! ps aux | grep -q [o]-hm0 && [ $OCTAVIA_NODE != 'api' ] ; then
if [ $OCTAVIA_NODE != 'api' ] ; then
# This is probably out of scope here? Load it from config
MGMT_PORT_IP=$(iniget $OCTAVIA_CONF health_manager bind_ip)
if [ $SERVICE_IP_VERSION == '6' ] ; then
# This is probably out of scope here? Load it from config
MGMT_PORT_IP=$(iniget $OCTAVIA_CONF health_manager bind_ip)
sudo ip addr add $MGMT_PORT_IP/64 dev o-hm0
sudo ip link set o-hm0 up
MGMT_SUBNET_ARRAY=(${OCTAVIA_MGMT_SUBNET_IPV6//// })
else
sudo dhclient -v o-hm0 -cf $OCTAVIA_DHCLIENT_CONF
MGMT_SUBNET_ARRAY=(${OCTAVIA_MGMT_SUBNET//// })
fi
MGMT_SUBNET_MASK=${MGMT_SUBNET_ARRAY[1]}
sudo ip addr add $MGMT_PORT_IP/$MGMT_SUBNET_MASK dev o-hm0
sudo ip link set o-hm0 up
fi
if [ $OCTAVIA_NODE == 'main' ]; then
@ -669,21 +669,31 @@ function octavia_stop {
stop_process $OCTAVIA_HOUSEKEEPER
stop_process $OCTAVIA_HEALTHMANAGER
# TODO(johnsom) Remove this in 2025.2 release so upgrades will stop this
# process.
# Kill dhclient process started for o-hm0 interface
pids=$(ps aux | awk '/[o]-hm0/ { print $2 }')
[ ! -z "$pids" ] && sudo kill $pids
if function_exists octavia_delete_network_interface_device ; then
octavia_delete_network_interface_device o-hm0
elif [[ $NEUTRON_AGENT == "openvswitch" || $Q_AGENT == "openvswitch" ]]; then
# This elif can go away in the X cycle, needed for grenade old/new logic
: # Do nothing
elif [[ $NEUTRON_AGENT == "linuxbridge" || $Q_AGENT == "linuxbridge" ]]; then
fi
# Grenade upgrades need the IP address removed here
MGMT_PORT_IP=$(iniget $OCTAVIA_CONF health_manager bind_ip)
if [ $SERVICE_IP_VERSION == '6' ] ; then
MGMT_SUBNET_ARRAY=(${OCTAVIA_MGMT_SUBNET_IPV6//// })
else
MGMT_SUBNET_ARRAY=(${OCTAVIA_MGMT_SUBNET//// })
fi
MGMT_SUBNET_MASK=${MGMT_SUBNET_ARRAY[1]}
sudo ip addr del $MGMT_PORT_IP/$MGMT_SUBNET_MASK dev o-hm0
if [[ $NEUTRON_AGENT == "linuxbridge" || $Q_AGENT == "linuxbridge" ]]; then
# This elif can go away in the X cycle, needed for grenade old/new logic
if ip link show o-hm0 ; then
sudo ip link del o-hm0
fi
else
die "Unknown network controller. Please define octavia_delete_network_interface_device"
fi
if [[ ${OCTAVIA_ENABLE_AMPHORAV2_JOBBOARD} == True ]]; then

View File

@ -9,10 +9,6 @@ OCTAVIA_BIN_DIR=${OCTAVIA_BIN_DIR:-$(get_python_exec_prefix)}
OCTAVIA_CONF_DIR=${OCTAVIA_CONF_DIR:-"/etc/octavia"}
OCTAVIA_SSH_DIR=${OCTAVIA_SSH_DIR:-${OCTAVIA_CONF_DIR}/.ssh}
OCTAVIA_CERTS_DIR=${OCTAVIA_CERTS_DIR:-${OCTAVIA_CONF_DIR}/certs}
# This needs to be under /etc/dhcp for apparmor
# See https://storyboard.openstack.org/#!/story/1673269
OCTAVIA_DHCLIENT_DIR=${OCTAVIA_DHCLIENT_DIR:-"/etc/dhcp/octavia"}
OCTAVIA_DHCLIENT_CONF=${OCTAVIA_DHCLIENT_CONF:-${OCTAVIA_DHCLIENT_DIR}/dhclient.conf}
OCTAVIA_CONF=${OCTAVIA_CONF:-${OCTAVIA_CONF_DIR}/octavia.conf}
OCTAVIA_AUDIT_MAP=${OCTAVIA_AUDIT_MAP:-${OCTAVIA_CONF_DIR}/octavia_api_audit_map.conf}
OCTAVIA_RUN_DIR=${OCTAVIA_RUN_DIR:-"/var/run/octavia"}

View File

@ -1,2 +0,0 @@
request subnet-mask,broadcast-address,interface-mtu;
do-forward-updates false;