Use this when using dynamically expanding VHDX disks.
Dynamic VHDX
A dynamic VHDX starts small and grows as the guest writes data, up to its maximum size. It saves space and performs close to fixed disks on VHDX, but the host volume must have room for growth.
1. Dynamic VHDX grows on write.
2. Default and efficient; performance close to fixed on modern Hyper-V.
3. Overcommit can fill the volume — monitor.
4. Compact after deleting data.
5. Trim from guests.
write → VHDX grows → volume fills
Context & applicabilityCommon mistakes · platform/version boundaries
- Total maximum size of dynamic disks larger than the volume, with no alerts.
- VMs paused because the host volume is full ("Paused-Critical").
- Compacting while the VM is running.
Operational reference
Fast context before you go deeper.
Get-VHD -Path D:\VMs\app.vhdx | Select Size,FileSize,MinimumSizeVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
Get-VHD -Path D:\VMs\app.vhdx | Select Size,FileSize,MinimumSize
Get-Volume -DriveLetter D | Select SizeRemaining
Sum the maximum sizes of dynamic disks on a volume and compare with its capacity.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- They grow as data is written.
- Host volume must have space for growth.
- Performance is close to fixed on VHDX.
New-VHD -Path <p> -SizeBytes 100GB -Dynamic— create dynamicGet-VHD <p> | fl FileSize,Size— actual vs maxOptimize-VHD <p> -Mode Full— compact (offline)
ReferenceHow it works1 section · depth on demand
Watch out for
- The host volume can fill up as dynamic disks grow, pausing every VM on it. Monitor free space.
- Deleted data inside the guest does not shrink the file automatically; use
Optimize-VHD(with TRIM/UNMAP enabled). Get-VHDshowsFileSize(on disk) vsSize(maximum).
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
A dynamic VHDX grows in blocks (default 32 MB) as the guest writes; deleted data inside the guest is returned only through TRIM/UNMAP (SCSI controller, supported guest OS) or manual compaction.
Get-VHD -Path vm.vhdx | Select Size,FileSize,MinimumSize
Optimize-VHD -Path vm.vhdx -Mode Full
Risk: the sum of dynamic disk sizes can exceed the volume. When the host volume fills, every VM with a growing disk is paused (Paused-Critical). Monitor free space per CSV/volume against the provisioned total.
Compacting
Mount-VHD -Path D:\VMs\app.vhdx -ReadOnly
Optimize-VHD -Path D:\VMs\app.vhdx -Mode Full
Dismount-VHD -Path D:\VMs\app.vhdx
Documented example, not captured output. Run TRIM/defrag inside the guest first so free blocks are released. VHDX files do not shrink automatically.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hypervisor Storage → Hyper-V Storage → Dynamic VHDX. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://pve.proxmox.com/pve-docs/chapter-pvesm.html · confidence 94%