My goal is to find out ip address of new virtual machine by using libvirt api only (>=0.10). Currently I am using libvirt's net-update command: before start a new machine I set static dhcp entry for it and vm booting with known address.
It works almost fine even with old libvirt versions, but has a one bug. When I "force off" machine, it doesn't send "release" query to dhcp server (libvirt/dnsmasq) and this ip remains in leases file. If I create a new machine with same ip address before dhcp lease timed out, it won't get ip address from static entry, because dhcp server considers this ip is already used (based on information in lease file).
Are there any more robust solutions to get machine ip address or set it before start without shell access to target server or static network configuration inside virtual machine?