Dmitry Porotnikov / Check if two Azure VMs are on the same physical host

Created Thu, 24 Jul 2025 00:00:00 +0000 Modified Thu, 24 Jul 2025 00:00:00 +0000
108 Words

Check if two Azure VMs are on the same physical host

Have you ever wondered if your Azure workloads are located on the same physical host? Imagine you’re facing a strange issue, and after checking everything on your end, you notice that only a subset of virtual machines is affected. Could the Azure host be the culprit? Maybe, maybe not. Should you re-deploy?

Fortunately, you can check whether two VMs are located on the same host using the good old Hyper-V Data Exchange protocol. 👉 Microsoft Documentation

For Windows:

$regPath = "HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters"
$hostName = Get-ItemProperty -Path $regPath -Name "PhysicalHostName"
$hostName.PhysicalHostName

For Linux:

strings /var/lib/hyperv/.kvp_pool_1 | grep "server-name"