CRITICAL INFRA
Loading critical CVEs…
ALL EXPLOITED
Loading…

Physical to Hyper-V migration (P2V) — what it involves

Physical to Hyper-V migration (P2V) seems simple until you realize there are 12 pitfalls that can ruin your weekend.

Proper P2V implementation phases

What we deliver

Functional VM in production with better performance than original, new backup agent, integrated monitoring, complete documentation, DR runbook.

Example: P2V with Disk2VHD

Converting a physical Windows server into a Hyper-V Gen2 VM:

# 1. P2V cu Disk2VHD (Sysinternals) — VHDX pt Gen2
disk2vhd.exe C: D: C:\out\server.vhdx -accepteula

# 2. creaza VM Gen2 in Hyper-V (PowerShell)
New-VM -Name 'SRV-MIG' -Generation 2 -MemoryStartupBytes 8GB `
  -VHDPath 'D:\VMs\server.vhdx' -SwitchName 'vSwitch'

# 3. la primul boot: sterge driverele fantoma de pe hardware-ul vechi
#    (Device Manager -> Show hidden devices -> uninstall)

P2V step by step (Disk2VHD)

You capture the physical server's disks into a VHDX:

# CLI, VHDX pt Gen2, fara volume shadow blocante
disk2vhd.exe C: D: C:\out\srv.vhdx -accepteula
# creezi VM Gen2 in Hyper-V
New-VM -Name SRV-MIG -Generation 2 -MemoryStartupBytes 8GB `
  -VHDPath D:\VMs\srv.vhdx -SwitchName vSwitch
Set-VMProcessor SRV-MIG -Count 4

Driver cleanup + boot fix

On first boot you remove ghost drivers and fix boot if needed:

# in VM (Windows), arata si scoate device-urile ascunse de pe HW-ul vechi
set DEVMGR_SHOW_NONPRESENT_DEVICES=1
start devmgmt.msc    # View -> Show hidden devices -> uninstall
# reparare boot UEFI daca nu porneste
bcdboot C:\Windows /s S: /f UEFI

Hyper-V cluster (real HA)

You put the VM in a failover cluster to survive a node failure:

Install-WindowsFeature Failover-Clustering -IncludeManagementTools
Test-Cluster -Node srv1,srv2
New-Cluster -Name HV-CL -Node srv1,srv2 -StaticAddress 10.0.0.50
# Storage Spaces Direct (hyperconverged)
Enable-ClusterStorageSpacesDirect
Add-ClusterVirtualMachineRole -VMName SRV-MIG

Post-migration performance check

You confirm the VM runs well, not just boots:

Get-VM SRV-MIG | Get-VMProcessor
Get-Counter '\Hyper-V Hypervisor Virtual Processor(*)\% Guest Run Time'
# integrare services + dynamic memory
Get-VMIntegrationService SRV-MIG
Set-VMMemory SRV-MIG -DynamicMemoryEnabled $true -MinimumBytes 2GB -MaximumBytes 16GB
Let's discuss your project →