VM Import Controller
Overview
Designed and implemented a Kubernetes operator to orchestrate large-scale virtual machine migrations from KVM to Harvester. This solution enabled the migration of 100+ VMs β a transition that was not operationally feasible without custom orchestration.
Key Achievements
- π 100+ VMs migrated β Enabled enterprise-scale virtualization modernization
- βοΈ Custom orchestration β Built where no off-the-shelf solution existed
- π Seamless transitions β Zero-downtime migration workflows
Technical Details
The operator implements a sophisticated reconciliation loop that:
- Discovers source VMs via SSH connection to KVM/Libvirt hosts
- Gracefully powers off source VMs with configurable timeouts
- Streams and converts disk images using
qemu-img - Creates KubeVirt VirtualMachine CRs with appropriate CPU/memory/network mappings
- Tracks migration status via Kubernetes custom resource status fields
Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β KVM Source ββββββΆβ VM Import ββββββΆβ Harvester β
β (Libvirt) β SSH β Controller β β (KubeVirt) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
Technologies
Go Kubernetes Operator SDK KubeVirt Harvester Libvirt QEMU
