
Hi. First of all thanks for this great project and specially for keeping the Perl library. I need to keep the IP address of the virtual machines the same as long as possible. dnsmasq provides a setting for lease time. It can be set to infinite, but not from within libvirt. I found this patch from 2016.
https://listman.redhat.com/archives/libvir-list/2016-October/msg00561.html But it looks like it never made to libvirt. Some time ago I made it work changing dnsmasq/default.conf. Then we made it immutable with chattr. This no longer works because libvirt refuses to start dnsmasq unless it can write to it. Fair enough. I've seen I can add manual IP addresses as stated here: https://wiki.libvirt.org/page/Networking This is ok, but it would be a considerable amount of work, requiring lots of manual labour. Is there a way to set the lease time from libvirt ? Thank you !

On 3/22/21 4:01 PM, Francesc Guasch wrote:
Hi. First of all thanks for this great project and specially for keeping the Perl library.
I need to keep the IP address of the virtual machines the same as long as possible. dnsmasq provides a setting for lease time. It can be set to infinite, but not from within libvirt.
I found this patch from 2016.
https://listman.redhat.com/archives/libvir-list/2016-October/msg00561.html
But it looks like it never made to libvirt.
That particular patch no, but another approach did: https://gitlab.com/libvirt/libvirt/-/commit/97a0aa246799c97d0a9ca9ecd6b4fd93... It's part of the v6.3.0 release.
Some time ago I made it work changing dnsmasq/default.conf. Then we made it immutable with chattr. This no longer works because libvirt refuses to start dnsmasq unless it can write to it. Fair enough.
I've seen I can add manual IP addresses as stated here:
https://wiki.libvirt.org/page/Networking
This is ok, but it would be a considerable amount of work, requiring lots of manual labour.
Is there a way to set the lease time from libvirt ?
Well, if you don't really need static IPs but a stable way to address guests, then NSS plugin might help: https://libvirt.org/nss.html Michal

On 3/23/21 1:54 PM, Michal Privoznik wrote:
On 3/22/21 4:01 PM, Francesc Guasch wrote:
Hi. First of all thanks for this great project and specially for keeping the Perl library.
I need to keep the IP address of the virtual machines the same as long as possible. dnsmasq provides a setting for lease time. It can be set to infinite, but not from within libvirt.
I found this patch from 2016. > https://listman.redhat.com/archives/libvir-list/2016-October/msg00561.html
But it looks like it never made to libvirt.
That particular patch no, but another approach did:
https://gitlab.com/libvirt/libvirt/-/commit/97a0aa246799c97d0a9ca9ecd6b4fd93...
It's part of the v6.3.0 release.
Forgot to point out that there were couple of fixes for infinite leases: https://gitlab.com/libvirt/libvirt/-/commit/49869e8d57f2dcba44b2cb56aaa27d10... https://gitlab.com/libvirt/libvirt/-/commit/c14bd64f3eba9838af8ab1cac369d51a... https://gitlab.com/libvirt/libvirt/-/commit/8e5659ed12d1f181297ed6d4e201bb1d... https://gitlab.com/libvirt/libvirt/-/commit/003fff38e753d2d7cacaa3afd3f942f9... https://gitlab.com/libvirt/libvirt/-/commit/6f1ae57129f28444d14bd4b6dbcbf415... https://gitlab.com/libvirt/libvirt/-/commit/9c65363a4089bb5a2bf91db45bb9531a... https://gitlab.com/libvirt/libvirt/-/commit/ee93656c40467fa614e999a146a56011... https://gitlab.com/libvirt/libvirt/-/commit/5fb6d98c881c42ab41ca72060217b846... https://gitlab.com/libvirt/libvirt/-/commit/5dd53684e18c9ed3d73ab889e4c24cf8... https://gitlab.com/libvirt/libvirt/-/commit/7f93905e45f0ec3d28082adbcc061f6c... They are all part of the v7.0.0 release. Michal

On 23/03/2021 14:43, Michal Privoznik wrote:
On 3/23/21 1:54 PM, Michal Privoznik wrote:
On 3/22/21 4:01 PM, Francesc Guasch wrote:
But it looks like it never made to libvirt.
That particular patch no, but another approach did:
It's part of the v6.3.0 release.
Michal, this is great ! Thank your for that information. We need to upgrade the server but eventually it will be fixed for us. Thanks !
participants (2)
-
Francesc Guasch
-
Michal Privoznik