Tinycloud initialization

,

Hello,

I have notice that alpine have a “tinycloud” version. I would like to use them but I am unable to insert “user-data”.

I have configured my VM with “cloud-init.user-data”, but it does not work, probably because Incus see the image as not compatible.

How am I suppose to insert the user-data file before the boot ?

Note that I use a VM and not a container.
Also if, after the boot, I manually add the file in user data and run tinycloud manually, it works.

I came across this, looking to try out the “tinycloud” variant. I first was looking a using a container. It seems tiny cloud looks for the user-data using a socket provided by incus. https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud/-/blob/main/lib/tiny-cloud/cloud/incus/imds?ref_type=heads It’s looking for a config called “user.user-data” so if you change “cloud-init.user-data” to “user.user-data” I suspect it will find it then.

I’ve only just begun looking at this so I’m not sure what other changes will be needed.

Edit: additionally it seems that tiny-cloud need /dev/incus/sock which is provided by the incus-agent inside of the VM. At first this was’t working for me because I use alpinelinux as my host server OS and I didn’t have the linux incus-agent available for the vm. After downloading the incus-agent for the host side agents dir export INCUS_AGENT_PATH=/opt/incus/agents in my case. the agent started up in the VM and /dev/incus/sock appeared.

After more testing it seems incus-agent in the VM starts at runlevel default and starts too late for tiny-cloud and tiny-cloud is still not picking up on the user-data.

Hello dazoe,
I’m using the Incus Terraform provider with my own custom Fedora image, cloud-init, and VMs.

I’ve written a blog article that explains how to do this. I’m not saying you have to use terraform, but you might want to look at my article, as it explains how to create a cloud-init config-drive for the VM:

 device {
    name = "cidata"
    type = "disk"
    properties = {
      source = "cloud-init:config"
    }

Requirements:

  1. Your VM has a disk that complies with the cloud-init NoCloud requirements
  2. The disk has valid cloud-init user-data
  3. Your VM image is cloud-init compatible

As long as you meet those requirements, Incus will have no problem supporting cloud-init.