cloud-init very slow to set password on arm64 cloud image
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
New
|
Undecided
|
Unassigned |
Bug Description
Note: this might be related to bug #1818197, but I'm not sure, so I'm opening another issue. Do not hesitate to mark as duplicate.
Using qemu-system-
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=/
|`->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
|`->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
|`->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
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-
CLOUDINIT=
wget -O "$IMG" https:/
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 \
-bios /usr/share/
-drive "index=
-device virtio-
-serial mon:stdio
description: | updated |
To clarify, login is impossible, *by password*. Setting an ssh key works, but login by password requires waiting for the end of the delay.