Skip to content

tcdoverlord/hyperv-backup-bootstrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HV-LazyBackup (Bootloader System)

HV-LazyBackup Architecture Demo


Important Concept

HV-LazyBackup is a bootloader / unpacker engine. You run one setup script, and it generates the complete Hyper-V backup runtime system.

The bootloader is for installation. The generated runtime scripts are for daily use.


Only Entry File

.\HV_LazyBackup_Bootstrap_Setup.ps1

The bootloader:

  • Detects Hyper-V and lists available VMs.
  • Lets you choose the target VM.
  • Lets you choose a safe backup drive.
  • Excludes C:\ and any drive that hosts the selected VM's virtual disks from backup drive choices.
  • Generates config, folders, scripts, helper module, logs, reports, and runtime docs.
  • Validates every generated PowerShell file before finishing.
  • Fails clearly if generation fails.

Generated System

Default install path:

C:\HV-LazyBackup\
|-- config.json
|-- README.md
|-- logs\
|   `-- log.txt
|-- reports\
|-- modules\
|   `-- VM-Helpers.psm1
`-- scripts\
    |-- Backup-VM.ps1
    |-- Verify-Backup.ps1
    |-- Check-VMState.ps1
    |-- Export-VMState.ps1
    `-- Helpers.ps1

Installation

Open PowerShell as Administrator on a Hyper-V host:

cd <REPO_FOLDER>
.\HV_LazyBackup_Bootstrap_Setup.ps1

Follow the prompts for install path, VM selection, and backup drive.


Daily Operation

Open PowerShell as Administrator:

cd C:\HV-LazyBackup
.\scripts\Backup-VM.ps1

That opens the daily operation menu:

1. Run Backup Now
2. Verify Last Backup
3. View Backup History
4. Check VM State
5. Export VM State Report
6. Open Logs
7. Change Backup Drive
8. Settings / Configuration
9. Exit

Direct Commands

Run backup without the menu:

.\scripts\Backup-VM.ps1 -RunBackup

Verify backups:

.\scripts\Verify-Backup.ps1

Check VM state:

.\scripts\Check-VMState.ps1

Export a VM state report:

.\scripts\Export-VMState.ps1

Backup Drive Override

The configured backup root comes from config.json.

The bootloader and runtime menu only allow safe backup drives. C:\ and the drive or drives where the selected VM stores its virtual disks are blocked.

To change the saved default backup drive, use option 7. Change Backup Drive in the generated menu:

.\scripts\Backup-VM.ps1

To temporarily use another safe selected drive:

.\scripts\Backup-VM.ps1 -RunBackup -BackupDrive X
.\scripts\Verify-Backup.ps1 -BackupDrive X

That uses:

X:\VM_MASTER_BACKUP

Backup Output

<SELECTED_DRIVE>:\VM_MASTER_BACKUP\VM-NAME-MASTER-TIMESTAMP\

Example:

X:\VM_MASTER_BACKUP\GrizTechW-MASTER-2026-06-16_12-03\
    .vhdx
    .vmcx
    .vmrs

Safety Layer

  • Admin expected.
  • Hyper-V discovery and VM validation.
  • C:\ backup drive blocked.
  • VM storage drive blocked as a backup target.
  • Unsafe drives are hidden from backup drive selection.
  • Safe VM stop before export.
  • Generated file validation.
  • Runtime logging.
  • Backup verification checks for .vhdx.
  • VM state reports.

Status

Release-Safe Bootloader System v1.3


Author

TCDOverLord

About

Release-safe Hyper-V backup automation framework with VM selection, drive selection, safe export, and backup verification.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors