KoaVM
Guide pages

Guide · For administrators

Self-service and hourly usage

Since 0.12, besides plan VPSs, you can sell a package of resources: the customer creates, resizes and deletes their own VPSs, up to the package limits. Self-service stays off until you turn it on: if you only sell predefined VPSs nothing changes, for you or for your customers.

Turning it on

  1. Settings › Self-service: tick "Clients with a package create their own VPSs".
  2. Clients & plans › plan: tick "Offered in self-service" on the plans customers may choose. The other plans stay for the VPSs you sell yourself.
  3. Clients & plans › client › Self-service: the package limits (VPSs, vCPUs, RAM, disk; 0 = no limit), the plans included (none = all plans offered in self-service) and the nodes (none = all panel nodes). The customer picks the city, not the node.

In the client list, customers with a package have a "Self-service" label with their VPS count; offered plans have a "self-service" label.

What the customer does

  • In Services they see the package, how much they used and Create VPS: plan, city, system, first-boot application, password, saved SSH keys, first-boot script, private network. Plans that don't fit in the package stay visible but disabled, with the reason.
  • On the page of a package VPS: Change plan (package plans only; the disk cannot shrink) and Delete VPS (typing the hostname).
  • VPSs sold separately (by you, WHMCS or KoaBilling) do not count in the package and the customer cannot change or delete them.
  • The customer's detached volumes count towards the package disk (they still take space).
  • Package VPSs go only to panel nodes, not to provider zones.

On the VPS page, Administration box, a package VPS shows "Origin: created by the client in the self-service package".

Suspending and removing the package

  • Suspended (in the package): the package VPSs shut down with reason "billing" and no new ones can be created; untick it and they start again.
  • Remove package: choose whether to keep the VPSs (they become normal VPSs, the customer can no longer change them) or delete them (with disks, snapshots and backups; confirm by typing the customer's email).
  • Resellers don't get a package: they already create VPSs from their page, within their limits. A reseller's customer can have a package: the reseller's limits, plans and nodes apply too.

SSH keys and first-boot script

These work for everyone, including the VPSs you create:

  • My account › SSH keys: saved public keys can be picked with one click when you create or reinstall a VPS.
  • First-boot script (Linux, up to 64 KB): runs once as root, after the network and after the chosen application (if any). The log is in /var/log/koavm-script.log, the exit code in /var/lib/koavm-script/exit. From the API: user_script when creating.

Hourly usage

Every hour the panel counts, for every VPS (including the ones sold separately) and every detached volume, the assigned resources: hours, vCPU-hours, RAM-hours, disk-hours (with attached disks) and IPv4 hours. Rows are per month and kept for 24 months; hours while the panel is down are not counted. A deleted VPS stays in the month's usage.

  • The package shows the month's usage to the customer and to you.
  • GET /usage?month=YYYY-MM in the API gives the detail row by row (client_id for one customer, self_service=1 for package VPSs only): KoaBilling reads it to bill by the hour.
  • The WHMCS module (1.5) has the "pacchetto" product type: it creates the customer and the package, suspends, unsuspends, changes the limits and deletes; it also offers WHMCS Usage Billing the month's hours (VPS, vCPU, RAM, disk) to price in the product.

From the API

CallWhat it does
GET /clients/{id}/quotathe customer's package, usage and the month's hours
PUT /clients/{id}/quotagives or changes the package: max_vps, max_vcpu, max_ram_mb, max_disk_gb, plans, nodes, suspended, external_id
DELETE /clients/{id}/quotaremoves the package; with ?delete_vps=1&confirm=<email> it also deletes its VPSs
GET /usage?month=YYYY-MMhourly usage of the month (client_id, self_service=1)
POST /vpsalso ssh_key_ids (saved keys of the API key owner) and user_script

See also Customers and VPSs and API and integrations.