Skip to content

Pause, not Suspend virtual machines in ESX

I recently had to perform a core storage upgrade affecting the NFS backed datastore of some ESX servers I manage. We wanted to avoid shutting down some virtual machines and found this gem online.

This article illustrates the [unsupported] ability to pause a VM by sending the VM process a kill -STOP signal and resume by sending a kill -CONT signal. We needed to do this because we didn’t want the VM doing any IO while the storage was unavailable to the ESX server.

The article was written for ESXi and I have an ESX environment so I didn’t use their approach, instead my one liners to pause and resume *all* the VMs on the host looked like this:

Pause
for vm in `ps -ef | grep vmware-vmx | grep -v grep | awk '{ print $2; }'`; do kill -STOP $vm; done

Resume
for vm in `ps -ef | grep vmware-vmx | grep -v grep | awk '{ print $2; }'`; do kill -CONT $vm; done

Useful, even if the use case is very esoteric.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*