I am using LXD with a standard configuration that assigns ipv4 private addresses to containers via DHCP/dnsmasq. When I reboot the host, some containers (not all) change ip address. I think those are containers that were created from the same container (via a copy or via a template that was published from another container). Those may rotate ip addresses between them. I checked that the virtual MAC addresses of the containers remain the same after host reboot and that each container has a different MAC adddress. Why then doesn't dnsmasq keep the same ip address and the same lease time? All the lease times change in /var/lib/lxd-bridge/dnsmasq.lxdbr0.leases after reboot. Why is this happening? Is it a bug?
How can I ensure that it doesn't happen? I can assign static ip addresses, but this would require an extra configuration step in several situations, e.g. each time the container is copied/moved to another server (which I sometimes do). It would also require an additional guest reboot to make sure that the configuration is correct.