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.
| Kind | Use it when |
|---|---|
nat | Machines only need private addresses |
routed | Your 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.
| Driver | Stores disks as |
|---|---|
dir | Files in a folder |
lvm-thin | Volumes 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.
| Setting | What it does |
|---|---|
traffic_gib | The monthly traffic allowance. Use 0 for unmetered |
traffic_action | What happens at the limit: report, throttle or suspend |
backup_schedule | off, daily or weekly |
backup_keep | How many backups to keep. Use 0 to keep them all |
4. Customers
There are three roles.
| Role | Can reach |
|---|---|
admin | Everything |
staff | Every customer's machines, but no hosts or settings |
customer | Only 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.
| Scope | Allows |
|---|---|
read | Reading everything |
vm:power | Starting and stopping machines |
vm:create | Creating machines |
provision | The billing API |
Check your setup
klyrn-vm doctor
This tells you which of the four steps is still missing.