From 90c2a2273e41e8fc43d81e44dfb786969eddaad7 Mon Sep 17 00:00:00 2001 From: Jawon Choo Date: Thu, 9 Aug 2018 20:25:13 +0900 Subject: [PATCH] Nova: (fix bug) get ip address from interface Some environment which is enabled zeroconf network, it returns multilines. This PS make to get the one ip address correctly. Change-Id: I577f02908b76b280d8fa87acec25d96c3f556e47 --- nova/templates/bin/_nova-compute-init.sh.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/templates/bin/_nova-compute-init.sh.tpl b/nova/templates/bin/_nova-compute-init.sh.tpl index 2dccfb4c29..b1e7cb505a 100644 --- a/nova/templates/bin/_nova-compute-init.sh.tpl +++ b/nova/templates/bin/_nova-compute-init.sh.tpl @@ -27,7 +27,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 r | grep $migration_interface | grep -v default | awk '{print $9}') + migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}') fi touch /tmp/pod-shared/nova-libvirt.conf