hypersdk

Feature Reference

This document provides a comprehensive overview of all features in the hypersdk interactive VM migration tool.

Table of Contents

Core Features

Interactive TUI

Full-featured Terminal User Interface built with Bubble Tea.

Capabilities:

Supported terminals:

VM Selection

Flexible VM selection with visual feedback.

Selection modes:

Selection persistence:

Migration Modes

Two execution modes for different use cases:

Terminal Mode (Interactive)

Systemd Service Mode (Background)

Multi-Provider Support

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

Advanced Features

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

Filtering

Power state filtering with easy toggling.

Filter options:

  1. All VMs (no filter)
  2. Powered ON only
  3. Powered OFF only

Use cases:

Implementation: O(n) filter pass, optimized with early exit

Sorting

Multi-criteria sorting with efficient algorithms.

Sort modes:

  1. Name - Alphabetical (A→Z)
  2. CPU - CPU count (descending)
  3. Memory - Memory size (descending)
  4. Storage - Disk size (descending)
  5. Power - Powered ON first, then OFF

Features:

Performance: O(n log n) using Go’s optimized sort.Slice

Algorithm: Introsort (combination of quicksort, heapsort, insertion sort)

Detail View

Comprehensive VM information display.

Information shown:

Actions:

Dry-Run Mode

Preview migrations without execution.

Features:

Use cases:

Performance Optimizations

Algorithmic Improvements

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:

Memory Optimization

Rendering Optimization

Security Features

Path Traversal Prevention

All filenames and paths sanitized before file operations.

Sanitization:

Protected operations:

Test coverage: 14 comprehensive security tests

Input Validation

All user inputs validated before processing.

Validations:

Credential Protection

Sensitive information never exposed.

Protections:

Example:

// Password never appears in logs or API responses
jd.Redacted()  // Returns copy with password = "***REDACTED***"

Concurrency Safety

All shared state protected from race conditions.

Synchronization:

Feature Matrix

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

Feature Interactions

Combined Filters

Multiple filters work together:

Search: "ubuntu" + Power: ON + Sort: Memory
  ↓
Shows: All powered-on Ubuntu VMs sorted by memory (largest first)

Filter Persistence

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

Sort Stability

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

Planned Features

Future enhancements under consideration:

See Also