Closed peppepetra closed 1 month ago
Hello,
I have a scenario where I am using juju deployed on LXD vms in a microcloud setup and rebooting a single vm mutliple times does not result in an ip change but rebooting a physical host results in almost every vm on that host getting a new ip, even with volatile.eth0.last_state.ip_addresses
being set.
Versions:
Reproducer:
lxc launch ubuntu:noble guest1
lxc stop guest1
lxc launch ubuntu:noble guest2
lxc start guest1
The key difference is that the 2nd instance wasn't started for the first time until after the 1st instance was stopped.
So it was then allocated the next free IP, which was the one guest1 had released when it was stopped.
When guest1 is started again, it tries to use its old IP, but is unable to because guest2 has taken it.
This is working as intended because the sticky IPs feature was best-effort sticky IPs, not automatic guaranteed static IP allocation.
Although this doesn't reflect the issue @nishant-dash saw, as all the instances had been previously started before he rebooted the LXD host.
Required information
Issue description
OVN assigns IPs sequentially. That means if I create two containers then delete one and stop/start the other one, the latter changes IP.
Steps to reproduce
lxc launch ubuntu:22.04 test-sticky-ip
lxc launch ubuntu:22.04 test-sticky-ip-2
lxc delete test-sticky-ip --force
lxc stop test-sticky-ip-2
lxc start test-sticky-ip-2
Result
test-sticky-ip-2
get IP previously allocated fortest-sticky-ip