Error when trying to either vMotion or svMotion a virtual machine - The object 'vim. Datastore:datastore-XXXX' has already been deleted or has not been completely created
search cancel

Error when trying to either vMotion or svMotion a virtual machine - The object 'vim. Datastore:datastore-XXXX' has already been deleted or has not been completely created

book

Article ID: 312669

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction


The object 'vim. Datastore:datastore-XXXX' has already been deleted or has not been completely created

The error above is preventing the standard and the storage vMotion, although the datastore in question is deleted from the host

When trying to list all datastores for a specific cluster using PowerCLI , you won't find this datastore. You will also not find this datastore when trying to search for its ID in the vCenter database


Symptoms:

When trying to vMotion or Storage vMotion a Virtual Machine you see the below error

image.png

This datastore is no longer present, and not found in the vCenter database

Environment

VMware vSphere 7.0.x

Cause


The swap file location was configured previously to use this datastore at the cluster level

Resolution

Follow this KB only if the datastore doesn't exist in the vCenter database. If the datastore is found in the database then it will need to be deleted using this KB - 

The vMotion/Creation of VM returning the error: "The object 'vim.Datastore:datastore-xxx' has already been deleted or has not been completely created" (78241)
 

  1. Browse to the cluster in the vSphere Client.
  2. Click Configure.
  3. Select Configuration > General.
  4. Next to swap file location, click Edit.
  5. Select datastore specified by the host 
image.png

Once applied navigate to the affected ESXi host(s), click on Edit swap file location and configure the VM swap location to a valid datastore 

image.png

NOTE : this action is temporary to remove the stale entry of the deleted datastore

Once configured to a valid datastore on each host go back to the Cluster setting and change back to "Virtual machine directory"