Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jul 2024 09:38:51 -0400
From:      mike tancsa <mike@sentex.net>
To:        Dave Cottlehuber <dch@skunkwerks.at>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: cloud init documentation ?
Message-ID:  <3a161d6a-8941-4eb9-a532-1f82d3db99f9@sentex.net>
In-Reply-To: <841999d9-7e4a-41c1-93b9-c927f28ed41a@app.fastmail.com>
References:  <fb2f4ea3-7c05-43f6-9f9c-af93c4aa54a9@sentex.net> <841999d9-7e4a-41c1-93b9-c927f28ed41a@app.fastmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3a161d6a-8941-4eb9-a532-1f82d3db99f9>