Moving locked VM’s in ESXi using SSH

Moving locked VM’s in ESXi using SSH

VMware vSphere is a very nice piece of virtualization software.

Sadly there are a few things that can go wrong and I had the “luck” to hit one of those. Waking up on a morning to notice that 4 VM’s are offline because of the ESXi host going down (hardware failure) isn’t something you want to wake up with. The worst news was that it was a new host which hadn’t been added to a cluster yet so no HA :-(.Thank god I run the machines from a storage!

After adding the storage to another ESXi host I was looking for a way to boot the machines from the new ESXi host. The problem was that vCenter saw the hosts as disconnected and VMotion wasn’t possible. Joy?

Thank god (again?) for SSH access on the machine. So I logged into the machine and managed to boot the machines on the new host by using the following command:

vim-cmd -H hostname_of_new_hypervisor /vmfs/volumes/datastorename/vm-dir/vm.vmx start

Weird thing about this: vCenter (which wasn’t able to do anything with the machines) did see the hosts being moved and changed them to the new ESXi host.

Niels Engelen on GithubNiels Engelen on Twitter
Niels Engelen
Working as a Principal Analyst in Product Management for Veeam Software with an interest in anything virtual and cloud with a strong focus on AWS, Azure and Microsoft 365. He is also a VMware Certified Professional, a Veeam Certified Architect and gained the VMware vExpert award (2012-2022).

One thought on “Moving locked VM’s in ESXi using SSH

Comments are closed.

Comments are closed.