virt-install of focal-server-cloudimg-amd64.img panics on first boot, breaking cloud-init
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
VMBuilder |
New
|
Undecided
|
Unassigned | ||
grub2 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
virt-manager (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Various Focal cloudimg builds panic on first time ever booting with "Cannot open root device" when booting with virt-install (libvirt). After panicing, it reboots, and the second boot succeeds (using initrd on the second try). However, it needs to succeed on the first try without a panic. This breaks the cloud-init NoCloud process which expects the first time booting to succeed.
E.g.
https:/
Here is the failed output:
[ 0.000000] Linux version 5.4.0-24-generic (buildd@
[ 0.000000] Command line: BOOT_IMAGE=
...
[ 1.043162] VFS: Cannot open root device "PARTUUID=
[ 1.045238] Please append a correct "root=" boot option; here are the available partitions:
[ 1.046921] 0b00 1048575 sr0
[ 1.046922] driver: sr
[ 1.048215] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 1.049795] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.4.0-24-generic #28-Ubuntu
[ 1.051189] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-
[ 1.052904] Call Trace:
[ 1.053459] dump_stack+
[ 1.054158] panic+0x101/0x2e3
[ 1.054812] mount_block_
[ 1.055645] mount_root+
[ 1.056319] prepare_
[ 1.057236] kernel_
[ 1.058131] ? rest_init+0xb0/0xb0
[ 1.058834] kernel_
[ 1.059535] ret_from_
[ 1.060327] Kernel Offset: 0x1f800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000
When booted, the second time, it works!
The issue appears to be that cloudimg's kernel doesn't come with the necessary drivers pre-compiled into the kernel on a KVM/QEMU system. And, combined with a recent (2019) change to /boot/grub/grub.cfg which doesn't load initrd on the first boot, this ensures that the first time booting will fail.
Relevant section of /boot/grub/
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
if [ x$feature_
search --no-floppy --fs-uuid --set=root aca11948-
else
search --no-floppy --fs-uuid --set=root aca11948-
fi
if [ "${initrdfail}" = 1 ]; then
linux /boot/vmlinuz-
initrd /boot/initrd.
else
linux /boot/vmlinuz-
fi
initrdfail
}
summary: |
- focal-server-cloudimg-amd64.img panics on first boot, cannot open root - device + virt-install of focal-server-cloudimg-amd64.img panics on first boot, + breaking cloud-init |
description: | updated |
description: | updated |
description: | updated |
Discussing here: https:/ /bugs.launchpad .net/ubuntu/ +source/ linux-azure/ +bug/1870189