vMotion fails saying the operation is not allowed in the current state
If vMotion fails with 'The operation is not allowed in the current state', your ESX host is stuck in phantom maintenance mode. Restart mgmt-vmware and vmware-vpxa to clear it.

I've had this happen several times when an ESX host is stuck thinking it is going into maintenance mode from previous maintenance. You get an error saying it cannot complete the migration and "The operation is not allowed in the current state". Very cryptic error. Just restart the management agents on the ESX host by SSHing in and typing:
service mgmt-vmware restart
hit enter, then:
service vmware-vpxa restart
and hit enter again. You should see the services restart with an "[ OK ]" after each line.
Try to vMotion again now. If you still get an error, disconnect the ESX host from Virtual Center and then reconnect it. Try to vMotion again and it should work. You can also try restarting VC services too. If you have a better solution, let me know. I know it is a bit tedious to go through this process but it does work.

Jason Samuel
Product leader, advisor, and international speaker with 27+ years in enterprise end-user computing, security, and cloud. Has deployed infrastructure at Fortune 500 scale across 34 countries. 1 of 3 people globally to hold Citrix CTP + VMware vExpert + VMware EUC Champion concurrently. 200+ articles, 1,000+ reader discussions.
VMware PowerCLI script to set the Memory Resources limit on your VMs to Unlimited in bulk
If you need to reset memory limits to Unlimited on all your VMs during a migration, this PowerCLI one-liner does it in bulk.
vmware-esxiVMkernel ports change automatically when applying a Host Profile
If your vMotion and Management VMkernel ports get swapped when you apply a Host Profile, you need to reorder the kernel port entries in the profile first. Here's the fix.
vmware-esxiHow to fix an IP address conflict on your network caused by a VM using VMware PowerCLI
Got an IP conflict and traced it to a MAC address in your VMware cluster? This PowerCLI one-liner finds the exact VM and NIC causing it across all your ESX hosts.