In the case that the vCenter virtual machine is not accessible it may be necessary to manually migrate one or more virtual machines(VM).
The VM will incur downtime when manually migrated.
Root access to the ESXi host will be required.
Environment
VMware vSphere ESXi
Cause
Storage events can damage VM disks. This can cause the vCenter server to become unavailable.
When vCenter is not available vMotion is no longer an option to move VMs.
The vCenter virtual machine is assumed to be working and in a healthy state when following this workflow.
Resolution
This method will work for any virtual machine. The vCenter is chosen for this article as the example. Access the ESXi host command line via a remote SSH connection. If network connectivity is not working then access the cli using the DCUI via the out of band access of the host. Examples of this are IDrac or iLO.
1. Power off the vCenter VM
vim-cmd vmsvc/getallvms|less In the list find the vCenter server and record it vmid. This will be the first set of numbers of the vm's entry in the list. Record this value.Get the power state of the VM.
vim-cmd vmsvc/power.getstate <VMID>
Power off command vim-cmd vmsvc/power.off <VMID>
2. Unregister the VM
vim-cmd vmsvc/unregister <VMID>
Verify the unregistration of the VM vim-cmd vmsvc/getallvms|less Search for the VM in the list and it should not be found.
3. Registering the VM on a new ESXi host.
Access the ESXi host web User Interface. Entering "https://<IP of HOST>/ui" in a browser. root user and password
4. Register the VM on the select ESXi host.
Navigate to the datastores (2) and select the datastore with the VM files located in it. Select the datastore containing the folder of the VM (3) and click the "Register a VM" button(4).
This popup will appear for the locating of the vmx file to register. This popup window shows the VM's vmx file. The vmx file is used to register the VM on this host. Select the .vmx file and click REGISTER.
The VM will now be found on this host. Power the VM up. Network for the VM may need to be adjust by selecting to correct network and checking the port group configurations.
Distributed switch configurations are common across the cluster and it should connect with little effort.
Standard switches are unique to each host and may have to be individually checked.
Specific to a vCenter virtual machine, once connected all other migration and corrections can now be done normally via vCenter web interface.
Vcenter is the preferred method for configuration and the only management for distributed switches (vDS).