Skip to main content
Version: 3.0.0-alpha (Diátaxis)

API Reference

API Reference – Virtual Machines

This reference provides a comprehensive description of Hikube VMInstance and VMDisk APIs, including available parameters, usage examples, and recommended best practices.


VMInstance

Overview

The VMInstance API allows you to create, configure, and manage virtual machines in Hikube.

apiVersion: apps.cozystack.io/v1alpha1
kind: VMInstance
metadata:
name: example-vm
spec:
# Detailed configuration below

Full specification

General parameters

ParameterTypeDescriptionDefaultRequired
externalbooleanEnables external network exposure for the VMfalse
externalMethodstringExposure method (PortList, WholeIP)PortList
externalPorts[]intList of externally exposed ports[]
runningbooleanDesired VM running statetrue
instanceTypestringCPU / memory instance size
instanceProfilestringOS profile for the VM
disks[]stringList of attached VMDisk resources[]
sshKeys[]stringInjected public SSH keys[]
cloudInitstringCloud-init configuration (YAML)""
cloudInitSeedstringCloud-init seed data""

Network configuration

spec:
external: true
externalMethod: PortList
externalPorts:
- 22
- 80
- 443

Instance types

S Series – Standard (1:2 ratio)

General-purpose workloads, shared and burstable CPU.

instanceType: s1.small     # 1 vCPU, 2 GB RAM
instanceType: s1.medium # 2 vCPU, 4 GB RAM
instanceType: s1.large # 4 vCPU, 8 GB RAM
instanceType: s1.xlarge # 8 vCPU, 16 GB RAM
instanceType: s1.3large # 12 vCPU, 24 GB RAM
instanceType: s1.2xlarge # 16 vCPU, 32 GB RAM
instanceType: s1.3xlarge # 24 vCPU, 48 GB RAM
instanceType: s1.4xlarge # 32 vCPU, 64 GB RAM
instanceType: s1.8xlarge # 64 vCPU, 128 GB RAM

U Series – Universal (1:4 ratio)

instanceType: u1.medium    # 1 vCPU, 4 GB RAM
instanceType: u1.large # 2 vCPU, 8 GB RAM
instanceType: u1.xlarge # 4 vCPU, 16 GB RAM
instanceType: u1.2xlarge # 8 vCPU, 32 GB RAM
instanceType: u1.4xlarge # 16 vCPU, 64 GB RAM
instanceType: u1.8xlarge # 32 vCPU, 128 GB RAM

M Series – Memory Optimized (1:8 ratio)

instanceType: m1.large     # 2 vCPU, 16 GB RAM
instanceType: m1.xlarge # 4 vCPU, 32 GB RAM
instanceType: m1.2xlarge # 8 vCPU, 64 GB RAM
instanceType: m1.4xlarge # 16 vCPU, 128 GB RAM
instanceType: m1.8xlarge # 32 vCPU, 256 GB RAM

Supported OS profiles

(List preserved as-is, Linux and Windows profiles)


SSH configuration

spec:
sshKeys:
- ssh-rsa AAAA... user@host
- ssh-ed25519 AAAA... user2@host

Cloud-init

spec:
cloudInit: |
#cloud-config
users:
- name: admin
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa AAAA...

packages:
- htop
- docker.io
- curl

Full VMInstance example

production-vm.yaml
apiVersion: apps.cozystack.io/v1alpha1
kind: VMInstance
metadata:
name: vm-example
spec:
external: true
externalMethod: PortList
externalPorts:
- 22
running: true
instanceType: u1.2xlarge
instanceProfile: ubuntu
disks:
- vm-system-disk
sshKeys:
- ssh-rsa AAAA...

VMDisk

Overview

The VMDisk API manages virtual disks attached to virtual machines. It supports multiple image sources: HTTP, empty disks, and Golden Images.

apiVersion: apps.cozystack.io/v1alpha1
kind: VMDisk
metadata:
name: disk-example
spec:
source:
http:
url: https://...
optical: false
storage: 30Gi
storageClass: replicated

Main parameters

ParameterTypeDescriptionDefaultRequired
sourceobjectDisk image source{}
opticalbooleanOptical disk (ISO)false
storagestringDisk size
storageClassstringStorage classreplicated

Image sources

HTTP / HTTPS source

spec:
source:
http:
url: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img

Empty disk

spec:
source: {}

Golden Images (Hikube preloaded images)

Golden Images are OS images preloaded and maintained by Hikube. They allow fast provisioning, standardization, and no external network dependency.

Naming convention

Images follow the {os}-{version} format (e.g., ubuntu-2404, rocky-9). Always specify the version to ensure workload compatibility.

Usage

spec:
source:
image:
name: ubuntu-2404

Available images

NameOperating SystemTypeMin. storage
almalinux-8AlmaLinux 8Cloud11 Gi
almalinux-9AlmaLinux 9Cloud11 Gi
almalinux-10AlmaLinux 10Cloud11 Gi
rocky-8Rocky Linux 8Cloud11 Gi
rocky-9Rocky Linux 9Cloud11 Gi
rocky-10Rocky Linux 10Cloud11 Gi
debian-11Debian 11 (Bullseye)Cloud4 Gi
debian-12Debian 12 (Bookworm)Cloud4 Gi
debian-13Debian 13 (Trixie)Cloud4 Gi
ubuntu-2204Ubuntu 22.04 LTS (Jammy)Cloud4 Gi
ubuntu-2404Ubuntu 24.04 LTS (Noble)Cloud4 Gi
centos-stream-9CentOS Stream 9Cloud11 Gi
centos-stream-10CentOS Stream 10Cloud11 Gi
oracle-8Oracle Linux 8Cloud40 Gi
oracle-9Oracle Linux 9Cloud40 Gi
oracle-10Oracle Linux 10Cloud40 Gi
opensuse-156openSUSE Leap 15.6Cloud1 Gi
opensuse-160openSUSE Leap 16.0Cloud2 Gi
cloudlinux-8CloudLinux 8Cloud8 Gi
cloudlinux-9CloudLinux 9Cloud9 Gi
proxmox-8Proxmox VE 8ISO2 Gi
proxmox-9Proxmox VE 9ISO2 Gi
talos-112Talos Linux 1.12Cloud8 Gi
ISO images

ISO type images (Proxmox) are installers, not ready-to-use cloud images. They require manual installation through the VNC console.


VMDisk examples

System disk using a Golden Image

ubuntu-golden-disk.yaml
apiVersion: apps.cozystack.io/v1alpha1
kind: VMDisk
metadata:
name: ubuntu-system
spec:
source:
image:
name: ubuntu-2404
optical: false
storage: 20Gi
storageClass: replicated

Storage classes

ClassDescriptionReplication
localNode-local storage
replicatedReplicated storage

Network exposure methods

PortList

  • Automatic firewall
  • Explicit port allowlist
  • Recommended for production

WholeIP

  • All ports exposed
  • No network filtering
  • Development use only
Security

With WholeIP, the VM is fully exposed to the Internet. An OS-level firewall is mandatory.


Best practices

Security

  • Use SSH keys only
  • Enable OS firewall

Storage

  • Use replicated in production
  • Separate system and data disks

Performance

  • Select instance types according to workload
  • Monitor real usage
Recommended architecture

For production, use at least two disks (system + data) with replicated storage.