Hyper-V Live Migration with Encrypted VHDX: Key Provisioning Limitation on Destination Hosts
0 reputation · 25 Feb 2024, 11:21 UTC
0 reputation · 25 Feb 2024, 11:21 UTC
Achieve zero-downtime Live Migration of a VM that uses an encrypted VHDX on Windows Server 2022 Hyper-V.
Live Migration of an encrypted VHDX succeeds only when the destination host already holds the identical encryption key in its DPAPI vault. Hyper-V does not transfer or generate the key during migration, and Storage Live Migration does not bypass this requirement. There is no built-in mechanism to synchronize keys automatically, so any key-provisioning step must be completed before the migration begins, introducing a potential operational gap.
30775 reputation · 25 Feb 2024, 14:05 UTC
The premise needs correcting before the three questions can be answered usefully: Hyper-V on Windows Server 2022 has no native VHDX encryption mode that stores a per-host key in a DPAPI vault, and Live Migration does not depend on such a key being present on the destination host. The correct provisioning answer depends entirely on which encryption layer is actually protecting the VHDX — guest-side BitLocker, a shielded VM, or BitLocker on the Cluster Shared Volume. Each behaves differently, and none requires manual DPAPI blob export/import.
The scenario as described — Hyper-V encrypting a VHDX with a DPAPI key that must exist on the destination — does not match documented Hyper-V behavior. What is well established:
For shielded VMs, the supported method is to enroll the destination host in the same guarded fabric: configure it as a guarded host pointing at the same HGS (or a trusted HGS) and ensure it passes attestation. HGS then releases the Key Protector to that host on demand — there is no manual export/import step. Verify with:
Get-HgsClientConfiguration
Get-VMKeyProtector -VMName <vm>Confirm the destination shows healthy attestation against the same HGS before migrating. For guest-side BitLocker or CSV BitLocker, no pre-provisioning exists because none is needed.
HGS is the native key-distribution mechanism for shielded VMs — that is its design purpose. For CSV BitLocker, the cluster itself manages protectors (check with Get-BitLockerVolume on a cluster node). There is no separate PowerShell cmdlet that pushes encryption keys between hosts, because the architecture deliberately avoids hosts holding portable keys.
If the encryption genuinely comes from a third-party or custom VHDX tool using per-machine DPAPI keys, then no native Hyper-V or cluster feature synchronizes those keys — the vendor's key-management tooling is the only path, and zero-downtime migration requires the key to already exist on the target before migration starts. That is a vendor limitation, not a Hyper-V gap. For the native mechanisms above, no fallback is needed: attested guarded hosts migrate shielded VMs live by design.
manage-bde -status to see whether BitLocker is guest-side.Get-HgsClientConfiguration and Get-VMKeyProtector to detect a shielded VM configuration.Get-BitLockerVolume on the CSV owner node.Two cautions: shielded VMs require Datacenter edition, and admin-trusted attestation is deprecated in favor of TPM-trusted attestation — verify which mode your HGS uses. Also, migration of a shielded VM to a host outside the trusted fabric fails by design; that is the security boundary working, not a bug to route around.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.