VMware Cloud Community
alex777
Contributor
Contributor
Jump to solution

How to remove all snapshots on ESX host ?

Hello.

Prompt please how from cli(ssh) to remove all snapsots on all VMs (ESX 3x) ?

0 Kudos
1 Solution

Accepted Solutions
kjb007
Immortal
Immortal
Jump to solution

You can run a vmware-cmd against the vm's and remove them using a loop.

cd /vmfs/volumes/<datastore_name>

for $vm in `ls -1`

do

vmware-cmd /vmfs/volumes/<datastore_name>/$vm/$vm.vmx removesnapshots

done

Message was edited by: kjb007 : fixed code

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

0 Kudos
4 Replies
alex777
Contributor
Contributor
Jump to solution

Thanks for your answer.

But PoweShell does not approach. Only local ESX console (this script run by cron).

0 Kudos
kjb007
Immortal
Immortal
Jump to solution

You can run a vmware-cmd against the vm's and remove them using a loop.

cd /vmfs/volumes/<datastore_name>

for $vm in `ls -1`

do

vmware-cmd /vmfs/volumes/<datastore_name>/$vm/$vm.vmx removesnapshots

done

Message was edited by: kjb007 : fixed code

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
alex777
Contributor
Contributor
Jump to solution

Thanks !

0 Kudos