[pve-devel] [RFC cluster/manager/network 0/6] Add support for DHCP servers to SDN

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Sep 13 14:40:33 CEST 2023


Am 13/09/2023 um 13:50 schrieb Stefan Hanreich:
> On 9/13/23 13:37, Thomas Lamprecht wrote:
>> Am 13/09/2023 um 10:54 schrieb Stefan Hanreich:
>>> With dnsmasq there is even the possibility of running scripts (via --dhcp-script, see the docs [1]) when a lease is added / changed / deleted. But as far as I can tell this can not be used to override the IP that dnsmasq provides via DHCP, so it is probably not really useful for our use-case.
>>
>>
>> Getting a IP from IPAM and generating a simple MAC to IP mapping
>> actively on guest start, i.e., before the VM or CT would actually
>> run, would be enough though.
>>
>> This sounds relatively simple and would avoid most issues without
>> backing us into a corner for possible more complex/flexible solutions
>> in the future.
> 
> Sounds good. We would then remove the mapping on shutdown / stop, I suppose? How about Hibernate / Pause? I can see a case for both here..

Yeah, VM hibernate/suspension is genreally a bit icky, time can also
be way off on resume if the guest OS (services) doesn't detects this.

But here I think we can model it after reality, where such a lease
is kept until expiry and then freed for reuse, if the VM gets resumed
again it needs to be able to handle this just like a suspend/hibernate
on a bare metal PC or laptop needs to be able to do and ask for a new
lease, which has then be allocated already on resume by our API – it
just might not be the original one from before the suspension.
I hope I didn't manage to describe this in a too convoluted way, also
actively.

But tldr: yes, remove on stop/shutdown/suspend as it will be freshly
generated again before next start/resume anyway.

Not sure how dnsmasq handles such reloads, especially at cold boot
where it might happen thousands of times in a relatively short period.





More information about the pve-devel mailing list