canonical/open-documentation-academy

LXD: configure `cloud-init` from a file

Ouverte

#63 ouverte le 26 avr. 2024

 (6 commentaires) (0 réaction) (1 personne assignée)Python (99 forks)auto 404
good first issuehow-tosize 3

Métriques du dépôt

Stars
 (119 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Documentation: https://documentation.ubuntu.com/lxd/en/latest/ GitHub repo: https://github.com/canonical/lxd Contribution guide: https://documentation.ubuntu.com/lxd/en/latest/contributing/


To run some actions on an instance when it is started for the first time, you can use cloud-init. See How to use cloud-init in the LXD documentation.

The How to configure cloud-init section describes the format needed for the cloud-init configuration options, and how to configure it if you're using the API, but it's missing instructions for how to configure the options through the CLI.

You would usually do this by writing the configuration to a file (for example, cloud-init.yml) and then passing it in:

lxc config set <instance_name> cloud-init.user-data - < ~cloud-init.yml

This information should be added to the page.

Guide contributeur