canonical / canonical/multipass
cloud-init instructions getting ignored in certain cases
- Dominant language
- C++
- Stars
- 9.2k
- Forks
- 828
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 44
Description
**Describe the bug**
As per title.
**To Reproduce**
1. Copy this command from [the docs](https://documentation.ubuntu.com/multipass/latest/how-to-guides/manage-instances/launch-customized-instances-with-multipass-and-cloud-init/#charm-dev):
```
$ multipass launch 24.04 \
--name charm-dev \
--cpus 2 \
--memory 4G \
--disk 50G \
--timeout 1800 \
--cloud-init https://raw.githubusercontent.com/canonical/multipass/refs/heads/main/data/cloud-init-yaml/cloud-init-charm-dev.yaml
```
2. Notice how the VM launches almost instantly (weird, given #4395 and the large number of packages to install)
3. Shell inside, see that none of the packages or configurations have been applied
Given that I _was_ able to make `--cloud-init` work when reporting #4395, I'm not sure under which conditions the instructions get ignored. I tried downloading the file locally and doing `--cloud-init ./cloud-init-charm-dev.yaml`, same effect.
I also tried adding `-vvvv` but didn't see anything relevant in the CLI logs. The server logs do show some weird things (see below).
**Expected behavior**
`--cloud-init` instructions should be used, or a warning given.
**Logs**
```
sep 29 11:37:28 bardor multipassd[3154]: fetch manifest periodically
sep 29 11:37:54 bardor multipassd[3154]: Loading "anbox-cloud-appliance" v1
sep 29 11:37:54 bardor multipassd[3154]: Loading "charm-dev" v1
sep 29 11:37:54 bardor multipassd[3154]: Loading "docker" v1
sep 29 11:37:54 bardor multipassd[3154]: Loading "jellyfin" v1
sep 29 11:37:54 bardor multipassd[3154]: Loading "minikube" v1
sep 29 11:37:54 bardor multipassd[3154]: Loading "ros2-humble" v1
sep 29 11:37:54 bardor multipassd[3154]: Loading "ros2-jazzy" v1
sep 29 11:37:54 bardor multipassd[3154]: [26182] started: qemu-system-x86_64 --version
sep 29 11:37:54 bardor multipassd[3154]: Saved file `/var/snap/multipass/common/data/multipassd/vault/multipassd-instance-image-records.json` successfully in attempt #1
sep 29 11:37:54 bardor multipassd[3154]: Saved file `/var/snap/multipass/common/cache/multipassd/vault/multipassd-image-records.json` successfully in attempt #1
sep 29 11:37:54 bardor multipassd[3154]: Applied AppArmor policy: multipass.qemu-img
sep 29 11:37:54 bardor multipassd[3154]: [26187] started: qemu-img info /var/snap/multipass/common/cache/multipassd/vault/images/noble-20250805/ubuntu-24.04-server-cloudimg-amd64.img
sep 29 11:37:54 bardor multipassd[3154]: Applied AppArmor policy: multipass.qemu-img
sep 29 11:37:54 bardor multipassd[3154]: [26196] started: qemu-img resize /var/snap/multipass/common/data/multipassd/vault/instances/charm-dev2/ubuntu-24.04-server-cloudimg-amd64.img 53687091200
sep 29 11:37:54 bardor multipassd[3154]: Applied AppArmor policy: multipass.qemu-img
sep 29 11:37:54 bardor multipassd[3154]: [26203] started: qemu-img snapshot -l /var/snap/multipass/common/data/multipassd/vault/instances/charm-dev2/ubuntu-24.04-server-cloudimg-amd64.img
sep 29 11:37:54 bardor multipassd[3154]: Saved file `/var/snap/multipass/common/data/multipassd/multipassd-vm-instances.json` successfully in attempt #1
sep 29 11:37:54 bardor multipassd[3154]: process working dir '/snap/multipass/15782/qemu'
sep 29 11:37:54 bardor multipassd[3154]: process program 'qemu-system-x86_64'
sep 29 11:37:54 bardor multipassd[3154]: process arguments '-bios, OVMF.fd, --enable-kvm, -cpu, host, -nic, tap,ifname=tap-5b62cd64d85,script=no,downscript=no,model=virtio-net-pci,mac=52:54:00:06:2d:e3, -device, virtio-scsi-pci,id=scsi0, -drive, file=/var/snap/multipass/common/data/multipassd/vault/instances/charm-dev2/ubuntu-24.04-server-cloudimg-amd64.img,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 2, -m, 4096M, -qmp, stdio, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /var/snap/multipass/common/data/multipassd/vault/instances/charm-dev2/cloud-init-config.iso'
sep 29 11:37:54 bardor multipassd[3154]: [26224] started: qemu-system-x86_64 -nographic -dump-vmstate /tmp/multipassd.vIyiAc
sep 29 11:37:54 bardor multipassd[3154]: Saved file `/var/snap/multipass/common/data/multipassd/multipassd-vm-instances.json` successfully in attempt #1
sep 29 11:37:54 bardor multipassd[3154]: Applied AppArmor policy: multipass.charm-dev2.qemu-system-x86_64
sep 29 11:37:54 bardor multipassd[3154]: process state changed to Starting
sep 29 11:37:54 bardor multipassd[3154]: process state changed to Running
sep 29 11:37:54 bardor multipassd[3154]: [26226] started: qemu-system-x86_64 -bios OVMF.fd --enable-kvm -cpu host -nic tap,ifname=tap-5b62cd64d85,script=no,downscript=no,model=virtio-net-pci,mac=52:54:00:06:2d:e3 -device virtio-scsi-pci,id=scsi0 -drive file=/var/snap/multipass/common/data/multipassd/vault/instances/charm-dev2/ubuntu-24.04-server-cloudimg-amd64.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 2 -m 4096M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /var/snap/multipass/common/data/multipassd/vault/instances/charm-dev2/cloud-init-config.iso
sep 29 11:37:54 bardor multipassd[3154]: process started
sep 29 11:37:54 bardor multipassd[3154]: Saved file `/var/snap/multipass/common/data/multipassd/multipassd-vm-instances.json` successfully in attempt #1
sep 29 11:37:54 bardor multipassd[3154]: Waiting for SSH to be up
sep 29 11:37:54 bardor multipassd[3154]: QMP: {"QMP": {"version": {"qemu": {"micro": 1, "minor": 2, "major": 8}, "package": ""}, "capabilities": ["oob"]}}
sep 29 11:37:54 bardor multipassd[3154]: QMP: {"return": {}}
sep 29 11:37:57 bardor multipassd[3154]: QMP: {"timestamp": {"seconds": 1759138677, "microseconds": 383282}, "event": "RTC_CHANGE", "data": {"offset": -1, "qom-path": "/machine/unattached/device[5]/rtc"}}
sep 29 11:37:58 bardor multipassd[3154]: QMP: {"timestamp": {"seconds": 1759138677, "microseconds": 442238}, "event": "RTC_CHANGE", "data": {"offset": -1, "qom-path": "/machine/unattached/device[5]/rtc"}}
sep 29 11:38:02 bardor multipassd[3154]: QMP: {"timestamp": {"seconds": 1759138682, "microseconds": 414195}, "event": "NIC_RX_FILTER_CHANGED", "data": {"path": "/machine/unattached/device[23]/virtio-backend"}}
sep 29 11:38:05 bardor dnsmasq-dhcp[3474]: DHCPDISCOVER(mpqemubr0) 52:54:00:06:2d:e3
sep 29 11:38:05 bardor dnsmasq-dhcp[3474]: DHCPOFFER(mpqemubr0) 10.87.209.210 52:54:00:06:2d:e3
sep 29 11:38:05 bardor dnsmasq-dhcp[3474]: DHCPREQUEST(mpqemubr0) 10.87.209.210 52:54:00:06:2d:e3
sep 29 11:38:05 bardor dnsmasq-dhcp[3474]: DHCPACK(mpqemubr0) 10.87.209.210 52:54:00:06:2d:e3 charm-dev2
sep 29 11:38:07 bardor multipassd[3154]: Saved file `/var/snap/multipass/common/data/multipassd/multipassd-vm-instances.json` successfully in attempt #1
sep 29 11:38:07 bardor multipassd[3154]: Caching initial SSH session
sep 29 11:38:07 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:07 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:08 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:08 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:09 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:09 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:10 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:10 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:11 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:11 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:12 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:12 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:13 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:13 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:14 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:14 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:15 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:15 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:16 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:16 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:17 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:17 bardor multipassd[3154]: failed to run '[ -e /var/lib/cloud/instance/boot-finished ]', error message: ''
sep 29 11:38:18 bardor multipassd[3154]: Executing '[ -e /var/lib/cloud/instance/boot-finished ]'
sep 29 11:38:18 bardor multipassd[3154]: Saved file `/var/snap/multipass/common/data/multipassd/multipassd-vm-instances.json` successfully in attempt #1
sep 29 11:38:36 bardor multipassd[3154]: QMP: {"timestamp": {"seconds": 1759138716, "microseconds": 498518}, "event": "RTC_CHANGE", "data": {"offset": 0, "qom-path": "/machine/unattached/device[5]/rtc"}}
```
**Additional info**
- OS: Ubuntu 25.04
- CPU architecture or model: amd64
```
$ multipass version
multipass 1.17.0-dev.458+g33e002d6
multipassd 1.17.0-dev.458+g33e002d6
$ multipass info
Name: charm-dev
State: Running
Snapshots: 0
IPv4: 10.87.209.209
Release: Ubuntu 24.04.3 LTS
Image hash: 834af9cd766d (Ubuntu 24.04 LTS)
CPU(s): 2
Load: 0.00 0.00 0.00
Disk usage: 1.9GiB out of 48.4GiB
Memory usage: 405.0MiB out of 3.8GiB
Mounts: --
Name: charm-dev2
State: Running
Snapshots: 0
IPv4: 10.87.209.210
Release: Ubuntu 24.04.3 LTS
Image hash: 834af9cd766d (Ubuntu 24.04 LTS)
CPU(s): 2
Load: 0.00 0.00 0.00
Disk usage: 1.9GiB out of 48.4GiB
Memory usage: 418.3MiB out of 3.8GiB
Mounts: --
Name: my-vm-ci3
State: Deleted
Snapshots: 0
IPv4: --
Release: --
Image hash: 834af9cd766d (Ubuntu 24.04 LTS)
CPU(s): --
Load: --
Disk usage: --
Memory usage: --
Mounts: --
Name: my-vm-ci4
State: Deleted
Snapshots: 0
IPv4: --
Release: --
Image hash: 834af9cd766d (Ubuntu 24.04 LTS)
CPU(s): --
Load: --
Disk usage: --
Memory usage: --
Mounts: --
$ multipass get local.driver
qemu
```
**Additional context**
N/A
Contributor guide
Research direction
Start by reproducing the documented `multipass launch` command with `--cloud-init`, using the referenced `cloud-init-charm-dev.yaml` file and the QEMU driver. Inspect the generated `cloud-init-config.iso` and the `/var/lib/cloud/instance/boot-finished` checks shown in the logs; done means the instructions are applied or the CLI reports why they were not.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100