rancher / elemental-toolkit

:snowflake: The toolkit to build, ship and maintain cloud-init driven Linux derivatives based on container images
https://rancher.github.io/elemental-toolkit/docs/
Apache License 2.0
282 stars 49 forks source link

Toolkit built images don't consume cloud-init files named "meta-data" from the cd-rom provider #2125

Open robertwbl opened 2 weeks ago

robertwbl commented 2 weeks ago

Is your feature request related to a problem? Please describe. Harvester puts both user-data & meta-data files containing cloud-init config into the cloud-init drive that gets attached to VMIs (line 587-588 of cloud-init.go). user-data contains the cloud config that users specify when creating VMs, and meta-data contains instance data generated by Harvester (this is invisible to the user) such as the instance ID and machine name, which is exactly what I’m looking for in this use case. In my testing this meta-data cloud-init “data source” gets consumed correctly by other OSes such as the Tumbleweed cloud image, setting it’s hostname to whatever the VM name is in Harvester, so I thought I could simply point an Elemental derived OS at this config and be fine, except looking at the cd-rom provider in the elemental-toolkit this is hard coded to only look at files called “user-data” or “config”. I can therefore point to the cloud-init drive attached to the VM, but not the specific file within.

Describe the solution you'd like Would there be appetite for adding “meta-data” to this list of strings given this seems to be a standard file name for cloud-init systems, or a more generic solution such as providing a mechanism for also specifying a path with the cd-rom provider?

Describe alternatives you've considered Manually setting the hostname of Elemental VMs

Additional context Slack thread: https://rancher-users.slack.com/archives/C028DVCAYLD/p1719215874515729