Provisioning Fedora CoreOS on Vultr

This guide shows how to provision new Fedora CoreOS (FCOS) nodes on Vultr. FCOS images are currently not published directly on Vultr, but they can be uploaded as custom images.

Prerequisites

Before provisioning a FCOS machine, you must have an Ignition configuration file that sets SSH authorized keys for the core user. If you do not have one, see Producing an Ignition File. While the Vultr documentation mentions cloud-init and scripts, FCOS does not support cloud-init or the ability to run scripts from user-data. It accepts only Ignition configuration files.

You also need to have access to a Vultr account. The examples below use the vultr-cli and s3cmd command-line tools.

Using a custom snapshot

Vultr supports creating custom snapshots from public raw images.

These steps show how to download a FCOS image and upload it to an existing storage bucket, in order to create a snapshot from that.

See Vultr documentation for further details on how to create a bucket and configure s3cmd to use it.

Creating a snapshot

Fedora CoreOS comes in three streams, with different update schedules per stream. These steps show the stable stream as an example, but can be used for other streams too.

  1. Fetch the latest image suitable for your target stream (or download and verify it from the web).

    STREAM='stable'
    coreos-installer download -s "${STREAM}" -p vultr -f raw.xz --decompress
  2. Use s3cmd to upload the raw image to your bucket, and note its public URL.

    BUCKET='my-bucket'
    FCOS_VERSION='...'
    s3cmd put -P "fedora-coreos-${FCOS_VERSION}-vultr.x86_64.raw" "s3://{BUCKET}/"
  3. Create the snapshot from your object URL, and note its ID.

    IMAGE_URL='https://...'
    VULTR_API_KEY='<token>'
    vultr-cli snapshot create-url -u "${IMAGE_URL}"

Launching an instance from a snapshot

You can now create a FCOS Vultr instance using the snapshot ID above.

This example creates a 1 vCPU, 1GB RAM instance in NYC. Use vultr-cli regions list and vultr plans list for other options.

SNAPSHOT_ID='...'
REGION='1'
PLAN='201'
vultr-cli server create --snapshot "${SNAPSHOT_ID}" --region "${REGION}" --plan "${PLAN}" --userdata "$(cat example.ign)"
Vultr default firewall does not allow incoming SSH connections. Rules must be adjusted if you wish to reach the instance over SSH.