Skip to content
Search Fedora

    Browse this documentation

    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.

    Fedora ships qcow2 images with cloud-init preinstalled:

    Terminal window
    # 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.qcow2

    Measured: 5 GiB virtual disk (about 600 MiB downloaded), qemu-guest-agent preinstalled.

    user-data (what to do):

    #cloud-config
    hostname: ci-test
    users:
    - name: citest
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    ssh_authorized_keys:
    - ssh-ed25519 AAAA... your@key

    meta-data (instance identity):

    instance-id: ci-test-001
    local-hostname: ci-test
    Terminal window
    sudo dnf install -y cloud-utils-cloud-localds
    cloud-localds ci-seed.iso user-data meta-data

    Measured 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.

    Terminal window
    sudo virt-install --name=citest --memory=2048 --vcpus=2 \
    --disk path=./f45-cloud.qcow2 \
    --disk path=./ci-seed.iso,device=cdrom \
    --import --noautoconsole

    The 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.

    Terminal window
    # on the PVE host:
    qm create 460 --name f45-ci-test --memory 2048 --cores 2 \
    --net0 virtio,bridge=vmbr0 --serial0 socket --agent enabled=1
    qm set 460 --scsi0 local-lvm:0,import-from=/path/f45-cloud.qcow2
    qm importdisk 460 f45-cloud.qcow2 local-lvm # older syntax
    qm set 460 --ide2 local:iso/ci-seed.iso,media=cdrom
    qm set 460 --boot order=scsi0
    qm start 460

    Measured results (first boot plus cloud-init in about a minute):

    qm guest exec 460 -- cat /etc/hostname
    → "ci-test" # hostname applied
    qm guest exec 460 -- grep -c citest /etc/passwd
    → 1 # user created
    qm guest cmd 460 network-get-interfaces # DHCP IP available

    The 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: 2
    ethernets:
    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.

    Measured, the three fastest entries inside the VM:

    Terminal window
    cloud-init status --long # overall state and per-module results
    ls /var/lib/cloud/instances/ # instance ID (nocloud = local seed)
    cat /var/log/cloud-init-output.log # stdout/stderr of each step
    SymptomCause
    nothing applieduser-data does not start with #cloud-config
    user-data edits do nothinginstance-id unchanged, per-instance stages skipped
    seed attached but unreadvolume label must be CIDATA (cloud-localds handles it; manual genisoimage often does not)
    cloud-localds: command not foundinstall cloud-utils-cloud-localds (separate package)
    PVE cannot find the diskuse --import-from (PVE 7.2+) or qm importdisk
    SSH key not injectedssh_authorized_keys indentation wrong, or image forbids passwords while the key format is wrong