This document provides a comprehensive overview of all features in the hypersdk interactive VM migration tool.
Full-featured Terminal User Interface built with Bubble Tea.
Capabilities:
Supported terminals:
Flexible VM selection with visual feedback.
Selection modes:
Selection persistence:
Two execution modes for different use cases:
Connect to vCenter via multiple methods:
Daemon API:
hyperctl migrate --daemon http://localhost:8080
Direct Connection (Environment Variables):
export GOVC_URL='https://vcenter/sdk'
export GOVC_USERNAME='user@vsphere.local'
export GOVC_PASSWORD='password'
export GOVC_INSECURE=1
hyperctl migrate
Case-insensitive full-text search across VM properties.
Search targets:
Features:
Performance: O(n) linear scan, instant for 1000+ VMs
Example searches:
ubuntu → Finds all Ubuntu VMs
web-server → Finds VMs with "web-server" in name
/production/ → Finds VMs in production folder
windows server → Finds Windows Server VMs
Power state filtering with easy toggling.
Filter options:
Use cases:
Implementation: O(n) filter pass, optimized with early exit
Multi-criteria sorting with efficient algorithms.
Sort modes:
Features:
Performance: O(n log n) using Go’s optimized sort.Slice
Algorithm: Introsort (combination of quicksort, heapsort, insertion sort)
Comprehensive VM information display.
Information shown:
Actions:
d or i keysPreview migrations without execution.
Features:
r keyUse cases:
All operations optimized for large-scale deployments:
| Operation | Old | New | Improvement |
|---|---|---|---|
| Sorting | O(n²) bubble sort | O(n log n) introsort | 15-100x faster |
| Bulk select | O(n×m) nested loops | O(n) map lookup | 33x faster |
| Filter+sort | Multiple passes | Single pass | 2x faster |
Benchmarks:
100 VMs:
1,000 VMs:
All filenames and paths sanitized before file operations.
Sanitization:
.. sequences\x00Protected operations:
Test coverage: 14 comprehensive security tests
All user inputs validated before processing.
Validations:
Sensitive information never exposed.
Protections:
json:"-")Example:
// Password never appears in logs or API responses
jd.Redacted() // Returns copy with password = "***REDACTED***"
All shared state protected from race conditions.
Synchronization:
| Feature | Status | Performance | Test Coverage |
|---|---|---|---|
| Search | ✅ | O(n) | 7 tests |
| Filter (power) | ✅ | O(n) | 4 tests |
| Sort (all modes) | ✅ | O(n log n) | 8 tests |
| Bulk select/deselect | ✅ | O(n) | 4 tests |
| Detail view | ✅ | O(1) | 3 tests |
| Dry-run mode | ✅ | N/A | 2 tests |
| Path sanitization | ✅ | O(n) | 14 tests |
| Credential protection | ✅ | O(1) | 2 tests |
| Concurrent job management | ✅ | O(1) | 6 tests |
Total test coverage: 50+ tests across all features
Multiple filters work together:
Search: "ubuntu" + Power: ON + Sort: Memory
↓
Shows: All powered-on Ubuntu VMs sorted by memory (largest first)
Selections persist across operations:
1. Search "web" → Select all (3 VMs selected)
2. Clear search → Still shows 3 selected
3. Filter "power: ON" → Still shows 3 selected (may be visible or hidden)
4. Select all visible → Adds to existing selection
When values are equal, secondary sort by name:
Sort by CPU:
VM-A (8 CPU) ← First
VM-C (4 CPU) ← Before VM-D (both 4 CPU, but A < D alphabetically)
VM-D (4 CPU)
VM-B (2 CPU) ← Last
Future enhancements under consideration: