Re: cloud init documentation ?

From: mike tancsa <mike_at_sentex.net>
Date: Fri, 26 Jul 2024 13:38:51 UTC
On 7/25/2024 6:57 PM, Dave Cottlehuber wrote:
> On Wed, 24 Jul 2024, at 19:08, mike tancsa wrote:
>> I gave the cloud-init image a spin, but beyond adding some users, I am
>> not able to get packages added or even runcmd or bootcmd to execute.
>> This is using the FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw
>> image from the FreeBSD download directory.  Where can I find
>> documentation on what is supported ?
>>
>> Is there also a way to test the config beyond deploying and seeing if it
>> works or not ?
>>
>>       ---Mike
> hi Mike
>
> support, with upstream.
>
> We should actively support nuageinit (merci bapt@) in FreeBSD src, which
> is missing the following features used above:
>
> - bootcmd (early cmd)
> - runcmd (late cmd)
> - packages
> - write_files
> - fetching metadata from e.g. http://169.254.169.254/ style urls
>
> [nuageinit]: https://cgit.freebsd.org/src/commit/?id=16a6da44e28d
> [cloudinit]: https://github.com/canonical/cloud-init/issues?q=freebsd


Hi Dave,

     Thanks for the detailed response and information!  I think where I 
run afoul is what has and what does not have CI support. What I have 
done so far is grab

https://download.freebsd.org/releases/VM-IMAGES/14.1-RELEASE/amd64/Latest/FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw.xz

Create the files  user-data and meta-data
#cloud-config
users:
   - name: root
     lock_passwd: false
     hashed_passwd: $6$fhi6IHG7nlYk....
     ssh_pwauth: true
   - name: mike
     lock_passwd: true
     ssh_authorized_keys:
       - ssh-rsa AAAAB3NzaC1....
     groups: wheel
   - name: alice
     lock_passwd: true
     passwd: "\*"
     ssh_authorized_keys:
       - ssh-rsa AAAAB3NzaC1yc2E....
     groups: wheel

bootcmd:
   - service pf enable

and meta-data

instance-id: freebsd
local-hostname: miketestbox


Then create  the seed.iso
genisoimage -output ./seed.iso -volid cidata -joliet -rock 
.cloud-init/meta-data .cloud-init/user-data

and then run
./vmrun.sh -t tap0 -d FreeBSD-14.1-RELEASE-amd64-BASIC-CLOUDINIT-zfs.raw 
-i -E -I ./seed.iso -H vm0/host vm0

The lock_passwd does not seem to work, but the passwd: value for alice 
works well enough.  But I guess thats where my confusion is. I am making 
use of nuageinit and not cloudinit here it seems.

I guess the step I am missing is download the FreeBSD VM image file. Do 
*something* to it to make it fully cloudinit capable, and then create my 
full seed.iso file.  What is that something ?  Is that the 
net/clould-init package you mention in 
https://people.freebsd.org/~dch/posts/2024-07-25-cloudinit/ ?

     ---Mike