hypersdk

HyperExport New Features

This document describes the new features added to HyperExport.

Table of Contents

  1. VM Information Display
  2. Snapshot Management
  3. Bandwidth Limiting
  4. Incremental Exports
  5. Email Notifications
  6. Export Cleanup

VM Information Display

Display detailed VM information without performing an export. Useful for inspecting VM specifications before export.

Features

Usage Examples

# Display VM information (pretty output)
hyperexport --vm-info --vm "MyVM"

# Display VM information (scripting-friendly key=value format)
hyperexport --vm-info --vm "MyVM" --quiet

# Check if VM is powered off before export
hyperexport --vm-info --vm "MyVM" | grep "poweredOff"

Command-Line Flags

Example Output

Pretty Output:

┌─ VM Information ───────────────────────────────────┐
│ Property      │ Value                              │
├───────────────┼────────────────────────────────────┤
│ 🖥️  VM Name   │ MyVM                               │
│ ⚡ Power State│ ● poweredOff                       │
│ 💿 Guest OS   │ Ubuntu Linux (64-bit)              │
│ 🧠 Memory     │ 8192 MB (8.0 GB)                   │
│ ⚙️  vCPUs     │ 4                                  │
│ 💾 Storage    │ 128.5 GB                           │
│ 📁 Path       │ /Datacenter/vm/production/MyVM     │
└────────────────────────────────────────────────────┘

Quiet Output:

name=MyVM
path=/Datacenter/vm/production/MyVM
power_state=poweredOff
guest_os=Ubuntu Linux (64-bit)
cpu=4
memory_mb=8192
storage_bytes=138047488000

Benefits


Snapshot Management

Create and manage VM snapshots for safe, consistent exports.

Features

Usage Examples

# Create snapshot before export and delete after
hyperexport --vm "MyVM" --snapshot --delete-snapshot

# Create snapshot with custom name
hyperexport --vm "MyVM" --snapshot --snapshot-name "pre-migration-backup"

# Include memory in snapshot
hyperexport --vm "MyVM" --snapshot --snapshot-memory

# Keep last 5 snapshots
hyperexport --vm "MyVM" --snapshot --keep-snapshots 5

# Consolidate all snapshots after export
hyperexport --vm "MyVM" --consolidate-snapshots

Command-Line Flags

Benefits


Bandwidth Limiting

Control download/upload bandwidth to prevent network saturation.

Features

Usage Examples

# Limit bandwidth to 10 MB/s
hyperexport --vm "MyVM" --bandwidth-limit 10

# Limit to 5 MB/s with 20 MB burst allowance
hyperexport --vm "MyVM" --bandwidth-limit 5 --bandwidth-burst 20

# Enable adaptive bandwidth (auto-adjusts based on network quality)
hyperexport --vm "MyVM" --adaptive-bandwidth

# Combine with cloud upload
hyperexport --vm "MyVM" --bandwidth-limit 10 --upload s3://my-bucket/backups

Command-Line Flags

How It Works

Fixed Limiting: Uses a token bucket algorithm to enforce a steady rate limit.

Adaptive Limiting: Monitors transfer success/error rates and automatically adjusts bandwidth between minimum and maximum speeds.

Benefits


Incremental Exports

Export only changed disks to save time and storage.

Features

Usage Examples

# Enable incremental export
hyperexport --vm "MyVM" --incremental

# Show incremental analysis without exporting
hyperexport --vm "MyVM" --incremental-info

# Force full export even if incremental is available
hyperexport --vm "MyVM" --force-full

# Incremental export with cloud upload
hyperexport --vm "MyVM" --incremental --upload s3://my-bucket/backups

Command-Line Flags

How It Works

  1. First Export: Full export of all disks, saves state
  2. Subsequent Exports: Compares current disks with saved state
  3. Change Detection: Checks disk sizes and checksums
  4. Selective Export: Only exports changed/new disks
  5. State Update: Updates state after successful export

Triggers for Full Export

Benefits


Email Notifications

Receive email notifications for export events.

Features

Usage Examples

# Enable email notifications
hyperexport --vm "MyVM" \
  --email-notify \
  --email-smtp-host smtp.gmail.com \
  --email-smtp-port 587 \
  --email-from export@example.com \
  --email-to admin@example.com \
  --email-username export@example.com \
  --email-password "your-password"

# Send email only on failure
hyperexport --vm "MyVM" \
  --email-notify \
  --email-on-start=false \
  --email-on-complete=false \
  --email-on-failure=true \
  --email-smtp-host smtp.gmail.com \
  --email-from export@example.com \
  --email-to admin@example.com

# Multiple recipients
hyperexport --vm "MyVM" \
  --email-notify \
  --email-to "admin@example.com,backup@example.com,ops@example.com"

Command-Line Flags

Email Templates

Start Notification:

Success Notification:

Failure Notification:

Supported SMTP Servers

Benefits


Export Cleanup

Automatically clean up old exports to manage disk space.

Features

Usage Examples

# Delete exports older than 30 days
hyperexport --cleanup --cleanup-max-age 720h  # 30 days

# Keep only last 10 exports
hyperexport --cleanup --cleanup-max-count 10

# Delete oldest when total size exceeds 100 GB
hyperexport --cleanup --cleanup-max-size 107374182400

# Preview cleanup without deleting
hyperexport --cleanup --cleanup-dry-run --cleanup-max-age 720h

# Run cleanup every 24 hours
hyperexport --cleanup-schedule 24h

# Combine age and count limits
hyperexport --cleanup --cleanup-max-age 720h --cleanup-max-count 20

Command-Line Flags

Cleanup Logic

  1. Age-based: Deletes exports older than max age
  2. Count-based: Deletes oldest exports beyond max count
  3. Size-based: Deletes oldest exports when total size exceeds limit
  4. Preserved exports: Never deleted (matched by pattern)

Benefits


Combining Features

All features can be combined for powerful export workflows:

# Complete automated backup
hyperexport --vm "ProductionDB" \
  --snapshot \
  --delete-snapshot \
  --incremental \
  --bandwidth-limit 20 \
  --email-notify \
  --email-smtp-host smtp.gmail.com \
  --email-from backups@company.com \
  --email-to ops@company.com \
  --upload s3://prod-backups/databases \
  --cleanup \
  --cleanup-max-age 720h \
  --cleanup-max-count 30

# Safe, throttled migration
hyperexport --vm "LegacyApp" \
  --snapshot \
  --snapshot-name "pre-migration-$(date +%Y%m%d)" \
  --bandwidth-limit 10 \
  --adaptive-bandwidth \
  --email-notify \
  --email-to migration-team@company.com \
  --verify

# Automated daily backups
hyperexport --vm "FileServer" \
  --daemon-schedule "daily-backup:0 2 * * *" \
  --snapshot \
  --incremental \
  --upload s3://daily-backups \
  --cleanup-schedule 24h \
  --cleanup-max-count 7

Best Practices

  1. Use snapshots for production VMs to ensure consistency
  2. Enable bandwidth limiting during business hours
  3. Use incremental exports for large VMs to save time/storage
  4. Set up email notifications for critical exports
  5. Enable cleanup to prevent disk space issues
  6. Test with dry-run before running automated cleanup
  7. Use profiles to save complex configurations
  8. Monitor with metrics API for production workloads

Troubleshooting

Snapshots fail to create

Bandwidth limiting too aggressive

Incremental exports not working

Email notifications not sending

Cleanup deleting wrong exports


Configuration Files

Save complex configurations as profiles:

# Create a profile
hyperexport --save-profile "production-backup" \
  --snapshot \
  --incremental \
  --bandwidth-limit 20 \
  --email-notify \
  --cleanup

# Use a profile
hyperexport --profile "production-backup" --vm "MyVM"

Environment Variables

Some settings can be configured via environment variables:

# Email configuration
export HYPEREXPORT_SMTP_HOST=smtp.gmail.com
export HYPEREXPORT_SMTP_PORT=587
export HYPEREXPORT_EMAIL_FROM=backups@company.com
export HYPEREXPORT_EMAIL_TO=ops@company.com

# Bandwidth limiting
export HYPEREXPORT_BANDWIDTH_LIMIT=20

# Cleanup settings
export HYPEREXPORT_CLEANUP_MAX_AGE=720h
export HYPEREXPORT_CLEANUP_MAX_COUNT=30

API Access

All features are also available through the daemon API:

# Submit job with all features
curl -X POST http://localhost:8080/api/v1/jobs \
  -H "Content-Type: application/json" \
  -d '{
    "vm_path": "/Datacenter/vm/MyVM",
    "output_path": "/exports/MyVM",
    "snapshot": true,
    "incremental": true,
    "bandwidth_limit_mbps": 20,
    "email_notify": true
  }'

Performance Impact

Feature CPU Impact Memory Impact Network Impact
Snapshots Low Low None
Bandwidth Limiting Very Low Very Low Controlled
Incremental Low Low Reduced
Email Very Low Very Low Minimal
Cleanup Low Low None

All features are designed to have minimal performance impact on the export process.