Score:0

Cloud-init for ubuntu-20.04-server-cloudimg works but not ubuntu-20.04-minimal-cloudimg-amd64

vn flag

So I'm trying to use cloud-init with minimal image ( https://cloud-images.ubuntu.com/minimal/releases/focal/release/ubuntu-20.04-minimal-cloudimg-amd64.img ) but it does not seem to work at all. The exact same procedure works with the server image ( https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64.img ).

I'm using with meta-data and user-data with genisoimage -output cloud-init.iso -volid cidata -joliet -rock meta-data user-data.

I then boot it up with virt-install --connect qemu:///system --virt-type kvm --os-type linux --os-variant ubuntu20.04 --disk path=image.qcow2,bus=scsi,format=qcow2 --disk path=cloud-init.iso,device=cdrom --controller type=scsi,model=virtio-scsi --import --network network:default

In user-data I try to debug it with just using runcmd in user-data to touch /debug but when booting it up manually afterwards to investigate there is no such file so runcmd doesn't seem to run at all. Keep in mind that the exact same procedure works fine with the server-cloudimg.Running dpkg -l on the minimal image shows the cloud-init package being installed.

user-data

#cloud-config
runcmd:
 - touch /debug

meta-data

instance-id: iid-0
sa flag
Does `cloud-init status` mention any errors? Does `cloud-init query userdata` show the userdata you passed to it? Is there a `Traceback` or `WARN` in /var/log/cloud-init.log?
Andrew avatar
vn flag
So the problem seems to be that ubuntu minimal doesnt support cdrom so I used netboot `-smbios type=1,serial=ds=nocloud-net;s=http://10.10.0.1:8000/` instead and it works when i have a dhcp server but when I try to set it up with a static ip instead it doesnt work. I've tried passing a ip to the bootloader as described in https://askubuntu.com/questions/1360674/assign-ip-to-ubuntu-20-04-during-installation-packer-cloud-init-context but no success.
Shevchuk avatar
pl flag
@Andrew Have you figured it out? I believe I have the same issue on `ubuntu-22.04-minimal-cloudimg-amd64.img`
Rino Bino avatar
us flag
Having a somewhat similar issue if anyone can help: https://askubuntu.com/questions/1428184/cannot-login-to-ubuntu-cloud-image-20-04-on-qemu-neither-console-nor-ssh
Score:0
dj flag

In case someone stumble the same problem.

Comment by Andrew is correct. however we can still boot the system for ip assignment.

  • create cidata.iso

    mkisofs -o cidata.iso -V cidata -J -r user-data meta-data

  • create vm.

    sudo virt-install
    --import
    --connect qemu:///system
    --name test
    --ram $MEM
    --vcpus $CPU
    --disk path=/kvm/test.qcow2,size=10
    --disk cidata.iso
    --os-type linux
    --os-variant ubuntu22.04
    --network bridge:virbr0,model=virtio
    --graphics none
    --noautoconsole

in case want to still try netboot. run python3 -m http.server from the folder with user-data & meta-data then append to virt-install cmd.

--sysinfo type=smbios,system_serial=ds=nocloud-net;s=http://_gateway:8000/ //for network boot.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.