Note: this might be related to #1818197, but I'm not sure, so I'm opening another issue. Do not hesitate to mark as duplicate.
Using qemu-system-aarch64, with native kvm or with tcg on x86, it seems the default cloud images (I've tried with eoan and disco) take up to 148 seconds to finish booting (with kvm) or 590 seconds (with tcg). It's impossible to login before the end of this delay.
Here are traces from a qemu boot:
$ cloud-init analyze show
-- Boot Record 01 --
The total time elapsed since completing an event is printed after the "@" character.
The time the event takes is printed after the "+" character.
Starting stage: init-local
|`->no cache found @00.29600s +00.01200s
|`->found local data from DataSourceNoCloud @00.53200s +04.27000s
Finished stage: (init-local) 14.81700 seconds
Starting stage: init-network
|`->restored from cache with run check: DataSourceNoCloud [seed=/dev/sr0][dsmode=net] @69.94700s +00.32200s
|`->setting up datasource @73.46100s +00.01400s
|`->reading and applying user-data @73.95400s +00.23800s
|`->reading and applying vendor-data @74.19500s +00.00600s
|`->activating datasource @75.53100s +00.14900s
|`->config-migrator ran successfully @76.81200s +00.02200s
|`->config-seed_random ran successfully @76.84300s +00.03800s
|`->config-bootcmd ran successfully @76.89100s +00.00800s
|`->config-write-files ran successfully @76.90900s +00.03600s
|`->config-growpart ran successfully @76.95500s +03.55800s
|`->config-resizefs ran successfully @80.53200s +01.20400s
|`->config-disk_setup ran successfully @81.76300s +00.08000s
|`->config-mounts ran successfully @81.85700s +00.07600s
|`->config-set_hostname ran successfully @81.94600s +00.04900s
|`->config-update_hostname ran successfully @82.00500s +00.05300s
|`->config-update_etc_hosts ran successfully @82.06900s +00.01000s
|`->config-ca-certs ran successfully @82.08900s +00.03700s
|`->config-rsyslog ran successfully @82.13600s +00.03600s
|`->config-users-groups ran successfully @82.18200s +01.81000s
|`->config-ssh ran successfully @84.00900s +04.76000s
Finished stage: (init-network) 20.79900 seconds
Starting stage: modules-config
|`->config-emit_upstart ran successfully @468.99800s +00.01500s
|`->config-snap ran successfully @469.02500s +00.04000s
|`->config-snap_config ran successfully @469.07600s +00.03500s
|`->config-ssh-import-id ran successfully @469.12200s +00.04100s
|`->config-locale ran successfully @469.18300s +00.06300s
|`->config-set-passwords ran successfully @469.25800s +02.65100s
|`->config-grub-dpkg ran successfully @471.93200s +06.08300s
|`->config-apt-pipelining ran successfully @478.04600s +00.05200s
|`->config-apt-configure ran successfully @478.10900s +04.43300s
|`->config-ubuntu-advantage ran successfully @482.59600s +00.09700s
|`->config-ntp ran successfully @482.70600s +00.03700s
|`->config-timezone ran successfully @482.75400s +00.03500s
|`->config-disable-ec2-metadata ran successfully @482.80100s +00.01400s
|`->config-runcmd ran successfully @482.82700s +00.03400s
|`->config-byobu ran successfully @482.87400s +00.03700s
Finished stage: (modules-config) 14.58300 seconds
Starting stage: modules-final
|`->config-snappy ran successfully @504.88200s +00.07500s
|`->config-package-update-upgrade-install ran successfully @504.96700s +00.03100s
|`->config-fan ran successfully @505.00900s +00.03600s
|`->config-landscape ran successfully @505.05600s +00.03000s
|`->config-lxd ran successfully @505.09600s +00.03300s
|`->config-ubuntu-drivers ran successfully @505.14000s +00.03300s
|`->config-puppet ran successfully @505.18300s +00.03300s
|`->config-chef ran successfully @505.22600s +00.03500s
|`->config-mcollective ran successfully @505.27100s +00.03300s
|`->config-salt-minion ran successfully @505.31500s +00.03200s
|`->config-rightscale_userdata ran successfully @505.35800s +00.03200s
|`->config-scripts-vendor ran successfully @505.40100s +00.03100s
|`->config-scripts-per-once ran successfully @505.44300s +00.03300s
|`->config-scripts-per-boot ran successfully @505.48700s +00.00900s
|`->config-scripts-per-instance ran successfully @505.50600s +00.03600s
|`->config-scripts-user ran successfully @505.55400s +00.03200s
|`->config-ssh-authkey-fingerprints ran successfully @505.59600s +00.11900s
|`->config-keys-to-console ran successfully @505.72600s +01.57500s
|`->config-phone-home ran successfully @507.33000s +00.05500s
|`->config-final-message ran successfully @507.39600s +00.21700s
|`->config-power-state-change ran successfully @507.62300s +00.03200s
Finished stage: (modules-final) 03.40900 seconds
Note: this might be related to #1818197, but I'm not sure, so I'm opening another issue. Do not hesitate to mark as duplicate.
Using qemu-system- aarch64, with native kvm or with tcg on x86, it seems the default cloud images (I've tried with eoan and disco) take up to 148 seconds to finish booting (with kvm) or 590 seconds (with tcg). It's impossible to login before the end of this delay.
Here are traces from a qemu boot:
$ cloud-init analyze show
-- Boot Record 01 --
The total time elapsed since completing an event is printed after the "@" character.
The time the event takes is printed after the "+" character.
Starting stage: init-local
|`->no cache found @00.29600s +00.01200s
|`->found local data from DataSourceNoCloud @00.53200s +04.27000s
Finished stage: (init-local) 14.81700 seconds
Starting stage: init-network dev/sr0] [dsmode= net] @69.94700s +00.32200s seed_random ran successfully @76.84300s +00.03800s write-files ran successfully @76.90900s +00.03600s disk_setup ran successfully @81.76300s +00.08000s set_hostname ran successfully @81.94600s +00.04900s update_ hostname ran successfully @82.00500s +00.05300s update_ etc_hosts ran successfully @82.06900s +00.01000s users-groups ran successfully @82.18200s +01.81000s
|`->restored from cache with run check: DataSourceNoCloud [seed=/
|`->setting up datasource @73.46100s +00.01400s
|`->reading and applying user-data @73.95400s +00.23800s
|`->reading and applying vendor-data @74.19500s +00.00600s
|`->activating datasource @75.53100s +00.14900s
|`->config-migrator ran successfully @76.81200s +00.02200s
|`->config-
|`->config-bootcmd ran successfully @76.89100s +00.00800s
|`->config-
|`->config-growpart ran successfully @76.95500s +03.55800s
|`->config-resizefs ran successfully @80.53200s +01.20400s
|`->config-
|`->config-mounts ran successfully @81.85700s +00.07600s
|`->config-
|`->config-
|`->config-
|`->config-ca-certs ran successfully @82.08900s +00.03700s
|`->config-rsyslog ran successfully @82.13600s +00.03600s
|`->config-
|`->config-ssh ran successfully @84.00900s +04.76000s
Finished stage: (init-network) 20.79900 seconds
Starting stage: modules-config emit_upstart ran successfully @468.99800s +00.01500s snap_config ran successfully @469.07600s +00.03500s ssh-import- id ran successfully @469.12200s +00.04100s set-passwords ran successfully @469.25800s +02.65100s grub-dpkg ran successfully @471.93200s +06.08300s apt-pipelining ran successfully @478.04600s +00.05200s apt-configure ran successfully @478.10900s +04.43300s ubuntu- advantage ran successfully @482.59600s +00.09700s disable- ec2-metadata ran successfully @482.80100s +00.01400s
|`->config-
|`->config-snap ran successfully @469.02500s +00.04000s
|`->config-
|`->config-
|`->config-locale ran successfully @469.18300s +00.06300s
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-ntp ran successfully @482.70600s +00.03700s
|`->config-timezone ran successfully @482.75400s +00.03500s
|`->config-
|`->config-runcmd ran successfully @482.82700s +00.03400s
|`->config-byobu ran successfully @482.87400s +00.03700s
Finished stage: (modules-config) 14.58300 seconds
Starting stage: modules-final package- update- upgrade- install ran successfully @504.96700s +00.03100s landscape ran successfully @505.05600s +00.03000s ubuntu- drivers ran successfully @505.14000s +00.03300s mcollective ran successfully @505.27100s +00.03300s salt-minion ran successfully @505.31500s +00.03200s rightscale_ userdata ran successfully @505.35800s +00.03200s scripts- vendor ran successfully @505.40100s +00.03100s scripts- per-once ran successfully @505.44300s +00.03300s scripts- per-boot ran successfully @505.48700s +00.00900s scripts- per-instance ran successfully @505.50600s +00.03600s scripts- user ran successfully @505.55400s +00.03200s ssh-authkey- fingerprints ran successfully @505.59600s +00.11900s keys-to- console ran successfully @505.72600s +01.57500s phone-home ran successfully @507.33000s +00.05500s final-message ran successfully @507.39600s +00.21700s power-state- change ran successfully @507.62300s +00.03200s
|`->config-snappy ran successfully @504.88200s +00.07500s
|`->config-
|`->config-fan ran successfully @505.00900s +00.03600s
|`->config-
|`->config-lxd ran successfully @505.09600s +00.03300s
|`->config-
|`->config-puppet ran successfully @505.18300s +00.03300s
|`->config-chef ran successfully @505.22600s +00.03500s
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
|`->config-
Finished stage: (modules-final) 03.40900 seconds
Total Time: 53.60800 seconds
1 boot records analyzed
$ systemd-analyze blame service udev-settle. service local.service service dispatcher. service logind. service daemon. service udev-trigger. service resolved. service journald. service timesyncd. service setup.service activate. service networkd. service fallback. service
5min 32.717s snapd.seeded.
1min 18.889s dev-vda1.device
1min 3.376s systemd-
52.841s cloud-init.service
47.654s cloud-init-
36.746s cloud-config.
30.937s apparmor.service
28.002s pollinate.service
24.492s cloud-final.service
19.029s networkd-
16.215s systemd-
15.985s accounts-
15.590s systemd-
12.687s apport.service
11.720s systemd-
11.424s systemd-
11.007s grub-common.service
10.479s systemd-
10.285s rsyslog.service
9.391s keyboard-
9.139s snap.lxd.
5.782s systemd-
4.268s grub-initrd-
It might be related to snapd since it's the one that takes 5min+ in my case.
How to reproduce ?
The script below should be enough to reproduce the issue:
#!/bin/bash
# supposes you have installed qemu-efi-aarch64, qemu-system-arm and genisoimage
set -euo pipefail
IMG=eoan- server- cloudimg- arm64.img ./cloudinit. iso
CLOUDINIT=
wget -O "$IMG" https:/ /cloud- images. ubuntu. com/eoan/ current/ eoan-server- cloudimg- arm64.img config\ nsystem_ info:\n default_user:\n name: qemu\npassword: qemu\nchpasswd: { expire: False }\nssh_pwauth: True\n' > user-data
echo -e '#cloud-
echo "local-hostname: qemu-machine" > meta-data
genisoimage -quiet -input-charset utf-8 -output "$CLOUDINIT" -volid cidata -joliet -rock user-data meta-data
rm -f user-data meta-data
qemu-system-aarch64 -machine virt -m 768 -cpu cortex-a72 -smp 2 -accel tcg,thread=multi -nographic -nodefaults \ qemu-efi- aarch64/ QEMU_EFI. fd \ 0,media= disk,id= disk0,if= none,file= $IMG" -device virtio- blk,drive= disk0 \ scsi-pci, id=scsi0 -drive "file=$ CLOUDINIT, if=none, driver= raw,readonly= on,id=cdrom1" -device scsi-cd, bus=scsi0. 0,drive= cdrom1 \
-bios /usr/share/
-drive "index=
-device virtio-
-serial mon:stdio