Storage vMotion for VMs in a Datastore Cluster fails with Error: A warning or Error occurred when migrating the Virtual Machine
search cancel

Storage vMotion for VMs in a Datastore Cluster fails with Error: A warning or Error occurred when migrating the Virtual Machine

book

Article ID: 400461

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Attempts to perform Storage vMotion for virtual machines located in a datastore cluster fail with warnings or errors.

The following error in vSphere Client may be seen:

Task name     Apply Storage DRS recommendations
Target            datastore-cluster
Status            A warning or error occurred when migrating the virtual machine.

Additionally, /var/log/vmware/vpxd/vpxd.log may show messages similar to the following:

vpxd: 00:54:12.868Z info vpxd[06468] [Originator@6876 sub=drmLogger opID=mbbi####-####-####-###-##:########-40-02] Doing full invocation
vpxd: 00:54:12.892Z info vpxd[06468] [Originator@6876 sub=vmmoVm opID=mbbi####-####-####-###-##:########-40-02] Either CPU or Memory Allocation is not valid in VM ResourceConfigSpec (vim.ResourceConfigSpec) 
vpxd: -->    entity = 'vim.VirtualMachine:########-####-####-####-############:vm-####19',
...
vpxd: -->    memoryAllocation = (vim.ResourceAllocationInfo) {
vpxd: -->       reservation = 0,
vpxd: -->       expandableReservation = false,
vpxd: -->       limit = 0,
...

vpxd: 00:54:12.892Z error vpxd[06468] [Originator@6876 sub=drsExec opID=mbbi####-####-####-###-##:########-40-02] Failed to update ResSetting for VM vim.VirtualMachine:vm-####19 on host [vim.HostSystem:host-####49,host.example.com]

vpxd: 00:54:12.905Z warning vpxd[06468] [Originator@6876 sub=pbm opID=mbbi####-####-####-###-##:########-40-02] post migrate callback is skipped - VM migration failed

vpxd: 00:54:12.925Z error vpxd[06468] [Originator@6876 sub=VmProv opID=mbbi####-####-####-###-##:########-40-02] Local-VC Datastore Migrate failed at vpx.vmprov.InvokeCallbacks for poweredOn VM 'vm_name' (vm-#####57, ds:///vmfs/volumes/src-datastore/vm_name/vm_name.vmx) on host-####76 (host-IP) in pool resgroup-####87 with ds ds:///vmfs/volumes/src-datastore/ to host-####76 (host-IP) in pool resgroup-####87 with ds ds:///vmfs/volumes/dst-datastore/ with migId ################### with fault vim.fault.MigrationFault:  as Operation: Local-VC_NonDRS_StoragevMotion

Environment

VMware vCenter 8.x

VMware ESXi 8.x

Cause

Storage DRS attempts a full cluster-wide resource allocation when inconsistencies are detected in cached snapshot data.

During this process, it validates and updates resource settings for all VMs in the cluster.

If any VM in the cluster has an invalid configuration such as a cpu/memory limit set to 0 or lower than expected ; Storage DRS cannot complete the allocation. This prevents Storage vMotion from proceeding.

Resolution

Resolution:

  • Identify the VM(s) with the invalid configuration i.e. CPU or Memory allocation limits set to "0" or Lower than expected using Edit VM settings option:

  • If CPU or Memory set allocation limits observed as "0" or lower than expected, the Edit the respective VM’s settings and:

    • Set the CPU or Memory limit to "Unlimited" (recommended) or

    • Set it to an appropriate non-zero value.

  • After correcting the configuration, retry the Storage vMotion task.

 

Workaround:

If unable to change the configuration immediately, use the following workaround:

  • Power off the affected VM and perform the storage migration in Powered-off state. (This bypasses Storage DRS involvement and avoids the cluster-wide allocation check)

Additional Information

To find the VM name using the VM ID mentioned in the logs - Using vSphere Managed Object Browser (MOB):
Access MOB: Open a web browser and navigate to https://vcenter_server_ip_or_hostname/mob. Log in with vCenter credentials.
Navigate to VM:
Click on content.
Click on rootFolder.
Click on childEntity. This will typically lead to a datacenter.
Continue navigating through the inventory structure (e.g., vmFolder, childEntity again) until you find the specific VM you are looking for, or browse the list of VMs.
Identify VM: The VM ID (MoRef ID) will be displayed next to the VM name in the format vm-XXX. You can locate the VM with the matching ID and then identify its corresponding name.