From fdd6b4507d6e750650ec65e710c4503e99580073 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Mon, 8 Mar 2021 11:48:03 -0500 Subject: [PATCH] Use first IP address for interface It is possible than an interface has multiple IP addresses, for simplicity of this change, use the first one so that the service can start. We can look later into improving it to accept some sort of index for the IP address. Change-Id: Ie856f54331d689a51bfd6de45db5820b765797ef --- nova/Chart.yaml | 2 +- nova/templates/bin/_nova-compute-init.sh.tpl | 4 ++-- releasenotes/notes/nova.yaml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nova/Chart.yaml b/nova/Chart.yaml index 209d3d54dd..d464e287bd 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.1.15 +version: 0.1.16 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 3dafce73c3..0636b69ff3 100644 --- a/nova/templates/bin/_nova-compute-init.sh.tpl +++ b/nova/templates/bin/_nova-compute-init.sh.tpl @@ -25,7 +25,7 @@ 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}') + migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) fi touch /tmp/pod-shared/nova-libvirt.conf @@ -43,7 +43,7 @@ if [[ -z $hypervisor_interface ]]; then hypervisor_interface=$(ip -4 route list 0/0 | awk -F 'dev' '{ print $2; exit }' | awk '{ print $1 }') || exit 1 fi -hypervisor_address=$(ip a s $hypervisor_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}') +hypervisor_address=$(ip a s $hypervisor_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}' | head -1) if [ -z "${hypervisor_address}" ] ; then echo "Var my_ip is empty" diff --git a/releasenotes/notes/nova.yaml b/releasenotes/notes/nova.yaml index 3a4dba5dfa..b6122bfc1e 100644 --- a/releasenotes/notes/nova.yaml +++ b/releasenotes/notes/nova.yaml @@ -16,3 +16,4 @@ nova: - 0.1.13 Change Issuer to ClusterIssuer - 0.1.14 BUG for deploying multiple compute nodes - 0.1.15 Mount /dev/pts in Nova compute container + - 0.1.16 Use first IP address for migration