Caution: This procedure modifies the database. Ensure to take a full backup of your existing database before proceeding with any of these options. Involve a Database Administrator if you have any difficulty with these steps.
To solve this issue, use one of these options:
Manually remove entries from the vCenter Server SQL database
Caution: This procedure modifies the database. Ensure to take a full backup of your existing database before proceeding with this workaround. Involve a Database Administrator if you have any difficulty with these steps.
- Stop the vCenter Server services. For more information, see How to stop, start, or restart vCenter Server services (1003895)
- Take a backup of the vCenter Server database.
- Run this SQL query against the vCenter Server database:
select ID from VPX_VM WHERE FILE_NAME LIKE '%Virtual_Machine_Name%';
For example:
select ID from VPX_VM WHERE FILE_NAME LIKE '%VM1%';
- Make a note of the vm-ID_Number value returned by the SQL query in step 3.
- To confirm the stale entry, run this SQL statement against the vCenter Server database:
select * from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-ID from step 4';
- To remove the stale entry, run this SQL statement against the vCenter Server database:
delete from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-ID from step 4';
- Start the vCenter Server services, then retry the vMotion.
Manually remove entries from the vCenter Server and vCenter Server Appliance vPostgres database
To manually remove the entries from the vCenter Server Appliance vPostgres database for vCenter Server Appliance 5.0 Update 1, 5.1, 5.5, 6.0, and 6.5:
- Connect to the vCenter Server Appliance using SSH. For more information, see Toggling the vCenter Server Appliance 6.x default shell (2100508)
- Stop the VMware VirtualCenter Server service using this command:
service vmware-vpxd stop
For vCenter 6.0 and above:
service-control --stop vmware-vpxd
- Take a backup of the vCenter Server database. For more information, see Backing up and restoring the vCenter Server Appliance 5.x vPostgres database (2034505) or Back up and restore vCenter Server Appliance/vCenter Server 6.x vPostgres database (2091961)
- To connect to the vCenter Server database:
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
- While connected to the vCenter Server database, run:
select * from VPX_VM WHERE FILE_NAME LIKE '%Virtual_Machine_Name%';
For example:
select * from VPX_VM WHERE FILE_NAME LIKE '%VM1%';
- Virtual_Machine_Name is the name of the virtual machine. Leave the percentage (%) signs.
- User is the postgres username. For vCenter 5.x, use vc. For vCenter 6.x, use postgres.
- Make a note of the numerical ID value returned by the SQL statement in step 4, as this will be required in the SQL statement in steps 6 and 7.
- To confirm the stale entry, run this command against the vCenter Server database, using the vm-id output from Step 4.
select * from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-ID';
For example:
select * from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-1234';
- To remove the stale entry, run this command against the vCenter Server database, using the vm-id output from Step 4.
delete from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-ID';
For example:
delete from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-1234';
- Start the VMware VirtualCenter Server service, then retry the vMotion. For more information, see How to stop, start, or restart vCenter Server Appliance 5.x services (2054085).
Windows installed vCenter Server with Postgres database
- Stop the vCenter Server services.
- Connect to the Postgres database. For more information, see Connecting to the embedded vPostgres Database in a Windows installed vCenter Server 6.0 (2108848).
- Run this command against the vCenter Server database.
select * from VPX_VM WHERE FILE_NAME LIKE '%Virtual_Machine_Name%';
For example:
select * from VPX_VM WHERE FILE_NAME LIKE '%VM1%';
- Make a note of the numerical ID value returned by the SQL statement in step 4, as this will be required in the SQL statement in steps 6 and 7.
- To confirm the stale entry, run this command against the vCenter Server database:
select * from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-ID from step 4';
- To remove the stale entry, run this command against the vCenter Server database:
delete from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-ID from step 4';
- Start the VMware VirtualCenter Server service, then retry the vMotion. For more information, see How to stop, start, or restart vCenter Server Appliance 5.x services (2054085).
Remove and re-add the virtual machine from the inventory
Caution: Removing a virtual machine from inventory removes any performance statistics and historical data associated with the virtual machine. This process should only be used if the preceding procedures are unsuccessful or you do not want to retain any historical or performance data for a defined virtual machine.
- Power off the virtual machine.
- In vSphere Client, right-click the virtual machine and click Remove from Inventory.
- Browse to the datastore where the virtual machine resides.
- Right-click the .vmx file of the virtual machine and click Add to Inventory.
Note: This gives the virtual machine a new ID.
- Power on the virtual machine and retry the vMotion operation.
Remove and re-add the ESX/ESXi from the inventory
Caution: Removing an ESX/ESXi host from inventory removes any performance statistics and historical data associated with the host. This process should only be used if the preceding procedures are unsuccessful or you do not want to retain any historical or performance data for the defined ESX/ESXi host.
- In the vSphere Client, right-click the ESXi/ESX host and click Disconnect.
- Right-click the disconnected ESXi/ESX host and click Remove from Inventory.
- After the host is removed from inventory, right-click the cluster and click Add Host.
- Provide the IP address or hostname of the ESXi/ESX host and the root username and password.
Workaround: