Recently, I ran into challenges backing up my MicroK8S cluster hosted on HyperV (essentially, my desktop workstation). While searching for backup tools for Windows, I found that most consumer-grade solutions—including Ashampoo Backup—are lacking, particularly for robust S3 support.

Looking for automation and affordability, I shifted focus to VM-level backups. HyperV’s built-in export feature allows exporting VMs during runtime (without halting services), making it ideal for disaster recovery scenarios.

Harnessing PowerShell—alongside cloud-native utilities and the power of WinRAR for reliable, recoverable compression—I organized an end-to-end workflow. It automates VM export, compresses backups efficiently, and pushes them to AWS S3 Glacier, retaining snapshots for 90 days using lifecycle rules and bucket versioning.

Technical Solution#

HyperV diagram

  • HyperV VM Export: The key advantage here is backing up live VMs—no service interruptions required. Scheduling PowerShell scripts via Windows Task Scheduler automates the entire routine.
  • Compression with WinRAR: WinRAR provides superior compression versus ZIP, plus a recovery record to mitigate file corruption risks. This ensures backup archive reliability.
  • AWS S3 Upload & Retention: Exported and compressed backups are pushed to AWS S3, specifically to Glacier for cost-efficient long-term storage. Retention is managed with S3 lifecycle policies, keeping files for 90 days and seamlessly transitioning to Glacier.
  • Automated Notifications: Integration with AWS Simple Notification Service (SNS) sends completion alerts, keeping administrators informed of backup successes or failures. This means instant awareness of system health after backup jobs run.

AWS Configuration#

HyperV diagram

A little initial effort with AWS setup is needed:

How to Prepare#

  • Find your VM name in HyperV Manager for reference.
  • Install WinRAR for compression features.
  • Set up an SNS topic and subscribe your email for backup notifications.
  • Create an S3 bucket with appropriate lifecycle settings.

Example PowerShell Snippet#

Configure your backup variables and script as below:

# Example snippet for backup setup
$VMName = "YourVM"
$ExportPath = "C:\backups"
$RarFileName = "yourvm"
$RarFileNameWithDate = "$RarFileName-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
$S3Bucket = "hyperv-backup-s3"
$SNSArn = "arn:aws:sns:eu-west-1:xxxx:Backup"
$daysToKeep = 90
$WinRARExe = "C:\Program Files\WinRAR\rar.exe"
$RecoveryRecordSize = "5%"

Full script example: PowerShell backup script on Gist

Conclusion#

This streamlined workflow isn’t enterprise-grade, but for small-scale clusters and home labs, it offers fast, reliable disaster recovery. You avoid downtime, gain cost-efficient offsite backups, and stay informed about backup health—all with standard tools and modest cloud costs.