What is this integration?
HyperSDK (Go) provides the export layer that pulls VMs from 9 cloud providers, while hyper2kvm (Python) handles the conversion and import to KVM/libvirt.
Cloud Provider → HyperSDK Export → hyper2kvm Convert → KVM Import
(vSphere) (Go daemon) (Python tool) (libvirt)
# HyperSDK exposes REST API on port 8080
curl http://localhost:8080/jobs/submit -d '{
"vm_identifier": "vm-123",
"provider": "vsphere",
"hyper2kvm_integration": {"enabled": true}
}'
Integration already implemented:
/daemon/api/hyper2kvm_integration.go (310 lines) - API handlers/daemon/jobs/pipeline.go (150+ lines) - Pipeline execution/providers/common/libvirt.go (200+ lines) - KVM import# Start HyperSDK daemon
sudo systemctl start hypervisord
# Start hyper2kvm daemon (daemon mode)
sudo systemctl start hyper2kvm@vsphere.service
# Or run demo script
./examples/hyper2kvm-demo.sh
Step 1: Check Health
curl http://localhost:8080/health
# → {"status": "healthy"}
Step 2: List VMs
curl -X POST http://localhost:8080/vms/list \
-H "Content-Type: application/json" \
-d '{"provider": "vsphere"}'
# → Returns JSON array of VMs
Step 3: Submit Export Job
curl -X POST http://localhost:8080/jobs/submit \
-H "Content-Type: application/json" \
-d '{
"vm_identifier": "test-vm",
"provider": "vsphere",
"export_method": "ova",
"export_path": "/exports/test-vm",
"hyper2kvm_integration": {
"enabled": true,
"daemon_mode": true
}
}'
# → {"job_id": "job-abc-123", "status": "pending"}
Step 4: Monitor Progress
# Real-time progress
curl http://localhost:8080/jobs/progress/job-abc-123
# → {"percentage": 45, "bytes_transferred": 5242880}
# WebSocket for live updates (JavaScript)
const ws = new WebSocket('ws://localhost:8080/websocket');
ws.onmessage = (event) => console.log(event.data);
Step 5: Check Conversion
# Check hyper2kvm daemon
systemctl status hyper2kvm@vsphere.service
# View conversion logs
journalctl -u hyper2kvm@vsphere -f
┌─────────────────────────────────────────────────────────────┐
│ User / Orchestrator │
│ (Python/CLI/Web UI) │
└────────────────────────┬────────────────────────────────────┘
│ REST API (HTTP/JSON)
│
┌────────────────────────▼────────────────────────────────────┐
│ HyperSDK Daemon (Go) │
│ Port: 8080 │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Job Manager & Queue │ │
│ │ ┌──────┬──────┬──────┬──────┐ │ │
│ │ │Job 1 │Job 2 │Job 3 │Job 4 │ (concurrent) │ │
│ │ └──────┴──────┴──────┴──────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────▼───────────────────────────────┐ │
│ │ Provider Abstraction Layer │ │
│ │ ┌────────┬────────┬────────┬────────┬────────┐ │ │
│ │ │vSphere │ AWS │ Azure │ GCP │ Others │ │ │
│ │ └────────┴────────┴────────┴────────┴────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────▼───────────────────────────────┐ │
│ │ Export Engine (OVA/OVF/VMDK) │ │
│ └─────────────────────┬───────────────────────────────┘ │
└────────────────────────┼───────────────────────────────────┘
│
│ Filesystem
▼
┌─────────────────────────────────────────────────────────────┐
│ /exports/vm-name/*.{ovf,vmdk} │
│ + manifest.yaml │
└────────────────────────┬────────────────────────────────────┘
│
│ Watch Directory / Direct Call
▼
┌─────────────────────────────────────────────────────────────┐
│ hyper2kvm Conversion Daemon (Python) │
│ systemd service: hyper2kvm@vsphere │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ 1. Parse OVF/VMDK metadata │ │
│ │ 2. Convert disk to raw/qcow2 │ │
│ │ 3. Generate libvirt domain XML │ │
│ │ 4. Register with libvirt │ │
│ └─────────────────────┬───────────────────────────────┘ │
└────────────────────────┼───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ KVM / libvirt │
│ /var/lib/kvm/images/vm-name/*.qcow2 │
└─────────────────────────────────────────────────────────────┘
Scenario: Migrate one VM from vSphere to KVM for testing
# Submit job with direct conversion
curl -X POST http://localhost:8080/jobs/submit -d '{
"vm_identifier": "test-app-vm",
"provider": "vsphere",
"hyper2kvm_integration": {
"enabled": true,
"daemon_mode": false, # Direct call
"auto_convert": true
}
}'
Result: VM exported and immediately converted in one operation
Scenario: Migrate production VMs overnight
# Create backup policy for multiple VMs
curl -X POST http://localhost:8080/backup-policies/create -d '{
"name": "production-migration",
"vm_filter": {"tags": ["production"]},
"schedule": "0 2 * * *", # 2 AM daily
"hyper2kvm_integration": {
"enabled": true,
"daemon_mode": true # Queue-based
}
}'
Result: All VMs exported and queued, hyper2kvm daemon processes in background
Scenario: Daily backups of critical VMs
# Schedule with retention policy
curl -X POST http://localhost:8080/schedules/create -d '{
"name": "dr-backup",
"cron": "0 1 * * *",
"job_definition": {
"vm_identifier": "db-server",
"export_method": "ova",
"hyper2kvm_integration": {"enabled": true}
},
"retention": {"count": 7} # Keep 7 days
}'
Result: Automated nightly backups with automatic cleanup
| Endpoint | Method | Purpose | Example |
|---|---|---|---|
/health |
GET | Check daemon status | curl /health |
/jobs/submit |
POST | Submit export job | See examples above |
/jobs/query?job_id=X |
GET | Get job status | curl /jobs/query?job_id=123 |
/jobs/progress/X |
GET | Get progress % | curl /jobs/progress/123 |
/jobs/logs/X |
GET | Stream job logs | curl /jobs/logs/123 |
/vms/list |
POST | List VMs | curl -X POST /vms/list -d '{...}' |
/convert |
POST | Convert VM | hyper2kvm integration |
/import-to-kvm |
POST | Import to libvirt | Final step |
/websocket |
WS | Real-time updates | ws://localhost:8080/websocket |
/etc/hypersdk/config.yaml)daemon:
address: "0.0.0.0:8080"
workers: 4
providers:
vsphere:
enabled: true
host: "vcenter.example.com"
username: "admin@vsphere.local"
password: "${VSPHERE_PASSWORD}"
hyper2kvm:
daemon_enabled: true
watch_dir: "/var/lib/hyper2kvm/watch"
output_dir: "/var/lib/kvm/images"
default_format: "qcow2"
export:
base_path: "/exports"
concurrent_exports: 2
# Start HyperSDK daemon
sudo systemctl start hypervisord
sudo systemctl enable hypervisord
# Start hyper2kvm daemon for vSphere
sudo systemctl start hyper2kvm@vsphere.service
sudo systemctl enable hyper2kvm@vsphere.service
# Check status
systemctl status hypervisord
systemctl status hyper2kvm@vsphere.service
# HyperSDK logs
journalctl -u hypervisord -f
# hyper2kvm logs
journalctl -u hyper2kvm@vsphere -f
# libvirt logs
journalctl -u libvirtd -f
Problem: Job stuck in “pending”
# Check worker availability
curl http://localhost:8080/status
# → Shows active workers and queue depth
Problem: Conversion fails
# Check hyper2kvm daemon
systemctl status hyper2kvm@vsphere.service
# Check watch directory permissions
ls -la /var/lib/hyper2kvm/watch/
Problem: Cannot connect to provider
# Validate credentials
curl -X POST http://localhost:8080/providers/validate -d '{
"provider": "vsphere"
}'
daemon:
workers: 2
export:
concurrent_exports: 1
chunk_size: 10485760 # 10MB
daemon:
workers: 4
export:
concurrent_exports: 2
chunk_size: 20971520 # 20MB
daemon:
workers: 8
export:
concurrent_exports: 4
chunk_size: 52428800 # 50MB
/daemon/api/hyper2kvm_integration.go/daemon/jobs/pipeline.go/providers/common/libvirt.go./examples/hyper2kvm-demo.shdocs/integration/hyper2kvm-workflow.mddocs/api/docs/integration/daemon-integration.md/docs/integration/hyper2kvm-workflow.md/examples/hyper2kvm-demo.sh/docs/api//config.example.yaml/daemon/api/hyper2kvm_integration.goQuick Test Command:
# Test the entire workflow in one command
./examples/hyper2kvm-demo.sh --daemon-url http://localhost:8080
# Or manually:
curl http://localhost:8080/health && \
echo "✓ Daemon is healthy - ready for demo!"