Support > Knowledge Base
Knowledge Base

Search the Knowledge Base: |
Search the Knowledge Base: |
Troubleshooting Migration compatibility error: Virtual machine has CPU and/or memory affinities configured, preventing VMotion
Symptoms
-
When performing a VMotion migration the following compatibility warning is displayed:
Unable to migrate from <source server> to <destination server>: Virtual machine has CPU and/or memory affinities configured, preventing VMotion .
Resolution
Overview
This error means that CPU affinities have been set for either CPU or Memory to reserve resources on the virtual machine. This configuration is provided to give more control over the allocation of resources in your ESX Server environment.
Typically, this issue is a result of CPU affinity being configured so that the virtual machine runs on a specific set of CPUs.
Note: Scheduling Affinity is hidden in DRS clusters in fully automated mode. If the virtual machine was migrated from an ESX Server 2.x environment see the Additional Information Section of this article if the steps in the workaround do not apply.
Workaround
To workaround the issue you must ensure that there is no CPU affinity configured for the virtual machine. To check the CPU affinity:
-
Log in to the VirtualCenter as an administrator from the Virtual Infrastructure client.
-
Right-click on the Virtual Machine.
-
Click Edit Settings.
-
Click the Resources tab.
-
Click the Advanced CPU option.
Check the Scheduling Affinity Section to see if affinity has been set. If affinity has been configured configured, select the No Affinity radio button to remove the affinity configuration so that you are able to migrate the virtual machine.
Alternatively, you can power off the virtual machine and perform a cold migration to the new host.
Additional Information
In some instances this unable to migrate error is seen when a virtual machine has been migrated from ESX Server 2.x to ESX Server 3.x even though no affinities have been set. In these cases sched.mem.affinity = "0" may be in the configuration file for the virtual machine. If this parameter is present in the configuration file for the virtual machine, it can cause the issue to occur in VirtualCenter 2.x.
To remove sched.mem.affinity = "0" from the configuration file:
-
Log in to the VirtualCenter as an administrator from the Virtual Infrastructure Client.
-
Shutdown the virtual machine.
-
Right-click the Virtual Machine.
-
Click Edit Settings.
-
Click the Options tab.
-
Make note of the location of the Virtual Machine Configuration File in the General options section.
-
Click Cancel.
-
Right-click the Virtual Machine.
-
Click Remove from Inventory.
Note: This does not delete the virtual machine, it is removed from inventory.
-
Log in to your ESX Server service console as root from either an SSH session or directly from the console of the server.
-
Navigate to the virtual machine's directory noted in Step 6. For example:
[root@server] # cd /vmfs/volumes/<datastore>/<virtual machine>/
where <datastore> is the VMFS volume, and <virtual machine> is the directory that the virtual machine is stored in.
-
Use an editor such as nano to edit the configuration file of the virtual machine. The file is typically named <virtual machine>.vmx .
-
Look for a line that shows: sched.mem.affinity = "0" and remove the line and then save the file.
-
Type logout to log out of the ESX Server.
-
From the Virtual Infrastructure Client, browse to the datastore and directory that you noted in step 6.
-
Right-click the virtual machine configuration file (virtual machine.vmx ) and re-register the virtual machine by clicking Add to Inventory.
-
Power the virtual machine on again, and retry the VMotion.
Feedback
Actions
- KB Article: 1003842
- Updated: Aug 14, 2009
- Products:
VMware VirtualCenter - Product Versions:
VMware VirtualCenter 2.0.x
VMware VirtualCenter 2.5.x

