Comment 1 for bug 1940791

Revision history for this message
John Chittum (jchittum) wrote : Re: sr0 not available causes cloud-init.target not run on focal cloud image

Could you provide exact reproduction steps with virt-install and libvirt. I am attempting to reproduce locally with setups we normally use for testing, and am unable to:

1. downloaded image from https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-disk-kvm.img
2. created a simple cloud-init yaml file:

#cloud-config
password: <INSERT PASSWORD HERE>
chpasswd: { expire: False }
ssh_pwauth: True
ssh_import_id: jchittum
sudo: ALL=(ALL) NOPASSWD:ALL

3. using `cloud-localds` from `cloud-image-utils`, made an ISO of the cloud-config
cloud-localds cloud_init_with_pass.iso cloud-init.yaml

3. used qemu to test the image:

qemu-system-x86_64 \
  -cpu host -machine type=q35,accel=kvm -m 2048 \
  -nographic \
  -snapshot \
  -netdev id=net00,type=user,hostfwd=tcp::2222-:22 \
  -device virtio-net-pci,netdev=net00 \
  -drive if=virtio,format=qcow2,file=focal-server-cloudimg-amd64-disk-kvm.img \
  -drive if=virtio,format=raw,file=cloud_init_with_pass.iso

This qemu command sets the accel to kvm, and i had no issues. I'm guessing that the drive setup is very different though.

From my working knowledge of libvirt and cloud-init, you do need to mount the cloud-init image in a specific place, and I don't think there would be an issue, generally, with the kvm image not getting sr0 up fast enough. `qemu` is mounting to the same place in that command.

Could you provide the libvirt XML definition and exact reproduction steps for us to dig a little deeper?