PaaS CloudTechnical Reference

Virtualization

PaaS Cloud virtual machines are powered by KubeVirt, running on top of Kubernetes. This page explains the core virtualization concepts, resources, and components.

vm-disk

A vm-disk defines virtual machine storage using KubeVirt DataVolume and PersistentVolumeClaim (PVC) resources. Disks are provisioned through the CDI (Containerized Data Importer).

Disk Sources

SourceDescription
image (golden image)Reference a pre-built OS image by name from the Cozystack catalog.
httpDownload an image from a remote URL.
uploadUpload a local image using virtctl image-upload.
diskClone an existing vm-disk by name.
EmptyCreate an empty disk for data storage.

Example: Golden Image

source:
  image:
    name: ubuntu

Example: HTTP Download

source:
  http:
    url: "https://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img"

Example: Upload

source:
  upload: {}

After creation, use virtctl image-upload to populate the disk. See VM Image Upload.

Storage Parameters

  • storage — Disk size (default 5Gi).
  • storageClass — Storage class for the PVC (default replicated).
  • optical — Set to true for CD-ROM disks.

vm-instance

A vm-instance defines the Virtual Machine instance. It references one or more vm-disk resources and specifies compute, network, and access parameters.

Key Parameters

ParameterTypeDefaultDescription
instanceTypestringu1.mediumHardware template (see VM Instance Types).
instanceProfilestringubuntuGuest OS preference (see VM Instance Types).
disks[]object[]List of vm-disk names to attach. First disk is bootable.
networks[]object[]Networks to attach (deprecated: subnets).
sshKeys[]string[]SSH public keys injected via cloud-init.
cloudInitstring""Cloud-init user data.
externalboolfalseEnable external access.
externalMethodstringPortListTraffic passthrough method (PortList or WholeIP).
externalPorts[]int[22]Ports to forward when external is true.
externalAllowICMPbooltrueAccept ICMP (ping) in PortList mode.
gpus[]object[]GPU resources for passthrough.
runStrategystringAlwaysDesired running state (Always, Halted, RerunOnFailure).

Example

disks:
- name: example-system
- name: example-data
instanceType: u1.medium
instanceProfile: ubuntu
sshKeys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI..."
external: true
externalPorts:
- 22
- 80

CDI (Containerized Data Importer)

CDI handles importing and uploading disk images into PVCs. It provides the cdi-uploadproxy service that virtctl image-upload communicates with.

Golden Images

Golden images are pre-built OS images maintained by the platform team in the Cozystack catalog. They speed up VM deployment by eliminating the need to download or upload images manually.

virtctl

The KubeVirt CLI tool for VM operations. See Using virtctl.

GPU Passthrough

Attaching physical GPUs to VMs requires:

  • A gn1.* instance type (or custom resources with GPU requests).
  • Guest OS with appropriate drivers.
  • At least 4 GiB of RAM for NVIDIA driver initialization.

Windows VMs

Windows VMs require a Windows instance profile (e.g., windows.11, windows.2k22) and may need VirtIO drivers. Use the .virtio variants for improved I/O performance.

Cloneable VMs

Cozystack supports creating cloneable VMs from existing vm-instance and vm-disk resources. This enables rapid provisioning of identical VM instances for testing or scaling.

Live Migration

Live migration moves a running VM between nodes without downtime, provided the VM uses shared storage (e.g., LINSTOR/DRBD). The recommended way to trigger it is to create a VirtualMachineInstanceMigration object that targets the running VM:

apiVersion: kubevirt.io/v1
kind: VirtualMachineInstanceMigration
metadata:
  name: migrate-<vm-name>
  namespace: <tenant-name>
spec:
  vmiName: <vm-name>

Apply the manifest with kubectl apply -f <filename>.yaml.

You can also trigger a migration from the command line with:

virtctl migrate <vm-name>

Reference

For the upstream KubeVirt user guide, visit kubevirt.io/user-guide.

publicity banner

On this page

einfra banner