Set up KLYRN VM

After the install you need four things before you can sell a machine. Set them up in this order. Each one can be done in the panel or through the API.

1. A network

A network gives machines their addresses. A new install already has a private network called private, so you can create a test machine straight away.

For public addresses, add a network of the kind your provider gives you.

KindUse it when
natMachines only need private addresses
routedYour provider routes a block of addresses to your server. This is the usual case at OVH and Hetzner

Then add a pool to the network. A pool is the range of addresses KLYRN VM may hand out.

POST /api/v1/networks/{id}/pools

{
  "name": "public-v4",
  "cidr": "203.0.113.0/24",
  "gateway": "203.0.113.1",
  "topology": "routed",
  "gateway_mode": "onlink"
}

List any addresses that are already in use under reserved, and KLYRN VM will never hand them out.

2. Storage

Each compute node needs a storage pool for machine disks. The installer creates one called klyrn-local.

DriverStores disks as
dirFiles in a folder
lvm-thinVolumes in an LVM thin pool

Set reserve_percent to keep some space free on the host. A storage pool that fills up stops machines from starting.

3. Plans

A plan is a size your customers can buy. It sets processors, memory, disk and addresses.

{
  "slug": "s2",
  "name": "S2",
  "vcpus": 2,
  "memory_mib": 4096,
  "disk_gib": 50,
  "ipv4_count": 1
}

A plan can also carry a traffic allowance and a backup schedule.

SettingWhat it does
traffic_gibThe monthly traffic allowance. Use 0 for unmetered
traffic_actionWhat happens at the limit: report, throttle or suspend
backup_scheduleoff, daily or weekly
backup_keepHow many backups to keep. Use 0 to keep them all

4. Customers

There are three roles.

RoleCan reach
adminEverything
staffEvery customer's machines, but no hosts or settings
customerOnly their own machines

A reseller is a separate account with an allowance. A reseller creates their own customers and sees nobody else's.

Create a customer in the panel, or let your billing system create them through the API.

API tokens

Give each tool a token with only the access it needs.

ScopeAllows
readReading everything
vm:powerStarting and stopping machines
vm:createCreating machines
provisionThe billing API

Check your setup

klyrn-vm doctor

This tells you which of the four steps is still missing.

WhatsApp