better/compute
API

flavors

Flavors are the named instance shapes of a VPS pool: vCPU, memory, disk and GPU count, plus the provider offer a provider pool creates. The pool's owner manages them, and tenants the pool is offered to can list them. An instance keeps the shape it was admitted with, so changing or deleting a flavor never changes a live instance. See [Flavors](/docs/guides/vps/flavors).

Flavors are the named instance shapes of a VPS pool: vCPU, memory, disk and GPU count, plus the provider offer a provider pool creates. The pool's owner manages them, and tenants the pool is offered to can list them. An instance keeps the shape it was admitted with, so changing or deleting a flavor never changes a live instance. See Flavors.

All 4 methods are served by this release.

MethodKindAuthorizationPhaseStatus
listreadcompute:flavors:read @ compute-poolv0.3registered
createmutationcompute:flavors:manage @ compute-poolv0.3registered
updatemutationcompute:flavors:manage @ compute-poolv0.3registered
deletemutationcompute:flavors:manage @ compute-poolv0.3registered

list

POST /api/compute/flavors/list

Returns the pool's flavors that are not archived, sorted by name.

The pool must be owned by or offered to the tenant; otherwise the call is NOT_FOUND.

  • Kind: read
  • Authorization: compute:flavors:read @ compute-pool
  • Module: vps
  • Phase: v0.3 (registered)

Input

FieldTypeRequiredConstraints
tenantIdstringyesat most 128 characters; matches ^[A-Za-z0-9._:-]{1,128}$
poolIdstringyesat most 57 characters; matches ^pool_[0-9a-hjkmnp-tv-z]{26,52}$

create

POST /api/compute/flavors/create

Adds a flavor to a vps-host or provider pool the tenant owns and returns it at version 1.

  • gpus defaults to 0. A flavor of a provider pool needs offerId, the provider offer it creates; without it the call is INVALID_INPUT.

  • placement (hosted pools only; INVALID_INPUT on a provider pool) says where the guest lives on its host, and sandbox templates on the flavor inherit it:

    • hugepages: '2Mi' | '1Gi' backs guest memory with hugepages. These are booked from the host's hugepage pools instead of its memory, still charged to quota as memoryGiB, and never ballooned.
    • numaAffine keeps the vCPUs and memory on one NUMA node: the GPUs' node, or otherwise the least-loaded node with room for the memory.
    • pinned gives each vCPU a host CPU that no other pinned guest on the host has.
    • A host that cannot honour numaAffine or pinned still runs the guest, floating, and the instance carries a PlacementDegraded condition with the reason (NoNumaTopology, NoNumaNodeFits, GpuNumaUnknown, NumaMemoryTooSmall or NotEnoughFreeCpus).
    • Resizing to a flavor with a different placement is UNSUPPORTED.
  • In a pool that overcommits memory (policy.overcommit.memoryGiB > 1), every guest gets a virtio balloon so the host can reclaim its free memory. The exceptions are hugepage-backed guests and guests with GPUs, whose memory is pinned. This needs no flavor field.

  • NOT_FOUND when the tenant does not own the pool; INVALID_STATE when the pool is of another class.

  • CONFLICT when the pool already has a flavor with that name, archived ones included.

  • Kind: mutation

  • Authorization: compute:flavors:manage @ compute-pool

  • Module: vps

  • Phase: v0.3 (registered)

Input

FieldTypeRequiredConstraints
tenantIdstringyesat most 128 characters; matches ^[A-Za-z0-9._:-]{1,128}$
poolIdstringyesat most 57 characters; matches ^pool_[0-9a-hjkmnp-tv-z]{26,52}$
namestringyesat most 63 characters; matches ^[a-z0-9][a-z0-9._-]{0,62}$
vcpuintegeryes1-1024
memoryGiBintegeryes1-16384
diskGiBintegeryes1-65536
gpusinteger0-16; default 0
offerIdstring1-128 characters
placementobject
placement.numaAffineboolean
placement.pinnedboolean
placement.hugepagesone of 2Mi, 1Gi

update

POST /api/compute/flavors/update

Replaces the shape of the named flavor and increments its version; an archived flavor becomes active again.

The input is the full shape, as for create. An omitted offerId keeps the stored one. Instances already admitted keep their old shape; only new instances and resizes use the new one. The call is NOT_FOUND when the tenant does not own the pool or the flavor does not exist.

  • Kind: mutation
  • Authorization: compute:flavors:manage @ compute-pool
  • Module: vps
  • Phase: v0.3 (registered)

Input

FieldTypeRequiredConstraints
tenantIdstringyesat most 128 characters; matches ^[A-Za-z0-9._:-]{1,128}$
poolIdstringyesat most 57 characters; matches ^pool_[0-9a-hjkmnp-tv-z]{26,52}$
namestringyesat most 63 characters; matches ^[a-z0-9][a-z0-9._-]{0,62}$
vcpuintegeryes1-1024
memoryGiBintegeryes1-16384
diskGiBintegeryes1-65536
gpusinteger0-16; default 0
offerIdstring1-128 characters
placementobject
placement.numaAffineboolean
placement.pinnedboolean
placement.hugepagesone of 2Mi, 1Gi

delete

POST /api/compute/flavors/delete

Deletes the named flavor, or archives it when any instance, deleted ones included, still references it; returns deleted and archived to say which.

An archived flavor disappears from list and can no longer be used to create or resize instances. update makes it active again. The call is NOT_FOUND when the tenant does not own the pool or the flavor does not exist.

  • Kind: mutation
  • Authorization: compute:flavors:manage @ compute-pool
  • Module: vps
  • Phase: v0.3 (registered)

Input

FieldTypeRequiredConstraints
tenantIdstringyesat most 128 characters; matches ^[A-Za-z0-9._:-]{1,128}$
poolIdstringyesat most 57 characters; matches ^pool_[0-9a-hjkmnp-tv-z]{26,52}$
namestringyesat most 63 characters; matches ^[a-z0-9][a-z0-9._-]{0,62}$

Was this page helpful?

Better Compute is created by Sean Filimon

Last updated

On this page