diff --git a/nova/Chart.yaml b/nova/Chart.yaml index 0287383cb8..62dec55244 100644 --- a/nova/Chart.yaml +++ b/nova/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Nova name: nova -version: 0.3.6 +version: 0.3.7 home: https://docs.openstack.org/nova/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png sources: diff --git a/nova/templates/bin/_nova-compute-init.sh.tpl b/nova/templates/bin/_nova-compute-init.sh.tpl index 0636b69ff3..442e7d6b19 100644 --- a/nova/templates/bin/_nova-compute-init.sh.tpl +++ b/nova/templates/bin/_nova-compute-init.sh.tpl @@ -23,18 +23,23 @@ mkdir -p /var/lib/nova/instances chown ${NOVA_USER_UID} /var/lib/nova /var/lib/nova/instances migration_interface="{{- .Values.conf.libvirt.live_migration_interface -}}" -if [[ -n $migration_interface ]]; then - # determine ip dynamically based on interface provided - migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) +if [[ -z $migration_interface ]]; then + # search for interface with default routing + # 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 -touch /tmp/pod-shared/nova-libvirt.conf -if [[ -n $migration_address ]]; then -cat </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 [ -z "${migration_address}" ] ; then + echo "Var live_migration_interface is empty" + exit 1 +fi + +tee > /tmp/pod-shared/nova-libvirt.conf << EOF [libvirt] live_migration_inbound_addr = $migration_address EOF -fi hypervisor_interface="{{- .Values.conf.hypervisor.host_interface -}}" if [[ -z $hypervisor_interface ]]; then diff --git a/releasenotes/notes/nova.yaml b/releasenotes/notes/nova.yaml index 072fc64bb0..59754abdc7 100644 --- a/releasenotes/notes/nova.yaml +++ b/releasenotes/notes/nova.yaml @@ -75,4 +75,5 @@ nova: - 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.6 Fix VNC access issues + - 0.3.7 Fix live migration without DNS resolution ...