Pcornel
Automation · Hyper-V Automation

VHDX

Cheat sheet · https://pcornel.dk/topic.php?topic=5714

Back to the Topic

Answer

VHDX automation creates and changes virtual disks with New-VHD, Resize-VHD, Convert-VHD, Mount-VHD and Optimize-VHD, and attaches them with Add-VMHardDiskDrive.

Remember

  • New-VHD, Resize-VHD, Convert-VHD.
  • Resize may need the guest to extend partitions.
  • Optimize-VHD compacts dynamic disks.

First checks

  • New-VHD -Path <p> -SizeBytes 100GB -Dynamic — create
  • Resize-VHD -Path <p> -SizeBytes 200GB — grow
  • Get-VHD <p> — inspect

Verify in this order

VHDX operation → verify size/type

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5714

Confirmation

Confirm action

Continue?