Datastore migration disabled by vSphere Data Protection

VMware provides a method to lock virtual machines from being migrated between datastores during backup since that could disrupt the backup.

However sometimes the removal of this lock fails and the machine is stuck in locked mode. And when you try to migrate the virtual machine you get a error message says that "The method is disabled by 'vSphere Data Protection'"

Disabled by VDP

According to this VMware KB article, running a new backup might unlock the VM.

If that does not work you can try to remove the virtual machine from the inventory and then register the VM with another name, this method however requires you to power off the VM and using another name in VMware.

The third method is to go into the vSphere database and manually remove the lock.

It's a good idea to backup the vSphere database before attempting to manually make changes to it.

  1. First step is to stop the VMware Virtual Center service, we don't want vSphere to use the database while we make changes to it.
  2. Run this SQL query on the database, and note which "ID" is used for the virtual machine:

    select * from VPX_VM WHERE FILE_NAME LIKE '%Virtual-Machine-Name%'
    
  3. Now when we have the ID we can check if that VM has any locks on it with this SQL query:

    select * from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-<ID from step 3>'
    

    If the query returns any locks you can remove them with this SQL query:

    delete from VPX_DISABLED_METHODS WHERE ENTITY_MO_ID_VAL = 'vm-<ID from step 3>'
    

Now that the lock is removed you can start the Virtual Center services again.

When Virtual Center is running again you should be able to migrate the virtual machine to another datastore.

Disable warning about SSH on VMware ESXi hosts

By default VMware ESXi hosts has SSH access disabled. If you want to enable SSH access you can enable it under the Configuration -> Security Profile -> Services on the ESXi host.

However when SSH is enabled the host will show a warning sign telling you that SSH access is enabled on the host. This warning can be suppressed by going to Configuration -> Advanced Settings -> UserVars and change UserVars.SuppressShellWarning to 1.

VMware suppress shell warning