How to Configure Hyper-V Virtual Machine NUMA Spanning and Topology in Windows 11 Using PowerShell

Modern multicore x86-64 processors implement Non-Uniform Memory Access (NUMA) architectures where system RAM is partitioned across distinct memory controllers attached to specific physical CPU sockets or chiplets. When a processor core accesses its locally attached memory channel, latency is minimal and bandwidth is maximised; accessing memory attached to a remote socket requires traversing inter-socket interconnects (such as AMD Infinity Fabric or Intel Ultra Path Interconnect), increasing access latency. In Windows 11 Hyper-V environments, host-level NUMA spanning determines whether virtual machines are permitted to consume memory across multiple physical NUMA nodes. By managing host NUMA spanning and customising per-VM virtual NUMA (vNUMA) topologies through PowerShell, administrators can balance high virtual machine density against ultra-low-latency performance for memory-intensive workloads.

Understanding NUMA Spanning vs Virtual NUMA (vNUMA)

Hyper-V provides two interrelated architectural controls for NUMA management:

  • Host NUMA Spanning: A global Hyper-V host setting. When enabled (the default), Hyper-V allows a virtual machine to allocate non-contiguous memory blocks spanning multiple physical NUMA nodes if a single node lacks sufficient free memory. When disabled, Hyper-V strictly forces each VM to fit entirely within a single physical NUMA node; if no single node has enough contiguous capacity, the VM fails to power on.
  • Virtual NUMA (vNUMA): A per-VM capability that projects a virtual NUMA topology into the guest operating system. When a guest OS is aware of its virtual NUMA boundaries, its internal memory manager and application threads can align thread execution with local virtual memory channels, preventing cross-node penalties inside guest database engines and analytics services.

Auditing Host NUMA Topology and Spanning in PowerShell

Before modifying configuration values, inspect your host’s physical processor architecture and current Hyper-V NUMA spanning configuration using elevated PowerShell.

Run the following command to check if Hyper-V NUMA spanning is globally enabled on the Windows 11 host:

Get-VMHost | Select-Object Name, NumaSpanningEnabled, LogicalProcessorCount, MemoryCapacity

To inspect the physical NUMA nodes detected by the Windows kernel:

Get-CimInstance -ClassName Win32_PerfFormattedData_PerfOS_NUMANodeMemory |
    Select-Object Name, AvailableMBytes, TotalMBytes |
    Format-Table -AutoSize

To view detailed hardware processor group and NUMA topology information:

Get-CimInstance -ClassName Win32_Processor |
    Select-Object DeviceID, Name, NumberOfCores, NumberOfLogicalProcessors, SocketDesignation

Disabling or Enabling Host NUMA Spanning

Disabling host NUMA spanning ensures that every running virtual machine operates with strictly local physical memory allocations, eliminating inter-socket latency penalties. However, this reduces host memory elasticity because Hyper-V will reject VM power-on requests if individual NUMA nodes are fragmented.

To disable NUMA spanning across the host:

Set-VMHost -NumaSpanningEnabled $false

To re-enable NUMA spanning for maximum consolidation density:

Set-VMHost -NumaSpanningEnabled $true

To verify that the change took effect:

(Get-VMHost).NumaSpanningEnabled

Note: Modifying NumaSpanningEnabled does not affect currently running virtual machines until they are stopped and restarted.

Inspecting and Customising Virtual Machine vNUMA Topologies

By default, when a virtual machine is provisioned with more virtual processors or memory than a single physical NUMA node can accommodate, Hyper-V automatically generates a vNUMA topology matching the host’s physical architecture. However, administrators can explicitly define custom vNUMA configurations for specific enterprise guests.

To view the current virtual NUMA configuration of a target VM:

Get-VMProcessor -VMName "ProductionDB" |
    Select-Object VMName, Count,
        VfNumaNodesPerSocket,
        MaximumProcessorsPerNumaNode,
        MaximumProcessorsPerSocket,
        MaximumNumaNodesPerSocket

To inspect the virtual memory node boundaries:

Get-VMMemory -VMName "ProductionDB" |
    Select-Object VMName, DynamicMemoryEnabled, MaximumMemoryPerNumaNode

Configuring Custom vNUMA Nodes and CPU Allocations

To adjust vNUMA topology parameters, ensure the target virtual machine is powered off. Dynamic Memory and custom vNUMA configurations interact closely: if Dynamic Memory is enabled, vNUMA is locked to a single virtual node by default because memory allocations fluctuate dynamically. To implement multi-node vNUMA, static memory allocation is required.

To configure static memory and assign a custom vNUMA topology:

# Stop the virtual machine
Stop-VM -Name "ProductionDB" -Force

# Ensure Dynamic Memory is disabled for multi-node vNUMA alignment
Set-VMMemory -VMName "ProductionDB" -DynamicMemoryEnabled $false

# Configure 4 virtual processors per NUMA node and 1 NUMA node per socket
Set-VMProcessor -VMName "ProductionDB" `
    -Count 8 `
    -MaximumProcessorsPerNumaNode 4 `
    -MaximumNumaNodesPerSocket 2

# Set maximum memory allocation per virtual NUMA node (e.g. 8 GB per node)
Set-VMMemory -VMName "ProductionDB" -MaximumMemoryPerNumaNode 8192MB

# Start the virtual machine with the new vNUMA topology
Start-VM -Name "ProductionDB"

Resetting Virtual NUMA Topology to Host Defaults

If a virtual machine was migrated from hardware with a different physical socket layout, its stored vNUMA topology may no longer align with the current host’s processor architecture. You can reset the VM’s vNUMA settings back to match the current hardware platform automatically:

Stop-VM -Name "ProductionDB" -Force

# Re-align virtual NUMA topology with physical host architecture
Set-VMProcessor -VMName "ProductionDB" -CompatibilityForOlderOperatingSystemsEnabled $false
Reset-VMNumaNode -VMName "ProductionDB"

Start-VM -Name "ProductionDB"

Properly managing NUMA spanning and vNUMA geometry ensures high-performance database workloads, hyper-converged compute nodes, and developer test environments run with optimal memory bandwidth and deterministic execution profiles on Windows 11 Hyper-V.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.