Cloud-init
The Anapaya appliance supports cloud-init to customize the appliance during the initial launch process. This page explains how cloud-init integrates with the Anapaya appliance and provides configuration examples.
Overview
Cloud-init is a standard mechanism for configuring Linux systems on first boot. With the Anapaya appliance, you can use cloud-init to e.g. set SSH keys, configure the hostname, or configure network settings before the appliance configuration takes over.
Cloud-init can only be used to customize the appliance during the initial launch process. As soon as the first appliance configuration is applied, the appliance manages all configuration details and cloud-init does not run again.
When cloud-init runs
The timing depends on the image type used for installation:
| Image type | Cloud-init runs after |
|---|---|
| ISO | Second automatic reboot (after installation completes) |
| QCOW2 / VMDK | First automatic reboot |
| AWS / Azure | First boot (managed by the cloud platform) |
Providing user-data
Cloud platforms with custom images
On AWS and Azure, the cloud platform automatically injects your SSH key pair and can apply additional user-data. Provide cloud-init configuration when launching the appliance VM via the platform's launch wizard, typically in the Advanced / User data field.
QCOW2 / VMDK images
When using QCOW2 or VMDK images, provide user-data via your preferred cloud-init data source.
ISO (bare metal / USB)
Reach out to the Anapaya support team for instructions on how to provide user-data when installing the appliance from the ISO image.
Examples
SSH authorized keys
Add an SSH public key for initial access to the anapaya user:
#cloud-config
users:
- name: anapaya
ssh_authorized_keys:
- ssh-ed25519 AAAA... your-comment
The Anapaya appliance overwrites the SSH keys of the anapaya user when the first appliance
configuration is applied. To retain SSH access after that point, configure SSH keys in the
Management section of the appliance configuration.
Hostname
#cloud-config
hostname: my-appliance
fqdn: my-appliance.example.com
Network configuration
Refer to the cloud-init network configuration documentation for details on how to configure network interfaces with cloud-init.
Further reading
Refer to the cloud-init reference documentation for the full list of supported modules and examples.