Browse Source

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.
pull/55/head v0.10.4
Sergey Lukjanov 6 years ago committed by GitHub
parent
commit
856c1f8432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      kvm-install-vm

4
kvm-install-vm

@ -727,10 +727,12 @@ _EOF_
outputn "Cleaning up cloud-init files" outputn "Cleaning up cloud-init files"
rm -f $USER_DATA $META_DATA $CI_ISO && ok 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" ] if [ -f "/var/lib/libvirt/dnsmasq/${BRIDGE}.status" ]
then then
outputn "Waiting for domain to get an IP address" outputn "Waiting for domain to get an IP address"
MAC=$(virsh dumpxml ${VMNAME} | awk -F\' '/mac address/ {print $2}')
while true while true
do do
IP=$(grep -B1 $MAC /var/lib/libvirt/dnsmasq/$BRIDGE.status | head \ IP=$(grep -B1 $MAC /var/lib/libvirt/dnsmasq/$BRIDGE.status | head \

Loading…
Cancel
Save