Hyper-V host cache support boundaries for shared virtual hard disks
0 reputation · 08 Mar 2024, 01:38 UTC
0 reputation · 08 Mar 2024, 01:38 UTC
Hyper-V exposes a host-level cache for virtual hard disks that keeps read data in host memory to reduce I/O latency, separate from any guest file-system cache. For shared virtual hard disks used in guest failover clusters, documented guidance has historically advised disabling this host cache because concurrent access from multiple hosts can return stale data or cause corruption.
The unresolved question is whether read-only host cache is safe for VHDs attached to multiple VMs on a single host or across live-migration boundaries. Current guidance is to disable it, but the exact coherence semantics are not fully specified. Enforcement of host-cache restrictions and default values varies by Windows Server build and by whether the VM uses VHDX shared access or the newer VHD Set format, making the support boundary version-sensitive.
Because stale-cache symptoms may appear only under concurrent I/O or after migration, a single-VM test may not reveal the issue. Is read-only host cache considered safe for VHDs attached to multiple VMs on one host, or does the documented restriction apply only to cross-host shared access? How does the platform enforce host-cache settings differently between a standard shared VHDX and a VHD Set across Windows Server builds? What verification is required to confirm whether host cache is ignored, disabled, or unsupported for a given shared-disk configuration?
Read-only host cache is not considered safe for a virtual hard disk shared by multiple VMs on a single host merely because access is local. The shared-disk restriction concerns cache coherence under concurrent attachment, not only cross-host access. Documented Hyper-V guidance for guest failover-cluster shared virtual hard disks is to disable host caching; enabling it risks stale reads or corruption when any attached VM writes. Until documentation for your exact Windows Server build explicitly permits it, treat both standard shared VHDX and VHD Set (.vhds/.avhdx) as unsafe for host caching.
The cache is not coherent with I/O issued by other VMs on the same host, and it is not transferred to a destination host during live migration. VM2 can therefore read stale data written by VM1 through the cache. If the disk is truly immutable and never written by any host or guest, staleness is not a risk; that is not the typical shared cluster-disk case.
Enforcement varies by Windows Server build and by disk format. I do not have a confirmed build-level matrix showing whether Hyper-V ignores, disables, or rejects host cache for standard shared VHDX or VHD Set. Absence of a cache option in VHD Set is not proof that caching is safe. Treat this section as requiring review against your specific build.
Get-VMHardDiskDrive -VMName <VMName> | Select-Object Path, ControllerType, ControllerNumber, ControllerLocation. This verifies the shared attachment, not the cache state.What Windows Server build and disk format (standard shared VHDX or VHD Set) are you using? That determines whether host cache is ignored, disabled, or unsupported, and it changes the recommendation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.