What do you do, when you have a virtualised vCenter VM, but you want to adjust something about it without locking yourself out of vCenter.
In my case I had a vCenter server that I wanted to adjust the memory on. To do this without locking yourself out, you should follow these steps:
1. First determine which ESXi host the vCenter VM is running on lets say its: esx7.domain.com
2. Connect using SSH to the esx7 console. (you may need to enable this in advance).
3. Run the command below to find the “vcenter1” VM’s identifier.
# vim-cmd vmsvc/getallvms | grep vcenter
80 vcenter [datastore1] vcenter/vcenter.vmx windows7Server64Guest vmx-08 vCenter Server
Here you can see it is ID: 80.
4. Shutdown the VM. At which point you’ll lose access to vCenter. Check it has stopped with this:
# vim-cmd vmsvc/power.getstate 80
5. At the command line edit the vmx file to adjust the memory:
# vi /vmfs/datastore1/vcenter/vcenter.vmx
(Change the memory directive line and save the file)
6. Now run the command to start the VM again.
# vim-cmd vmsvc/power.on 80
7. Wait for the vCenter VM to start and log back into vCenter.