Understanding the "BASIC-CLOUDINIT" Images

Hello everyone,

As stated in the title, I'm trying to understand the "BASIC-CLOUDINIT" images offered by FreeBSD here: https://download.freebsd.org/releases/VM-IMAGES/14.1-RELEASE/amd64/Latest/ (specifically the one labeled "FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.qcow2.xz")

My biggest point of confusion is that cloud-init doesn't actually appear to be installed by default on these images (and thus they won't actually run any cloud-init scripts). I've found some others that referencing it too. For context on why I find this confusing: I'm coming from the Linux side and I'm used to being able to download a cloud image and immediately have it work with cloud-init.

Additionally, I don't see any documentation about this on either official mentions of cloud-init. The 2023 post references the first steps in supporting cloud-init, and the 2024 post is about improvements to the code. If I use the search function on the "Documentation" page, there's no results for either "cloud-init" or "cloudinit".

So my questions:
  • Is there a different, official image that does support cloud-init out of the box?
  • If so, is there a reason why that one isn't as clearly labeled or pointed to?
  • If not, why aren't the images labeled with "BASIC-CLOUDINIT" set up to allow cloud-init by default? I thought that was their purpose.
 
Let me second your confusion.

Someone suggested that I try "nuage-init" but the documentation for that seems equally sparse. From what I've found:
  • it's a subset of "cloud-init"
  • it may be baked-in to some of the images (maybe all?)
  • I have not yet found anything to indicate what is supported from cloud-init and what is not
I'll follow-up here if I'm able to find anything on either cloud-init or nuage-init.
 
I'm posting here to aid anybody who spent hours of searching and reading forum posts, as I have, trying to figure out how to do the cloud-init dance with the FreeBSD VM BASIC-CLOUDINIT images. I could find no easily discoverable documentation on how to use these images, but it is in fact quite simple. These images use a tool called nuageinit(7). This tool works like cloud-init in that it can pull configuration from an ISO image or SMBIOS, and it supports a subset of the cloud-config metadata keys that cloud-init uses. It also logs its successes and failures to /var/log/nuageinit.log.

🖖Deploy in peace, my friends.
 
Just to add a bit more helpful information, here's a workflow I just tested:
  1. Create a FAT disk image with a label of 'cidata'
  2. Copy meta-data and user-data files to the image (see nuageinit(7))
  3. Add the image as a virtual disk to your VM
  4. Reboot the FreeBSD VM guest, if required
I'm not going to try to go into detail on all of these, but here's some sample commands. This uses GNU mtools, most certainly available in the package repository of your preferred BSD or Linux distro.

Create a FAT image FreeBSD-style
sh:
newfs_msdos -C 1M -L cidata cidata.img
or
Create a FAT image Linux-style
sh:
dd if=/dev/zero of=cidata.img count=1 bs=1M
mkfs.vfat -n cidata ./nocloud.img
then
Copy configuration files to the image
sh:
mcopy -i cidata.img meta-data ::
mcopy -i cidata.img user-data ::

Consult your VM hypervisor manual for instructions on adding a disk image. For testing, try running service nuageinit start. To get back that fresh, newly-installed feeling, use touch /firstboot.

🪓Happy hacking!☺️
 
Back
Top