Skip to content

Virtual Machines & VMMs

PiVirt manages virtual machines through a declarative, API-driven lifecycle model. VMs are defined via YAML specifications and orchestrated across QEMU/KVM and Cloud Hypervisor backends.

stateDiagram-v2
    [*] --> Pending
    Pending --> Creating
    Creating --> Running
    Running --> Stopping
    Stopping --> Stopped
    Stopped --> Starting
    Starting --> Running
    Running --> Pausing
    Pausing --> Paused
    Paused --> Resuming
    Resuming --> Running
    Running --> Migrating
    Migrating --> Running
    Running --> Deleting
    Deleting --> [*]
apiVersion: pivirt.pilab.hu/v1
kind: VirtualMachine
metadata:
name: web-server
namespace: production
labels:
app: web
env: prod
spec:
cpu:
cores: 2
model: host-passthrough
memory:
size: 4Gi
hugepages: false
disks:
- name: root
size: 20Gi
pool: default
bus: virtio
bootOrder: 1
nics:
- name: eth0
network: virbr0
model: virtio
os:
type: linux
bootOrder: [disk, network]
cloudInit:
enabled: true
userData: |
#cloud-config
packages: [nginx]
  • Logical isolation for VMs
  • RBAC policies applied per namespace
  • Network policies scoped to namespace
  • Attach metadata to VMs
  • Filter and group VMs
  • Used by networking and policies
  • CPU, memory, disk limits per namespace
  • Prevent resource exhaustion
  • Enforced at creation time
  • Co-locate VMs on same host
  • Spread VMs across hosts
  • Improve availability