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/97a0aa246799c97d0a9ca9ecd6b4fd932ae4756c 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/97a0aa246799c97d0a9ca9ecd6b4fd932ae4756c > > > 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/49869e8d57f2dcba44b2cb56aaa27d101efa22ed https://gitlab.com/libvirt/libvirt/-/commit/c14bd64f3eba9838af8ab1cac369d51abfeb21b9 https://gitlab.com/libvirt/libvirt/-/commit/8e5659ed12d1f181297ed6d4e201bb1d6b6322b6 https://gitlab.com/libvirt/libvirt/-/commit/003fff38e753d2d7cacaa3afd3f942f938408334 https://gitlab.com/libvirt/libvirt/-/commit/6f1ae57129f28444d14bd4b6dbcbf4158b95431b https://gitlab.com/libvirt/libvirt/-/commit/9c65363a4089bb5a2bf91db45bb9531a20784c5f https://gitlab.com/libvirt/libvirt/-/commit/ee93656c40467fa614e999a146a56011a9c500e3 https://gitlab.com/libvirt/libvirt/-/commit/5fb6d98c881c42ab41ca72060217b846949a438f https://gitlab.com/libvirt/libvirt/-/commit/5dd53684e18c9ed3d73ab889e4c24cf8b45fa46c https://gitlab.com/libvirt/libvirt/-/commit/7f93905e45f0ec3d28082adbcc061f6cc94aa489 They are all part of the v7.0.0 release. Michal