Error: The operation is not allowed in the current state during VM migration
search cancel

Error: The operation is not allowed in the current state during VM migration

book

Article ID: 448321

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

This article describes a scenario where a "leftover" VMX process remains on an ESXi host after a virtual machine has been moved or failed over. This process is associated with a virtual machine that is no longer present in the host's inventory.

Symptoms

  • Attempts to migrate a virtual machine back to its original host fail with the error: "The operation is not allowed in the current state".
  • The virtual machine may be registered and running successfully on a different host.

Environment

  • VMware vSphere ESXi 8.x, 9.x
  • VMware vCenter Server 8.x, 9.x

Cause

This issue occurs when hostd is restarted during a storage outage, such as an All Paths Down (APD) scenario. If vSphere HA is enabled, it may unregister the VM to start it on a different host, leaving the original VMX process active on the source host.

Resolution

To resume normal operations, the leftover VMX process must be terminated manually.

  1. Log in to the ESXi host terminal via SSH.
  2. Identify the unexpected process by running the following command: esxcli vm process list
  3. Locate the World ID for the leftover VMX process.
  4. Terminate the process using the command: esxcli vm process kill -t force -w [WorldID]
  5. Verify that the process is no longer listed by repeating step 2.

For further assistance with unresponsive virtual machines, see Powering off an unresponsive virtual machine on an ESXi host.