You can specify that all future memory allocations on a virtual machine use pages associated with specific NUMA nodes (also known as manual memory affinity).
Note: Specify nodes to be used for future memory allocations only if you have also specified CPU affinity. If you make manual changes only to the memory affinity settings, automatic NUMA rebalancing does not work properly.
Procedure
- Browse to the virtual machine in the vSphere Client.
- Click the Configure tab.
- Click Settings, and click VM Hardware.
- Click Edit.
- Select the Virtual Hardware tab, and expand Memory.
- Under NUMA Memory Affinity, set memory affinity.
Example: Binding a Virtual Machine to a Single NUMA Node
The following example illustrates manually binding the last four physical CPUs to a single NUMA node for a two-way virtual machine on an eight-way server.
The CPUs (for example, 4, 5, 6, and 7) are the physical CPU numbers.
- In the vSphere Client, right-click the virtual machine and select Edit Settings.
- Click the Advanced Parameters tab.
- In the vSphere Client, turn on CPU affinity for processors 4, 5, 6, and 7.
Then, you want this virtual machine to run only on node 1.
- In the vSphere Client inventory panel, select the virtual machine and select Edit Settings.
- Click the Advanced Parameters tab.
- In the vSphere Client, set memory affinity for the NUMA node to 1.
Completing these two tasks ensures that the virtual machine runs only on NUMA node 1 and, when possible, allocates memory from the same node.