Monday, January 3, 2011

Unregister all VM in a ESX host

Problem with an old ESX v3.0.2. All VM have been stopped. I must unregister all VM from this ESX. So I use replace-str xargs option like this:

vmware-cmd -l | xargs -i{} vmware-cmd -s unregister {}


You can stop / start / suspend / reset all VM using the same tip:

vmware-cmd -l | xargs -i{} vmware-cmd {} stop
vmware-cmd -l | xargs -i{} vmware-cmd {} start
vmware-cmd -l | xargs -i{} vmware-cmd {} suspend
vmware-cmd -l | xargs -i{} vmware-cmd {} reset


For information, you can replace xargs -I{} by xargs -i{} for certain esx version

No comments: