Complete integration of HyperSDK with hyper2kvm systemd daemon for production deployments. This provides automatic VM conversion through a queue-based system with full systemd management.
Files: providers/common/pipeline.go, providers/vsphere/export_options.go, providers/vsphere/export.go
systemctl is-activehyper2kvm@vsphere.service)File: cmd/hyperexport/main.go
Added 6 command-line flags:
--hyper2kvm-daemon # Enable daemon mode
--hyper2kvm-instance <name> # Instance name
--hyper2kvm-watch-dir <path> # Watch directory
--hyper2kvm-output-dir <path> # Output directory
--hyper2kvm-poll-interval <sec> # Poll interval (default: 5)
--hyper2kvm-daemon-timeout <min># Timeout (default: 60)
Usage Example:
hyperexport --vm "Ubuntu-Server" \
--output /tmp/export \
--manifest \
--pipeline \
--hyper2kvm-daemon \
--hyper2kvm-instance vsphere
File: cmd/hyperexport/interactive_huh.go
Features:
File: web/dashboard-react/src/components/JobSubmissionForm.tsx
JSON Example:
{
"name": "Ubuntu Server Migration",
"vm_path": "/DC1/vm/ubuntu-server",
"options": {
"enable_pipeline": true,
"hyper2kvm_daemon": true,
"hyper2kvm_instance": "vsphere",
"hyper2kvm_watch_dir": "/var/lib/hyper2kvm/vsphere/queue",
"hyper2kvm_output_dir": "/var/lib/hyper2kvm/vsphere/output",
"hyper2kvm_poll_interval": 5,
"hyper2kvm_daemon_timeout": 60
}
}
Files: cmd/hyperctl/daemon_commands.go, cmd/hyperctl/main.go
New hyperctl daemon commands:
# Show status of all daemon instances
hyperctl daemon -op status
# Show specific instance status
hyperctl daemon -op status -instance vsphere
# List all daemon instances
hyperctl daemon -op list
Output Includes:
Directory: systemd/
Production-ready systemd service files with security hardening:
hyper2kvm userinstall.sh - Automated deployment:
# Install default instance
sudo systemd/install.sh
# Install named instance
sudo systemd/install.sh --instance vsphere
# Uninstall
sudo systemd/install.sh --uninstall
Features:
systemd/README.md - Complete deployment guide:
┌─────────────────────────────────────────────┐
│ 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 │
└──────────────┘
| 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) |
# Start daemon
sudo systemctl enable --now hyper2kvm.service
# HyperSDK auto-detects and uses daemon
hyperexport --vm test-vm --output /tmp/test \
--pipeline --hyper2kvm-daemon
# Start instances
sudo systemctl start hyper2kvm@vsphere.service
sudo systemctl start hyper2kvm@aws.service
sudo systemctl start hyper2kvm@azure.service
# Route to specific instance
hyperexport --provider vsphere --vm test-vm \
--pipeline --hyper2kvm-daemon \
--hyper2kvm-instance vsphere
# Server 1: Export only (no daemon)
hyperexport --vm test-vm \
--output /mnt/nfs/queue \
--manifest \
--pipeline=false
# Server 2: Daemon watches NFS-mounted queue
sudo systemctl start hyper2kvm.service
# Config: watch_dir=/mnt/nfs/queue, output_dir=/mnt/nfs/output
systemctl status, journalctl integrationhyper2kvm user with restricted permissionshyperexport --vm test-vm --output /tmp/test --pipeline
# With daemon running
hyperexport --vm test-vm --output /tmp/test \
--pipeline --hyper2kvm-daemon
# Without daemon (should auto-fallback)
sudo systemctl stop hyper2kvm.service
hyperexport --vm test-vm --output /tmp/test \
--pipeline --hyper2kvm-daemon
# Check status
hyperctl daemon -op status
sudo systemctl status hyper2kvm.service
# View logs
sudo journalctl -u hyper2kvm.service -f
# Check queue and output
ls -lh /var/lib/hyper2kvm/queue/
ls -lh /var/lib/hyper2kvm/output/
All work has been committed to git:
SYSTEMD_DAEMON_INTEGRATION.mdcmd/hyperexport/interactive_huh.gocmd/hyperexport/main.gocmd/hyperctl/main.godaemon/models/job.goproviders/common/pipeline.goproviders/vsphere/export.goproviders/vsphere/export_options.goweb/dashboard-react/src/components/JobSubmissionForm.tsxgo.mod, go.sum (dependencies)cmd/hyperctl/daemon_commands.gosystemd/README.mdsystemd/hyper2kvm.servicesystemd/hyper2kvm@.servicesystemd/hyper2kvm.targetsystemd/hyper2kvm.conf.examplesystemd/hyper2kvm-vsphere.conf.examplesystemd/hyper2kvm-aws.conf.examplesystemd/install.shDAEMON_INTEGRATION_COMPLETE.md (this file)The hyper2kvm systemd daemon integration is feature-complete for production use. All high and medium priority tasks have been implemented:
✅ Core pipeline integration with auto-detection ✅ CLI flags for daemon configuration ✅ Interactive TUI with daemon options ✅ Web dashboard UI components ✅ Daemon management commands (hyperctl) ✅ Production systemd unit files ✅ Automated installation script ✅ Comprehensive documentation
The implementation provides a robust, secure, and scalable solution for deploying hyper2kvm as a system daemon, with full integration across all HyperSDK interfaces (CLI, TUI, and Web).
Date: 2026-01-24 Version: 1.0.0 Status: ✅ Complete