Skip to content

Commit

Permalink
doc: add cloud-init section
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Stocchi authored and Luca Stocchi committed Oct 11, 2024
1 parent 97ae249 commit c4b4863
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,3 +460,33 @@ Proper use of this flag may look similar to the following section of a command:
```bash
--device virtio-input,keyboard --device virtio-input,pointing --device virtio-gpu,width=1920,height=1080 --gui
```

## Cloud-init

#### Description

The `-device cloud-init` option allows to supply an initial configuration which will be used by cloud-init to apply those settings when the instance is created.
This option adds a disk to the virtual machine. The disk is backed by an image file on the host machine. This file is a ISO image file.

The ISO image file must be labelled CIDATA and it must contain the user-data and meta-data files that will be used to modify the VM image on first boot.
It is also possible to add further configurations by using the network-config and vendor-data files.
See https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html#runtime-configurations for more details.

To create the ISO image you could use this command within a folder containing the user-data and meta-data files
```
mkisofs -output seed.img -volid cidata -rock {user-data,meta-data}
```

See https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html#example-creating-a-disk for further details about how to create a disk image

#### Arguments
- `path`: the absolute path to the disk image file.

#### Example

This adds cloud-init configuration to the guest:
```
--device cloud-init,path=seed.img
```

The `seed.img` file can be created with the tool/command above or any other equivalent tool/command.

0 comments on commit c4b4863

Please sign in to comment.