Bug 1266190 - net-dhcp-leases returns nothing for VM that is restored after leases haved timed out
net-dhcp-leases returns nothing for VM that is restored after leases haved ti...
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Depends On:
  Show dependency treegraph
Reported: 2015-09-24 13:57 EDT by Zeeshan Ali
Modified: 2016-09-19 21:43 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Zeeshan Ali 2015-09-24 13:57:19 EDT
Description of problem:

I have a domain running (on session libvirt) with following network configuration:

    <interface type='bridge'>
      <mac address='52:54:00:c2:2e:90'/>
      <source bridge='virbr0'/>
      <target dev='tap0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>

The networking inside guest is working fine too. However, system libvirtd (which afaik manages the virbr0) reports no active dhcp leases:

$ virsh -c qemu:///system
Welcome to virsh, the virtualisation interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # net-dhcp-leases 
error: command 'net-dhcp-leases' requires <network> option
virsh # net-list
 Name                 State      Autostart     Persistent
 default              active     yes           yes

virsh # net-dhcp-leases default
 Expiry Time          MAC address        Protocol  IP address                Hostname        Client ID or DUID

virsh #

This worked at least a few months ago so I'm guessing this is some sort of regression. We use the net-dhcp-leases API in Boxes to retrieve the IP address of the guest.

Version-Release number of selected component (if applicable):

How reproducible: 100%

Steps to Reproduce: See above.
Comment 1 Zeeshan Ali 2015-09-25 10:19:45 EDT
So turns out that this is caused by guest continuing to use it's last lease after being restored from a saved state. Maybe libvirt should try to retain the leases for VMs, maybe through a very large lease time (bug#913446).

Note You need to log in before you can comment on or make changes to this bug.