Bug 1266190 - net-dhcp-leases returns nothing for VM that is restored after leases haved timed out
Summary: net-dhcp-leases returns nothing for VM that is restored after leases haved ti...
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2015-09-24 17:57 UTC by Zeeshan Ali
Modified: 2020-11-03 17:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2020-11-03 17:11:50 UTC

Attachments (Terms of Use)

Description Zeeshan Ali 2015-09-24 17:57:19 UTC
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 14:19:45 UTC
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).

Comment 3 Daniel Berrangé 2020-11-03 17:11:50 UTC
Thank you for reporting this issue to the libvirt project. Unfortunately we have been unable to resolve this issue due to insufficient maintainer capacity and it will now be closed. This is not a reflection on the possible validity of the issue, merely the lack of resources to investigate and address it, for which we apologise. If you none the less feel the issue is still important, you may choose to report it again at the new project issue tracker https://gitlab.com/libvirt/libvirt/-/issues The project also welcomes contribution from anyone who believes they can provide a solution.

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