rancher / os

Tiny Linux distro that runs the entire OS as Docker containers
https://rancher.com/docs/os/v1.x/en/
Apache License 2.0
6.45k stars 656 forks source link

Cloud-init support for ProxmoxVE #2938

Closed etrexel closed 4 years ago

etrexel commented 4 years ago

RancherOS Version: (ros os version) 1.5.4 Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) KVM on ProxmoxVE host.

I just recently found this project and want to use it on VMs under ProxmoxVE (PVE). I can successfully run the containers that are specifically built for PVE, but there doesn't seem to be a datasource for cloud-init that picks up the cloud-config YAML file the way that PVE makes it available to the VM.

I wanted to take a crack at implementing this support so I am making this ticket to track that effort (and/or get other's input if there is something already in the works).

PVE allows users to attach the cloud-init data as an IDE, SATA, or SCSI drive. After attaching this drive to the VM, the VM can then mount it and retrieve the data.

This requires adding the following logic:

  1. Determining on boot if RancherOS is running under PVE.
  2. Determining where the user has attached the cloud-init data.
  3. Reading the cloud-init data from the PVE source into the proper structs to be used by cloud-init.

The user can add clout-init data through the PVE web GUI, but can also add it through the PVE command line as a custom snippet. It would be nice to support both, but I am targeting the snippet for now as this allows more options than are exposed via the web GUI.

discordier commented 4 years ago

For reference and fellow people coming here via google. The PR was #2943.