The hyperctl migrate command provides an intuitive, terminal-based UI for selecting and migrating VMs from multiple cloud providers to KVM.
Interactive migration mode allows you to:
# Launch interactive mode
hyperctl migrate
# With custom output directory
hyperctl migrate -output /migrations
# Skip auto-conversion
hyperctl migrate -convert=false
# With libvirt import (requires libvirt setup)
hyperctl migrate -import
๐ Interactive VM Migration Tool
๐ Total VMs: 201 | โ
Selected: 3
โถ [โ] rhel9.4 | ON | 2 CPU | 4.0 GB | 90 GB
[ ] win2022 | OFF | 4 CPU | 8.0 GB | 120 GB
[โ] ubuntu22.04 | ON | 2 CPU | 4.0 GB | 50 GB
...
โ/k: up | โ/j: down | Space: select | a: select all | n: deselect all | Enter: confirm | q: quit
Navigation Keys:
โ or k - Move upโ or j - Move downSpace - Toggle selectiona - Select all VMsn - Deselect all VMsEnter - Confirm selection and proceedq or Ctrl+C - QuitAfter selecting VMs, youโll see a detailed summary:
๐ Confirm Migration
Selected VMs for migration:
๐ฆ rhel9.4
Path: /data/vm/rhel9.4
Power: poweredOn | CPU: 2 | Memory: 4.0 GB | Storage: 90 GB
OS: Red Hat Enterprise Linux 9 (64-bit)
๐ฆ ubuntu22.04
Path: /data/vm/ubuntu22.04
Power: poweredOn | CPU: 2 | Memory: 4.0 GB | Storage: 50 GB
OS: Ubuntu Linux (64-bit)
๐ Migration Summary
Total Resources:
๐ฅ๏ธ Total CPUs: 4
๐พ Total Memory: 8.0 GB
๐ฟ Total Storage: 140 GB
โ๏ธ Export Settings
Output Directory: /tmp/vm-migrations
Auto-convert to qcow2: Yes โ
Auto-import to libvirt: No
๐ Start migration?
y: Yes, start migration | n: No, go back | Esc/b: Back to selection | q: Quit
Confirmation Keys:
y or Y - Start migrationn or N - Cancel and go back to selectionEsc or b - Back to selection screenq or Ctrl+C - Quit๐ฆ Exporting VMs
Progress: 1 / 3
โ rhel9.4
โ ubuntu22.04
debian12
๐ Converting VMDKs to qcow2...
โ
Migration Complete!
๐ rhel9.4 โ /tmp/vm-migrations/rhel9.4
๐ ubuntu22.04 โ /tmp/vm-migrations/ubuntu22.04
| Option | Default | Description |
|---|---|---|
-output |
/tmp/vm-migrations |
Directory to save exported VMs |
-convert |
true |
Auto-convert VMDK to qcow2 |
-import |
false |
Auto-import to libvirt |
-daemon |
http://localhost:8080 |
Daemon URL |
Export to custom directory:
hyperctl migrate -output /var/lib/libvirt/images
Export only (no conversion):
hyperctl migrate -convert=false -output /exports
Full automation (export, convert, import):
hyperctl migrate -output /migrations -import
flowchart TD
Start([Launch hyperctl migrate]) --> Select[Select VMs<br/>โ/โ Navigate<br/>Space to select<br/>Enter to continue]
Select --> Review[Review & Confirm<br/>VM details<br/>Resource totals<br/>Export settings]
Review -->|Press 'y'| Export[Automated Export<br/>VDDK parallel downloads<br/>Real-time progress]
Review -->|Press 'n'/Esc| Select
Export --> CheckConvert{Conversion<br/>enabled?}
CheckConvert -->|Yes| Convert[Automated Conversion<br/>VMDK โ QCOW2<br/>qemu-img convert]
CheckConvert -->|No| CheckImport
Convert --> CheckImport{Import<br/>enabled?}
CheckImport -->|Yes| Import[Import to libvirt<br/>virt-install<br/>Network & storage config]
CheckImport -->|No| Done([Migration Complete])
Import --> Done
style Start fill:#4CAF50,stroke:#2E7D32,color:#fff
style Select fill:#2196F3,stroke:#1565C0,color:#fff
style Review fill:#2196F3,stroke:#1565C0,color:#fff
style Export fill:#FF9800,stroke:#E65100,color:#fff
style Convert fill:#9C27B0,stroke:#6A1B9A,color:#fff
style Import fill:#009688,stroke:#00695C,color:#fff
style Done fill:#4CAF50,stroke:#2E7D32,color:#fff
style CheckConvert fill:#FFC107,stroke:#F57C00,color:#000
style CheckImport fill:#FFC107,stroke:#F57C00,color:#000
Detailed Steps:
hyperctl migrate -output /migrations
j/kSpace to select/deselecta to select all matching criteriaEnter when readyy to confirm or n/Esc to go back{output-dir}/{vm-name}/qemu-img convertvirt-installAfter migration, files are organized as:
/migrations/
โโโ rhel9.4/
โ โโโ rhel9.4.ovf # OVF descriptor
โ โโโ rhel9.4.vmdk # Original VMDK
โ โโโ rhel9.4.qcow2 # Converted qcow2
โ โโโ rhel9.4.mf # Manifest
โโโ ubuntu22.04/
โ โโโ ubuntu22.04.ovf
โ โโโ ubuntu22.04.vmdk
โ โโโ ubuntu22.04.qcow2
โ โโโ ubuntu22.04.mf
โโโ ...
# Scenario: Migrate 5 dev VMs to local KVM
hyperctl migrate -output /dev-vms
# In interactive mode:
1. Filter to dev VMs visually
2. Select all 5 VMs with spacebar
3. Confirm migration
4. Wait for completion
5. VMs ready at /dev-vms/
# Scenario: Migrate specific production VMs
hyperctl migrate -output /prod-migration
# In interactive mode:
1. Browse all VMs
2. Carefully select only target VMs
3. Review total resources
4. Confirm settings
5. Monitor export progress
# Scenario: Export VMs for archival (no conversion)
hyperctl migrate -output /archives -convert=false
# In interactive mode:
1. Select VMs to archive
2. Export only (no conversion)
3. VMDKs saved with OVF descriptors
iftop -i eth0df -h /migrationsa to select all, then deselect unwanted VMsEsc or b anytime in confirmationCause: Daemon not connected to vCenter
Solution:
# Check daemon status
sudo systemctl status hypervisord
# Check daemon logs
sudo journalctl -u hypervisord -f
# Verify vCenter credentials
echo $GOVC_URL
Cause: Various (network, permissions, storage)
Solution:
# Check daemon logs for specific error
sudo journalctl -u hypervisord -n 100
# Verify network connectivity
ping vcenter.example.com
# Check disk space
df -h /migrations
# Retry with same selections
hyperctl migrate
Cause: qemu-img not installed or disk space
Solution:
# Install qemu-img
sudo dnf install qemu-img # Fedora/RHEL
sudo apt install qemu-utils # Ubuntu/Debian
# Check disk space
df -h /migrations
# Manually convert if needed
qemu-img convert -f vmdk -O qcow2 input.vmdk output.qcow2
Cause: libvirt not configured or permissions
Solution:
# Verify libvirt running
sudo systemctl status libvirtd
# Check permissions
sudo usermod -aG libvirt $USER
# Test libvirt connection
virsh list --all
# Manual import
virt-install --import --disk /migrations/vm/disk.qcow2 ...
| Key | Action |
|โโ|โโโ|
| โ / k | Move cursor up |
| โ / j | Move cursor down |
| Space | Toggle selection |
| a | Select all |
| n | Deselect all |
| Enter | Proceed to confirmation |
| q / Ctrl+C | Quit |
| Key | Action |
|โโ|โโโ|
| y / Y | Confirm and start |
| n / N | Cancel |
| Esc / b | Back to selection |
| q / Ctrl+C | Quit |
First list VMs to understand whatโs available:
# See all VMs
hyperctl list
# Filter to specific VMs
hyperctl list -filter prod
Then launch interactive mode knowing what to look for.
Combine with shell scripting for automated workflows:
#!/bin/bash
# migrate-all.sh
# Set output directory
OUTPUT="/var/lib/migrations"
mkdir -p "$OUTPUT"
# Launch interactive mode
hyperctl migrate -output "$OUTPUT" -convert -import
# Post-migration verification
for vm_dir in "$OUTPUT"/*; do
if [ -f "$vm_dir/*.qcow2" ]; then
echo "โ
$(basename $vm_dir) migrated successfully"
else
echo "โ $(basename $vm_dir) migration failed"
fi
done
Monitor migration progress:
# Terminal 1: Run migration
hyperctl migrate
# Terminal 2: Monitor daemon
sudo journalctl -u hypervisord -f
# Terminal 3: Monitor resources
watch -n 1 'df -h /migrations; echo; iostat -x'
๐ Enjoy the Interactive Migration Experience!
The interactive mode makes VM migration simple, visual, and error-free. Happy migrating!