Use IDE CDROM for cloud-init seed ISO instead of virtio-blk

Ubuntu cloud images use LABEL=cloudimg-rootfs to find the root disk,
which expects it to be the first virtio-blk device. Having the seed
ISO as a second virtio-blk device confused the boot order, causing
a kernel panic. Using IDE CDROM avoids this conflict.
This commit is contained in:
Till Wegmueller 2026-04-07 21:15:20 +02:00
parent 4c73599379
commit b9d31acfa9

View file

@ -265,16 +265,16 @@ impl Hypervisor for QemuBackend {
}
}
// Seed ISO (cloud-init)
// Seed ISO (cloud-init) — use IDE CDROM so it doesn't interfere with
// the root disk's virtio-blk device ordering (Ubuntu cloud images use
// LABEL=cloudimg-rootfs which expects the root disk as the first virtio device)
if let Some(ref iso) = vm.seed_iso_path {
args.extend([
"-drive".into(),
format!(
"file={},format=raw,if=none,id=seed,readonly=on",
"file={},format=raw,if=ide,media=cdrom,readonly=on",
iso.display()
),
"-device".into(),
"virtio-blk-pci,drive=seed".into(),
]);
}