Skip to content

Make ubuntu cloud images work with zvols#541

Open
dfberlin wants to merge 1 commit intochurchers:masterfrom
dfberlin:zvol-cloud-img-fix
Open

Make ubuntu cloud images work with zvols#541
dfberlin wants to merge 1 commit intochurchers:masterfrom
dfberlin:zvol-cloud-img-fix

Conversation

@dfberlin
Copy link

@dfberlin dfberlin commented Jan 6, 2024

Version 1.5 as in the FreeBSD packages fails to import a Ubuntu 22.04 Cloud image - and most likely others.

sudo vm img
DATASTORE           FILENAME
default             jammy-server-cloudimg-amd64-disk-kvm.img

cat /bhyve/vm/.templates/cloud-zvol-ubuntu.conf 
loader="uefi"
cpu=1
memory=1G
network0_type="virtio-net"
network0_switch="public"
disk0_name="disk0"
disk0_dev="sparse-zvol"
disk0_type="virtio-blk"

The following command lead to an error by qemu-img dd -> device busy.

sudo vm create -t cloud-zvol-ubuntu -s 6G -i jammy-server-cloudimg-amd64-disk-kvm.img -C -n "ip=192.168.xxx.yyy/24;gateway=192.168.xxx.yyy;nameservers=192.168.xxx.yyy" -k ~/falpi_df_id_rsa.pub showcase1

The changes I made repeat the qemu-img command for up to 30 times with a 1 second sleep to allow the zvol to come up and be actually ready to be written on.
Additionally the hard coded disk type in core::create_cloud_init has been changed to virtio-blk, since at least the Ubuntu cloud images require this to have cloud init working.

This is my first ever pull request - so in case there is something wrong, just let me know ;)

Greetings,
Dirk

…a device busy error previously. core::create_cloud_init(): Canged device type to virtio-blk to enable Ubuntu cloud images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant