Hyper-V Advanced: Snapshots, Live Migration and Resource Controls

5 min read

Advanced Hyper-V configuration: manage checkpoints, configure VM resources, enable nested virtualization, set memory weight and use PowerShell for VM automation.

Share:TelegramX

Beyond basic VM creation, Hyper-V has powerful features for resource management, automation and VM lifecycle control.


Checkpoint (Snapshot) Management

# Create checkpoint
Checkpoint-VM -VMName "TestVM" -SnapshotName "Before Update $(Get-Date -Format 'yyyy-MM-dd')"

# List checkpoints
Get-VMCheckpoint -VMName "TestVM" | Select-Object VMName, Name, CreationTime, ParentCheckpointName

# Restore checkpoint
Restore-VMCheckpoint -VMName "TestVM" -Name "Before Update 2026-06-18" -Confirm:$false

# Delete specific checkpoint
Remove-VMCheckpoint -VMName "TestVM" -Name "Before Update 2026-06-18"

# Delete all checkpoints
Get-VMCheckpoint -VMName "TestVM" | Remove-VMCheckpoint -Confirm:$false

Configure VM Resources

# CPU settings
Set-VMProcessor -VMName "TestVM" `
  -Count 4 `                          # number of virtual CPUs
  -Reserve 10 `                       # minimum % of physical CPU
  -Maximum 50 `                       # maximum % of physical CPU
  -RelativeWeight 100                 # priority vs other VMs

# Memory settings
Set-VMMemory -VMName "TestVM" `
  -DynamicMemoryEnabled $true `
  -MinimumBytes 512MB `
  -StartupBytes 2GB `
  -MaximumBytes 8GB `
  -Buffer 20 `                        # % extra to allocate
  -Priority 50                        # memory priority

# Add virtual disk
Add-VMHardDiskDrive -VMName "TestVM" `
  -Path "C:\VMs\TestVM-Data.vhdx"

# Resize virtual disk
Resize-VHD -Path "C:\VMs\TestVM.vhdx" -SizeBytes 100GB

Nested Virtualization

Run Hyper-V inside a Hyper-V VM (for testing container platforms):

# Enable nested virtualization for a VM
Set-VMProcessor -VMName "TestVM" -ExposeVirtualizationExtensions $true

# The VM must be off when enabling this
Stop-VM -VMName "TestVM"
Set-VMProcessor -VMName "TestVM" -ExposeVirtualizationExtensions $true
Start-VM -VMName "TestVM"

VM Automation Scripts

# Bulk VM status report
Get-VM | Select-Object Name, State, CPUUsage, MemoryAssigned, Uptime |
  Format-Table -AutoSize

# Start all stopped VMs
Get-VM | Where-Object {$_.State -eq "Off"} | Start-VM

# Scheduled checkpoint before updates
$action = New-ScheduledTaskAction -Execute "powershell.exe" `
  -Argument '-Command "Get-VM | Where-Object {$_.State -eq \"Running\"} | Checkpoint-VM -SnapshotName \"Auto-$(Get-Date -Format yyyyMMdd)\""'
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Sunday -At "01:00AM"
Register-ScheduledTask -TaskName "VMWeeklyCheckpoint" `
  -Action $action -Trigger $trigger -RunLevel Highest

Import and Export VMs

# Export VM to folder
Export-VM -Name "TestVM" -Path "D:\VM-Exports"

# Import VM
Import-VM -Path "D:\VM-Exports\TestVM\TestVM.vmcx"

# Copy VM (register from new location)
Import-VM -Path "D:\VM-Exports\TestVM\TestVM.vmcx" `
  -Copy -GenerateNewId `
  -VirtualMachinePath "C:\VMs\TestVM-Copy" `
  -VhdDestinationPath "C:\VMs\TestVM-Copy\Virtual Hard Disks"

VM Integration Services

# Check integration services status
Get-VMIntegrationService -VMName "TestVM" |
  Select-Object Name, Enabled, OperationalStatus

# Enable all integration services
Get-VMIntegrationService -VMName "TestVM" |
  Where-Object {-not $_.Enabled} |
  Enable-VMIntegrationService

# Key services:
# Heartbeat - VM health monitoring
# Time Synchronization - sync VM clock with host
# Guest Shutdown - graceful shutdown from host
# Data Exchange - KVP between host and guest

Summary

Use Production checkpoints for running VMs (VSS-based, data-consistent). Configure dynamic memory with min/max bounds. Enable nested virtualization for containers. Export VMs before major changes. Keep Integration Services updated and enabled.

Frequently Asked Questions

What's the difference between Standard and Production checkpoints?

Standard = memory state snapshot (like hibernate). Production = VSS-based backup (application-consistent, no memory state). Use Production for running databases and servers. Use Standard only for quick test/rollback scenarios.

Can I run Hyper-V VMs on Windows 11 Home?

No. Hyper-V requires Pro, Enterprise, or Education. Home users can use VirtualBox or VMware Workstation Player as free alternatives.

My VM won't start after restoring checkpoint — what to do?

Check if the checkpoint's .avhdx differencing disk is still present and linked. In Hyper-V Manager → Settings → verify all disk paths exist. Missing differencing disks cause VM to fail to start.

Related articles

💬 Leave a comment

Comments are moderated before publishing.

← All articles