fix(nova): add default live_migration_inbound_addr

At the moment, if live_migration_inbound_addr is not defined it
will default to the hostname of the hypervisor which requires
DNS in order to work properly.

DNS can be complicated and it is possible that an environment
might not have it, so it makes sense to default to grabbing the
default route interface to do live migrations over in order
to allow live migrations when DNS is not setup.

Change-Id: I10eb63fc64d7cd34ef89df529637b1e81951e38c
This commit is contained in:
Mohammed Naser 2023-03-30 13:29:49 -04:00
parent c4e0007717
commit 8f0a154138
3 changed files with 14 additions and 8 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Nova description: OpenStack-Helm Nova
name: nova name: nova
version: 0.3.6 version: 0.3.7
home: https://docs.openstack.org/nova/latest/ home: https://docs.openstack.org/nova/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png
sources: sources:

View File

@ -23,18 +23,23 @@ mkdir -p /var/lib/nova/instances
chown ${NOVA_USER_UID} /var/lib/nova /var/lib/nova/instances chown ${NOVA_USER_UID} /var/lib/nova /var/lib/nova/instances
migration_interface="{{- .Values.conf.libvirt.live_migration_interface -}}" migration_interface="{{- .Values.conf.libvirt.live_migration_interface -}}"
if [[ -n $migration_interface ]]; then if [[ -z $migration_interface ]]; then
# determine ip dynamically based on interface provided # search for interface with default routing
migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) # If there is not default gateway, exit
migration_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1
fi fi
touch /tmp/pod-shared/nova-libvirt.conf migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1)
if [[ -n $migration_address ]]; then
cat <<EOF>/tmp/pod-shared/nova-libvirt.conf if [ -z "${migration_address}" ] ; then
echo "Var live_migration_interface is empty"
exit 1
fi
tee > /tmp/pod-shared/nova-libvirt.conf << EOF
[libvirt] [libvirt]
live_migration_inbound_addr = $migration_address live_migration_inbound_addr = $migration_address
EOF EOF
fi
hypervisor_interface="{{- .Values.conf.hypervisor.host_interface -}}" hypervisor_interface="{{- .Values.conf.hypervisor.host_interface -}}"
if [[ -z $hypervisor_interface ]]; then if [[ -z $hypervisor_interface ]]; then

View File

@ -75,4 +75,5 @@ nova:
- 0.3.4 Add OVN values_override, disable dependency to ovn-agent and vif configs for ovn - 0.3.4 Add OVN values_override, disable dependency to ovn-agent and vif configs for ovn
- 0.3.5 Replace node-role.kubernetes.io/master with control-plane - 0.3.5 Replace node-role.kubernetes.io/master with control-plane
- 0.3.6 Fix VNC access issues - 0.3.6 Fix VNC access issues
- 0.3.7 Fix live migration without DNS resolution
... ...