Attempting to build 1.5.0 cloudinit from docs

I am trying to build a cloud-init version of 1.5.0.

So following this
https://docs.vyos.io/en/latest/automation/cloud-init.html#generate-qcow-image

I went and downloaded the rolling release of 1.5.0,

then built and ran a docker image with --privileged set ad described in the docs.

docker build --tag vyos-vm-images:latest -f ./Dockerfile .

docker run --rm -it --privileged -v $(pwd):/vm-build -v $(pwd)/images:/images -w /vm-build vyos-vm-images:latest bash

git clone https://github.com/vyos/vyos-vm-images.git && cd vyos-vm-images

I will note that vyos-vm-images is marked deprecated in gitlab with no note as to why in gitlab or the docs.

Attempting to run the command:
ansible-playbook qemu.yml -e disk_size=10 -e iso_local=/tmp/vyos-1.5-rolling-202409060006-generic-amd64.iso -e grub_console=serial -e vyos_version=1.5.0 -e cloud_init=true -e cloud_init_ds=NoCloud -e enable_ssh=true -e guest_agent=qemu

results in:

TASK [mount-iso : Mount squashfs image from ISO] ********************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error mounting /mnt/cdsquash: mount: /mnt/cdsquash: failed to setup loop device for /mnt/cdrom/live/filesystem.squashfs.\n"}

in the ansible logs. Is there a flag missing on the docker command, or some other requirement that I am missing?

Thanks!

Thanks for sharing, unfortunately this documentation is not updated, we introduced a new builder system which should be used to build iso image. here’s the explanation how it works:

only iso is available for the moment.

Thank for the reply,

The ISO only part is a bit confusing still, does that mean the entire “Image format” section isn’t valid?

I was initially planning on building a qcow2 so I could cloudinit, but could replace that by setting default_config in the build, maybe. Maybe I can convert afterwards as an additional step out of band?

I think I’m trying to do the same thing. I can get to the point of a qcow2 image with cloud-init installed, but it isn’t configured to use nocloud until I’ve booted the image and ran a “dpkg-reconfigure noninteractive cloud-init” and reset cloud-init. I gotten this far by creating a custom flavor containing the below:

image_format = "qcow2"

packages = ["qemu-guest-agent", "cloud-init"]

[[includes_chroot]]
path = "etc/cloud/cloud.cfg.d/90_dpkg.cfg"
data = "datasource_list: [ NoCloud ]"

The only part I don’t know how to do is dpkg-reconfigure in the build script once the confg file is there.