multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Multipass fails to notice IP change over reboot

Open Saviq opened this issue 3 years ago • 2 comments

$ multipass launch http://cdimage.ubuntu.com/ubuntu-core/20/stable/current/ubuntu-core-20-amd64.img.xz
launch failed: The following errors occurred:
timed out waiting for initialization to complete

$ multipass ls
Name                    State             IPv4             Image
fluttering-jackal       Restarting        --               Not Available

$ multipass stop fluttering-jackal

$ multipass start fluttering-jackal

$ multipass ls
Name                    State             IPv4             Image
fluttering-jackal       Running           10.127.143.204   Not Available

$ multipass exec fluttering-jackal grep PRETTY /etc/os-release
PRETTY_NAME="Ubuntu Core 20"

The problem is that the machine changes client-id over reboots, so DNSMasq gives up a new IP and Multipass fails to notice:

$ journalctl -u snap.multipass.multipassd.service --since -1h |grep DHCPACK
sie 01 15:27:08 michal-laptop dnsmasq-dhcp[10199]: DHCPACK(mpqemubr0) 10.127.143.203 52:54:00:59:fc:d9 ubuntu
sie 01 15:28:20 michal-laptop dnsmasq-dhcp[10199]: DHCPACK(mpqemubr0) 10.127.143.204 52:54:00:59:fc:d9 fluttering-jackal
sie 01 15:32:55 michal-laptop dnsmasq-dhcp[10199]: DHCPACK(mpqemubr0) 10.127.143.204 52:54:00:59:fc:d9 fluttering-jackal
sie 01 15:34:57 michal-laptop dnsmasq-dhcp[10199]: DHCPACK(mpqemubr0) 10.127.143.204 52:54:00:59:fc:d9 fluttering-jackal

Saviq avatar Aug 01 '22 14:08 Saviq

A little discourse:

Saviq: This will need fixing for booting Core 20, apparently. Sorry if the bug exists already.
ChrisTownsend: Ok, thanks, I don't think that bug already exists.  Thanks for pointing it out.
  One strange thing though I see in that, is how does it get into a "Restarting" state after the launch?
Saviq: Because it does actually restart when booting Core
ChrisTownsend: Ah, ok.
Saviq: The first boot process of Core 20+ is quite involved
ChrisTownsend: And that is why the init times out too, because it reboots.
Saviq: Well, -ish, it's trying on the first IP it got
  Which is /dev/null after the instance reboots
  B/c by then DNSMasq gave it a new IP
  I think DTRT would be to invalidate the IP on reboot
  OTOH that might not be enough b/c DNSMasq will still hold that one for the MAC
  Until a new DHCPREQ comes in
  So maybe reconfiguring DNSMasq to ignore the client id would be better

Saviq avatar Aug 01 '22 15:08 Saviq

BTW, workaround is to stop/start the instance after it times out.

Saviq avatar Aug 08 '22 14:08 Saviq