vJailbreak is a VMware to Platform9 Private Cloud Director (PCD) VM migration tool built on Kubernetes (k3s). It converts VMDK disks to QCOW2 (or raw LUNs) and deploys VMs to OpenStack, supporting hot (live) and cold migrations with Changed Block Tracking (CBT).
- Project Overview: See @README.md for user-facing documentation
- Contributing Guidelines: See @CONTRIBUTING.md for contribution workflow
- Architecture Deep-Dive: https://deepwiki.com/platform9/vjailbreak
- Platform9 PCD Documentation: https://docs.platform9.com/
DIRECTIVE: When working with vJailbreak components, ALWAYS consult the official documentation of underlying open-source tools before implementing features or debugging issues.
Core Dependencies: virt-v2v, libguestfs, nbdkit, k3s, OpenStack, Platform9 PCD, govmomi, controller-runtime, virtio-win
Documentation Links:
- virt-v2v: https://libguestfs.org/virt-v2v.1.html | https://libguestfs.org/virt-v2v-support.1.html
- libguestfs: https://libguestfs.org/ | nbdkit: https://libguestfs.org/nbdkit.1.html
- k3s: https://docs.k3s.io/ | OpenStack: https://docs.openstack.org/
- Platform9 PCD: https://docs.platform9.com/
- govmomi: https://github.com/vmware/govmomi
- controller-runtime: https://pkg.go.dev/sigs.k8s.io/controller-runtime
- virtio-win: https://github.com/virtio-win/kvm-guest-drivers-windows
Critical directives — follow these strictly:
- After editing types in
k8s/migration/api/v1alpha1/, ALWAYS runmake generateinsidek8s/migration/to regenerate deepcopy/client code and update CRD YAML - Test CRD changes with
cd k8s/migration && make testbefore committing
- NEVER hand-edit
deploy/installer.yaml— it is generated bymake generate-manifests - NEVER hand-edit
zz_generated.deepcopy.gofiles — they are generated by controller-gen
- Run
make setup-hooksonce per clone before any commits to activate pre-commit validation - Pre-commit hooks will validate code formatting and run basic checks
- ALWAYS write unit tests for any new code written by Claude
- Place tests in
_test.gofiles alongside the code under test (Go convention) - If existing code is hard to unit test (e.g., no interfaces, large functions with external deps), refactor up to 1-2 files to make it testable — refactor must not change logic or behavior, only restructure for testability (e.g., extract interfaces, dependency injection, split large functions into pure helpers)
- Use table-driven tests for Go code where multiple input/output cases apply
- Mock external dependencies (VMware, OpenStack, Kubernetes API) using interfaces — do not hit real external systems in unit tests
- v2v-helper tests require
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 - v2v-helper tests will NOT compile on macOS without Linux cross-compilation toolchain
- Run
make test-v2v-helperfor v2v-helper tests (requires Linux or Docker) - Run
cd k8s/migration && make testfor controller tests - ALWAYS run tests before submitting PRs
- Four independent Go modules — run
gocommands from the correct directory:- Controller:
k8s/migration/ - V2V Helper:
v2v-helper/ - API Server:
pkg/vpwned/ - Common:
pkg/common/
- Controller:
- When adding dependencies, run
go mod tidyin the specific module directory - Cross-module imports must reference the full module path
| Path | Purpose |
|---|---|
k8s/migration/ |
Kubernetes controller manager (Go, controller-runtime) |
v2v-helper/ |
Migration worker pod — disk copy and conversion (Go, libguestfs) |
ui/ |
React/TypeScript frontend (MUI, Vite) |
pkg/vpwned/ |
REST API server (Go) for Cluster Conversion |
pkg/common/ |
Shared Go utilities |
image_builder/ |
Builds the vJailbreak appliance QCOW2 image |
appliance/ |
Vagrant-based k3s cluster for local testing |
deploy/ |
Generated Kubernetes manifests |
docs/ |
Astro documentation site |
scripts/ |
Utility and firstboot scripts |
# One-time setup
make setup-hooks
# Build components
make ui v2v-helper vjail-controller build-vpwned
make generate-manifests # Requires vjail-controller and ui built first
make build-image # Complete appliance QCOW2
# Testing
make test-v2v-helper # v2v-helper (requires Linux CGO)
cd k8s/migration && make test # Controller tests
# Development
make run-local # Run controller locally
cd ui && yarn dev # UI dev server (requires VITE_API_HOST, VITE_API_TOKEN)Image tags: Default <git-parent-branch>-<short-sha>. Override: BUILD_VERSION=v1.2.3 REGISTRY=myregistry.io make <target>
- macOS Development: v2v-helper tests require Linux CGO, use Docker/Linux VM
- DNS Resolution: ESXi host DNS required for VM copy. Add to
/etc/hostsor restart controller after/etc/resolv.confchanges - VDDK Libraries: Must be in
/home/ubuntu/vmware-vix-disklib-distribon vJailbreak VM - Build Dependencies:
generate-manifestsrequiresvjail-controlleranduibuilt first
# Controller logs
kubectl -n vjailbreak logs -l control-plane=controller-manager -f
# Migration status
kubectl -n migration-system get migration <name> -o yaml
# V2V helper logs
kubectl -n migration-system logs <migration-name>-v2v-helperCheck: Guest OS support at https://libguestfs.org/virt-v2v-support.1.html
| Path | Purpose |
|------|---------||
| k8s/migration/ | Controller (Go module) |
| v2v-helper/ | Migration worker (Go module, CGO required) |
| ui/ | React/TypeScript frontend |
| pkg/vpwned/ | API server (Go module) |
| pkg/common/ | Shared utilities (Go module) |
| scripts/ | Utility and firstboot scripts |
| deploy/ | Generated Kubernetes manifests |
Key CRDs: Migration, MigrationPlan, VMwareCreds, OpenstackCreds, NetworkMapping, StorageMapping, MigrationTemplate