Unable to add the host to vCenter due to the error: "The operation is not allowed in the current state."
search cancel

Unable to add the host to vCenter due to the error: "The operation is not allowed in the current state."

book

Article ID: 413946

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • Attempts to add an ESXi host to vCenter Server fail with the error: "The operation is not allowed in the current state."
  • This occurs after a failed maintenance mode operation and a subsequent host reboot, leaving the host in an invalid state as perceived by vCenter.
  • In the vpxd.log file, you see entries similar to below which indicates that a previous task (e.g., entering maintenance mode) did not complete successfully, leaving the host in a transitional or inconsistent state.

xxxx-xx-xxTxx:xx:xx.xxx+xx:xx info vpxd[187795] [Originator@6876 sub=vpxLro opID=xxxxxxx-xxxxx-auto-5efmj-h5:xxxxxxx-b4] [VpxLRO] -- FINISH task-xxxxx
xxxx-xx-xxTxx:xx:xx.xxx+xx:xx error vpxd[187795] [Originator@6876 sub=Default opID=xxxxxxx-xxxxxxx-auto-5efmj-h5:xxxxxxx-b4] [VpxLRO] -- ERROR task-xxxx
-- 521c94ee-43c3-b224-9a5a-d24591a24e39(52c9301c-6664-0cff-3f31-4cc5dcd13617) -- host-xxxxxx -- vim.HostSystem.reconnect: :vim.fault.InvalidState
--> Result:
--> (vim.fault.InvalidState) {
--> faultCause = (vmodl.MethodFault) null,
--> faultMessage = <unset>
--> msg = ""
-> }
--> Args:
-->
--> Arg cnxSpec:
--> (vim.host.ConnectSpec) {
--> hostName = "xxxxxxxx-xxx.xxxxx.xxx.xx",
--> port = <unset>,
--> sslThumbprint = <unset>,
--> sslCertificate = <unset>,
--> userName = "root",
--> password = (not shown),
--> vmFolder = 'vim.Folder:f6f94b1b-de3a-43d9-b32e-c254ba5098eb:group-v4',
--> force = true,
--> vimAccountName = <unset>,
--> vimAccountPassword = <unset>,
--> managementIp = <unset>,
--> lockdownMode = <unset>,
--> hostGateway = (vim.host.GatewaySpec) null
--> }
--> Arg reconnectSpec:
-->
xxxx-xx-xxTxx:xx:xx.xxx+xx:xx info vpxd[188244] [Originator@6876 sub=vpxLro opID=xxxd1axx] [VpxLRO] -- BEGIN lro-xxxxx -- SessionManager -- vim.SessionManager.login -- xxxxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx

Environment

  • VMware vCenter Server Appliance 7.x
  • VMware vSphere ESXi 7.x
  • VMware vCenter Server 8.x
  • VMware vSphere ESXi 8.x

Cause

The issue is caused by a failed maintenance mode task initiated from the vSphere UI. Although the host entered maintenance mode via the Host UI, vCenter did not register the transition correctly. As a result, vCenter considers the host to be in an invalid state, preventing reconnection or re-addition.

Resolution

Restart of vCenter services fixed the issue.

1. SSH to vCenter Server Appliance

2. Run the below command to restart all services

service-control --stop --all 

service-control --start --all

3. After services are fully restarted, retry adding the host to vCenter.

Additional Information

1. Ensure network connectivity between the host and vCenter is intact (ports 902, 443, and 80).

2. Test name resolution of both vCenter and ESXi using nslookup