i hope this is the right place and someone here is managing the build process of the snapcraft images for multipass.
i had problems starting multiple instances using the same snapcraft image via multipass.
i didn’t matter if this was done via snapcraft or directlty via multipass launch.
all instances which use the same image get the same ip address.
after watching the network traffic it was clear that the dhcp requests were carrying the same identifier via option 61.
it seems like you forgot to empty /etc/machine-id and /var/lib/dbus/machine-id before shipping the image. at least thats a way it works, ubuntu creates a new random machine id when both files are empty.
for a test i emptied both files in the qcow2 image and created new instances which were not assignes the same ip any more.
Thanks for investigating and cross-posting on the multipass issue. It looks like they are following up with the Certified Public Cloud team to clear /etc/machine-id for the Multipass images.
I have a tangential issue, because I’ve been gone so long. Could someone compile a list of things that needs to be changed for these things, if there are more, I mean?
i only emptied /etc/machine-id and /var/lib/dbus/machine-id in the image and this issue was gone. the id’s are regenerated during boot when the files are empty.
i only repaired snapcraft:core18 here locally because mounting of qcow2 images is a bit cumbersome
these images were not working: (they all have different ids, but they all have ids in the image)
it is also possible to force an id with a kernel paramter
when i was cross checking with other multipass images (IIRC core18) i saw that /etc was mountet ro and /etc/machine-id was mounted as a tmpfs.
regard the bug report @launchpad IIRC both files are the problem /etc/machine-id and /var/lib/dbus/machine-id
We mounted the qcow2 images directly, ie, before first boot and /etc/machine-id is empty but /var/lib/dbus/machine-id which is the source of the problem and why I filed the bug that way. You are seeing the image after boot which is filling in /etc/machine-id with what’s contained in the other file.
Note that snapcraft:core* is not the same as the Ubuntu Core* images. The snapcraft:core* are special images used for creating snap packages.
i was mounting the qcow images too, and i just checked again. i deleted the image
/var/snap/multipass/common/cache/multipassd/vault/images/snapcraft-core18-20201111/bionic-server-cloudimg-amd64-disk.img
then i issued a multipass launch -n foo snapcraft:core18
right before the download was finished i copied the image (from /var/snap/multi…/cache/…/images…), mounted it via guestmount and checked.
there is an id in /etc/machine-id and /var/lib/dbus/machine-id
Ok, I confirmed what you see on the bionic image. Some (all?) other images do not have /etc/machine-id filled out.
At any rate, the team responsible for these images understand where the problem is occurring during the image creation and the fix they will apply should fix both cases. I don’t have an ETA yet on when fixed images will be available though.