From 856c1f843251929fa95a4e7b3868576573ee25cc Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Thu, 2 Apr 2020 19:30:23 -0700 Subject: [PATCH] Always print MAC address for created VM (#52) It's useful in case if you're using bridge or IP address can't be obtained for some other reason. --- kvm-install-vm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kvm-install-vm b/kvm-install-vm index 991eebc..ee1b781 100755 --- a/kvm-install-vm +++ b/kvm-install-vm @@ -727,10 +727,12 @@ _EOF_ outputn "Cleaning up cloud-init files" rm -f $USER_DATA $META_DATA $CI_ISO && ok + MAC=$(virsh dumpxml ${VMNAME} | awk -F\' '/mac address/ {print $2}') + output "MAC address: ${MAC}" + if [ -f "/var/lib/libvirt/dnsmasq/${BRIDGE}.status" ] then outputn "Waiting for domain to get an IP address" - MAC=$(virsh dumpxml ${VMNAME} | awk -F\' '/mac address/ {print $2}') while true do IP=$(grep -B1 $MAC /var/lib/libvirt/dnsmasq/$BRIDGE.status | head \