[OpenIndiana-discuss] OI-hipster-cloudimage 2024.04 cloud-init userscripts not executed
Till Wegmueller
toasterson at gmail.com
Tue Dec 24 00:07:20 UTC 2024
Moin Michael
Your signature gives your locality away a bit so I allow myself to
welcome a fellow European. Good to see the German community grow.
As to your questions about metadata-agent (specifically my fork) it may
be that you are hitting the parts I or Josh did not yet implement or
ones that did not end up in my fork.
Metadata agent is cloud-init compatible but not fully. I will have to
look into what parts I have never needed to get working and what parts
of your config work already.
How are you packing the ISO for the agent? We have some automation in
bHyve/ Shellscripts that I can dig up for you if you are flexible there.
Otherwise If you tell me what the build method for the ISO is I can
check on a local setup on my side to make that work.
It will take me a couple of days to look into the code over Christmas.
Would it work for you to only setup growpart and ssh via metadata agent
for now and use ansible for the rest? I have attached my VM build
shellscript which builds a cloud-init that does only ssh, growpart and
networking. It's intended to run on the host OpenIndiana machine and
builds a clean new VM. From line 70 you can see the here documents to
generate the configs and the mkisofs invocation to make them into an ISO
file.
Hope this helps.
If you would like to make your cloud-config setup work the way you want
feel free to add the features to metadata agent. I would love to have
someone contribute there :)
-Till <Toasterson>
On 23.12.24 20:20, Michael Brüning via openindiana-discuss wrote:
> Hi, i am new to this list and to OpenIndiana, hope this is the right
> place to ask..
>
> I have problems getting the cloud-init userscripts to work, while
> network and user configuration (ssh-key,..) work well.
>
> My environment: OpenIndiana Hipster 2024.04 Version illumos-eac40bb377
> 64-bit running under Ubuntu/Libvirt, setup via ansible.
>
> User data file:
> ---------------------------------
> #cloud-config
> chpasswd: { expire: false }
> ssh_pwauth: true
>
> users:
> - name: root
> ssh_authorized_keys:
> - "{{ VM_ADM_SSH_KEY }}"
>
> #package_update: true
> #package_upgrade: true
>
> growpart:
> mode: auto
> devices: ['/']
>
> # run on every boot
> bootcmd:
> - echo "runboot done" >>/var/log/cloud-init-output.log
>
> # run once for setup
> runcmd:
> - echo "runonce done" >>/var/log/cloud-init-output.log
> ---------------------------------
>
> Looking at the code i assume a file "/var/metadata/userscript" should be
> generated on the first run, but that script does not exist. Maybe
> someone can share a working setup to clarify my understanding of the
> workflow?
>
>
> In addition, i found a typo regading the option "runcmd", but i'm pretty
> sure that this is not causing my issue.
> (from:
> https://github.com/Toasterson/metadata-agent/blob/master/src/userdata/cloudconfig.rs: "pub runcms: Option<Multiformat>," not: runcmd)
>
> root at vmoi02:~# strings /usr/lib/useragent | grep runcmd
> root at vmoi02:~#
> root at vmoi02:~# strings /usr/lib/useragent | grep runcms
> /jenkins/jobs/oi-userland/workspace/components/developer/rust/rustc-1.77.2-src/library/alloc/src/slice.rsCloudConfiggroupsuserswrite_filesca-certspackagesgrowpartssh_keysinactiveencodingbootcmdruncmsfinal_message
> [... output shortened]
>
> root at vmoi02:~# strings /usr/lib/useragent | grep bootcmd
> /jenkins/jobs/oi-userland/workspace/components/developer/rust/rustc-1.77.2-src/library/alloc/src/slice.rsCloudConfiggroupsuserswrite_filesca-certspackagesgrowpartssh_keysinactiveencodingbootcmdruncmsfinal_message
> [... output shortened]
>
> Thanks in advance for any advice!
> Greetings, Michael
>
>
>
>
More information about the openindiana-discuss
mailing list