Retrieve IPv6 addresses from VMs
This commit allows the model to fetch IPv6 addresses from running VMs and populate VirtualMachine objects with the value if it was retrieved successfully
This commit is contained in:
@ -29,7 +29,8 @@ if virsh domuuid "$vmname" | grep -vqE '^[\t\s\n]*$'; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# this gets the ipv4
|
||||
# this gets the vm ip addresses
|
||||
ipv4="$(virsh domifaddr "$vmname" | awk '/ipv4/ {print $4}' | cut -d'/' -f1)"
|
||||
ipv6="$(virsh domifaddr "$vmname" | awk '/ipv6/ {print $4}' | cut -d'/' -f1)"
|
||||
|
||||
echo "$exists $state $ipv4"
|
||||
echo "$exists $state $ipv4 $ipv6"
|
||||
|
Reference in New Issue
Block a user