cloud-init customization: noCloud seed, measured end to end
cloud-init turns a cloud image into your system at boot: hostname, users, SSH keys, packages — all injected during first start. Measured from zero on a Fedora Cloud image under both local KVM and PVE.
Get a Cloud image
Section titled “Get a Cloud image”Fedora ships qcow2 images with cloud-init preinstalled:
# F45 GA (the releases/45 path since 2026-11-03)wget https://download.fedoraproject.org/pub/fedora/linux/releases/45/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-45-1.4.x86_64.qcow2Measured: 5 GiB virtual disk (about 600 MiB downloaded), qemu-guest-agent preinstalled.
Two YAML files: user-data and meta-data
Section titled “Two YAML files: user-data and meta-data”user-data (what to do):
#cloud-confighostname: ci-testusers: - name: citest sudo: ALL=(ALL) NOPASSWD:ALL shell: /bin/bash ssh_authorized_keys: - ssh-ed25519 AAAA... your@keymeta-data (instance identity):
instance-id: ci-test-001local-hostname: ci-testPack the seed: cloud-localds
Section titled “Pack the seed: cloud-localds”sudo dnf install -y cloud-utils-cloud-localdscloud-localds ci-seed.iso user-data meta-dataMeasured output: a roughly 374 KB ISO (vfat, volume label CIDATA). Note cloud-localds lives in its own package cloud-utils-cloud-localds, not in cloud-image-utils as older tutorials assume.
Route one: virt-install (local KVM)
Section titled “Route one: virt-install (local KVM)”sudo virt-install --name=citest --memory=2048 --vcpus=2 \ --disk path=./f45-cloud.qcow2 \ --disk path=./ci-seed.iso,device=cdrom \ --import --noautoconsoleThe key is --import: boot the existing disk directly, skipping the installer. The seed rides along as a CD-ROM, read by cloud-init on first boot.
Route two: PVE (full flow measured)
Section titled “Route two: PVE (full flow measured)”# on the PVE host:qm create 460 --name f45-ci-test --memory 2048 --cores 2 \ --net0 virtio,bridge=vmbr0 --serial0 socket --agent enabled=1qm set 460 --scsi0 local-lvm:0,import-from=/path/f45-cloud.qcow2qm importdisk 460 f45-cloud.qcow2 local-lvm # older syntaxqm set 460 --ide2 local:iso/ci-seed.iso,media=cdromqm set 460 --boot order=scsi0qm start 460Measured results (first boot plus cloud-init in about a minute):
qm guest exec 460 -- cat /etc/hostname→ "ci-test" # hostname appliedqm guest exec 460 -- grep -c citest /etc/passwd→ 1 # user createdqm guest cmd 460 network-get-interfaces # DHCP IP availableThe serial console shows the login prompt as ci-test login:.
network-config: static IP (optional third file)
Section titled “network-config: static IP (optional third file)”version: 2ethernets: any: match: {name: "en*"} addresses: [192.168.50.10/24] routes: - to: default via: 192.168.50.1 nameservers: addresses: [223.5.5.5]Pack all four: cloud-localds ci-seed.iso user-data meta-data network-config.
Debugging: where cloud-init logs
Section titled “Debugging: where cloud-init logs”Measured, the three fastest entries inside the VM:
cloud-init status --long # overall state and per-module resultsls /var/lib/cloud/instances/ # instance ID (nocloud = local seed)cat /var/log/cloud-init-output.log # stdout/stderr of each stepCommon traps
Section titled “Common traps”| Symptom | Cause |
|---|---|
| nothing applied | user-data does not start with #cloud-config |
| user-data edits do nothing | instance-id unchanged, per-instance stages skipped |
| seed attached but unread | volume label must be CIDATA (cloud-localds handles it; manual genisoimage often does not) |
cloud-localds: command not found | install cloud-utils-cloud-localds (separate package) |
| PVE cannot find the disk | use --import-from (PVE 7.2+) or qm importdisk |
| SSH key not injected | ssh_authorized_keys indentation wrong, or image forbids passwords while the key format is wrong |
Related pages
Section titled “Related pages”- KVM virtualization — virt-install basics
- Cloud images — obtaining Fedora images per cloud
- SSH and keys — using the injected keys
- Upstream: cloud-init docs