When using lxc restore instance backup-snapshot the instance got new IPs from lxdbr0. I’d like a general setting for LXD/lxdbr0 to remember and keep the IP addresses that were given on instance creation.
I know about setting the IP statically inside the instance and with other devices, and so on, is possible, but I’d like an easy way to do this kind of thing, the name of an instance does not change after restoring a snapshot, so why should other unique identifiers like IPs?
I also found out that the lease is made using the hardware macaddress, fortunately I had it in the bash history so I manually added the network device with the “old” hardware address and the old IPs came back.
Do you think it would make sense to be able to bake this kind of thing into the instance creation?
Like a flag --fixed-ips or anything in that direction to do that kind of overriding the profile and fixing it to the instance? Hardcoding it into the instance right at creation time.
And quick question: Will the ip stick even when moving the instance to another host?
If you’re using the API to create the instance you can populate the Devices field with the IP reservations you want at create time.
The lxc init and lxc launch commands don’t currently have a --device flag like lxc copy and lxc move commands have, which allows overriding specific config for a specific device.
@stgraber do you foresee any issues with adding a --device flag to lxc init and lxc launch?