Bug 913446
Summary: | RFE: network: allow configuring dhcp lease time | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | xingxing <itxx00> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
Status: | CLOSED NEXTRELEASE | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | unspecified | CC: | berrange, crobinso, cwei, dyuan, itxx00, jdenemar, mprivozn, mzhan, nehaljw.kkd1, omahns.home, pkrempa, yalzhang |
Target Milestone: | --- | Keywords: | Upstream |
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | LibvirtFirstBug | ||
Fixed In Version: | libvirt-6.3.0 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-04-23 11:31:58 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1926508 |
Description
xingxing
2013-02-21 09:35:09 UTC
*** Bug 1244736 has been marked as a duplicate of this bug. *** I looked into this from the implementation POV, basically the network XML format does not support this at all so everything relies on dnsmasq's default lease time. This should be trivially fixed by adding an XML tag for the lease expiry length and setting it in the dhcp-range record accordingly, if the XML tag uses the same format as dnsmasq then there's no translation needed. Any progress on this? (In reply to Alberto Ruiz from comment #5) > Any progress on this? No, I doubt anyone is actively working on this. If you need this feature then I suggest sending patches, it should be fairly straight forward as you suggest. Possible XML could be <dhcp leaseTime=XXX/> or <dhcp><leaseTime>XXX</leaseTime> or <dhcp><lease time=XXX/> network XML format extended in src/conf/network_conf.c dnsmasq option handling in src/network/bridge_driver.c extend documentation and test suite An example commit to follow that handles all those bits: commit 298fa4858ced29e2c42681635a5a8dcd6da0b231 Author: Josh Stone <jistone> Date: Wed Dec 3 16:01:33 2014 -0800 network: Let domains be restricted to local DNS I've created an attemptive patch for this, any feedback is welcome: https://github.com/libvirt/libvirt/compare/master...aruiz:master Thanks for the patch! A quick look that seems sensible except like the patch points out we should sanitize or handle the time string value. We may not want to do straight passthrough to dnsmasq since then we our XML API is dependent on their semantics. Please git send-email that patch to libvir-list, even as is, so we can discuss that point with a larger audience This did not make the list yet. I actually have a local branch where I'm implementing this, I struggled with making hostfiles part of the testable outcomes as I want to add support for leasetime on a per host basis as part of the patch. You probably should then assign the bug to yourself to notify people you are working on it. In the meanwhile we have a submission on the libvir-list: https://www.redhat.com/archives/libvir-list/2016-September/msg01063.html If you have different opinion how to implement it you should respond to that patch. I've finally rebased my patchset to a private branch in my github account: https://github.com/libvirt/libvirt/compare/master...aruiz:master Before I propose this in the list I need to write the actual tests cases for all the per-hosts lease combinations (hostsfiles are kinda complicated and have many syntaxes depending on ipv4/6 and other aspects). Will prolly spend some time on this tomorrow and propose the final patchset on the list. Sorry it took me so long. I've proposed an updated patch with no further comments: https://www.redhat.com/archives/libvir-list/2016-October/msg00561.html This patch would be really useful to our specific use case. Is there anything we can do to help this ticket progress? The patch works, I submitted it to the mailing list but it got ignored. Not sure what to do to move things forward. You can follow the discussion in this thread: https://www.redhat.com/archives/libvir-list/2017-June/msg00983.html Another attempt at lease time config here: https://www.redhat.com/archives/libvir-list/2020-April/msg00743.html And I've merged patches upstream: 8589ecc69f networkxml2xmltest: Complete renaming of @actual 7e5a40fd0f tests: Add tests for <lease/> to cover dnsmasq settings 97a0aa2467 conf: Add <lease/> option for <dhcp/> settings v6.2.0-218-g8589ecc69f |