Integration of HyperSDK with hyper2kvm systemd daemon for production deployments. Provides automatic detection, queue-based submission, and fallback to direct execution.
┌─────────────────────────────────────────────┐
│ HyperSDK Export │
│ (vSphere, AWS, Azure, GCP, Hyper-V) │
└──────────────────┬──────────────────────────┘
│
▼
┌─────────────────────┐
│ Pipeline Executor │
│ detectDaemonMode() │
└──────┬──────────────┘
│
┌───────┴───────┐
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐
│ Direct Mode │ │ Daemon Mode │
│ │ │ │
│ Execute │ │ Submit to │
│ hyper2kvm │ │ watch dir │
│ binary │ │ │
└──────┬───────┘ └──────┬───────┘
│ │
│ ▼
│ ┌──────────────┐
│ │ systemd │
│ │ hyper2kvm │
│ │ daemon │
│ └──────┬───────┘
│ │
└────────┬───────┘
▼
┌──────────────┐
│ qcow2 Output │
│ + Libvirt │
└──────────────┘
providers/common/pipeline.go:
Hyper2KVMConfig daemon fieldsdetectDaemonMode() - systemctl detectionExecuteDirect() - original direct executionExecuteViaDaemon() - queue-based submissionproviders/vsphere/export_options.go:
daemon/models/job.go:
providers/vsphere/export.go:
cmd/hyperexport/main.go)
--hyper2kvm-daemon # Enable daemon mode
--hyper2kvm-instance <name> # Instance name (e.g., "vsphere-prod")
--hyper2kvm-watch-dir <path> # Watch directory (default: /var/lib/hyper2kvm/queue)
--hyper2kvm-output-dir <path> # Output directory (default: /var/lib/hyper2kvm/output)
--hyper2kvm-poll-interval <sec> # Poll interval (default: 5)
--hyper2kvm-daemon-timeout <min># Timeout (default: 60)
cmd/hyperexport/interactive_huh.go)
web/dashboard-react/src/components/JobSubmissionForm.tsx)
cmd/hyperctl/daemon_commands.go, cmd/hyperctl/main.go)
hyperctl daemon command with two operations:
hyperctl daemon -op status - Show status of all daemon instanceshyperctl daemon -op status -instance <name> - Show specific instance statushyperctl daemon -op list - List all daemon instancessystemd/ directory)
hyper2kvm.service - Default daemon instancehyper2kvm@.service - Template for named instanceshyper2kvm.target - Target to manage all instanceshyper2kvm.conf.example - Default configurationhyper2kvm-vsphere.conf.example - vSphere-specific confighyper2kvm-aws.conf.example - AWS-specific confighyper2kvm userinstall.sh script for automated deploymentREADME.md with:
| Option | Type | Default | Description |
|---|---|---|---|
Hyper2KVMDaemon |
bool | false | Enable daemon mode |
Hyper2KVMInstance |
string | ”” | Systemd instance name |
Hyper2KVMWatchDir |
string | /var/lib/hyper2kvm/queue |
Watch directory |
Hyper2KVMOutputDir |
string | /var/lib/hyper2kvm/output |
Output directory |
Hyper2KVMPollInterval |
int | 5 | Poll interval (seconds) |
Hyper2KVMDaemonTimeout |
int | 60 | Timeout (minutes) |
hyperexport --vm "Ubuntu-Server" \
--output /var/lib/libvirt/images/ubuntu \
--manifest \
--pipeline \
--hyper2kvm-path /usr/local/bin/hyper2kvm \
--libvirt
# Auto-detect daemon
hyperexport --vm "Ubuntu-Server" \
--output /tmp/export \
--manifest \
--pipeline \
--hyper2kvm-daemon
# Specific instance
hyperexport --vm "Ubuntu-Server" \
--output /tmp/export \
--manifest \
--pipeline \
--hyper2kvm-daemon \
--hyper2kvm-instance vsphere-prod
{
"name": "Ubuntu Server Migration",
"vm_path": "/DC1/vm/ubuntu-server",
"output_dir": "/tmp/export",
"format": "ova",
"options": {
"enable_pipeline": true,
"hyper2kvm_daemon": true,
"hyper2kvm_instance": "vsphere-prod",
"hyper2kvm_watch_dir": "/var/lib/hyper2kvm/vsphere-queue",
"hyper2kvm_output_dir": "/var/lib/hyper2kvm/vsphere-output",
"libvirt_integration": true
}
}
hyper2kvm_daemon option is enabledinstance specified: hyper2kvm@{instance}.servicehyper2kvm.servicesystemctl is-active {service}{watch_dir}/manifest.jsonpoll_interval seconds (default: 5s){output_dir}/{vm_name}.qcow2{output_dir}/{vm_name}.errordaemon_timeout minutes (default: 60m)# Start daemon
sudo systemctl enable --now hyper2kvm.service
# HyperSDK auto-detects and uses daemon
hyperexport --vm test-vm --output /tmp/test \
--pipeline --hyper2kvm-daemon
# vSphere instance
sudo systemctl start hyper2kvm@vsphere-prod.service
# Azure instance
sudo systemctl start hyper2kvm@azure-batch.service
# HyperSDK selects instance
hyperexport --provider vsphere --vm test-vm \
--pipeline --hyper2kvm-daemon \
--hyper2kvm-instance vsphere-prod
# Server 1: Export only (no daemon)
hyperexport --vm test-vm \
--output /mnt/nfs/queue \
--manifest \
--pipeline=false
# Server 2: Daemon watches NFS
# /etc/hyper2kvm/hyper2kvm.conf:
# watch_dir: /mnt/nfs/queue
# output_dir: /mnt/nfs/output
sudo systemctl start hyper2kvm.service
cmd/hyperexport/main.gocmd/hyperexport/interactive_huh.goJobSubmissionForm.tsxhyperctl daemon status)hyperctl daemon list)systemctl status, journalctl integrationhyper2kvm user# Test direct mode
hyperexport --vm test-vm --output /tmp/test --pipeline
# Test daemon mode (with daemon running)
hyperexport --vm test-vm --output /tmp/test \
--pipeline --hyper2kvm-daemon
# Test daemon mode (without daemon - should fallback)
sudo systemctl stop hyper2kvm.service
hyperexport --vm test-vm --output /tmp/test \
--pipeline --hyper2kvm-daemon
# Check daemon status with hyperctl
hyperctl daemon -op status # Show all instances
hyperctl daemon -op status -instance vsphere # Show specific instance
hyperctl daemon -op list # List all instances
# Start/stop daemon instances
sudo systemctl start hyper2kvm.service # Start default
sudo systemctl start hyper2kvm@vsphere.service # Start named instance
sudo systemctl stop hyper2kvm@vsphere.service # Stop named instance