VMware Cloud Community
jakemike
Contributor
Contributor

How to delete a snapshot if has the same name?

Hi guys, if I have multiple snapshots all with the same name, how do I specify which snapshot is the one I want to delete?

eg.

Root

snapname

snapname

snapname (I want to delete this one)

snapname

I could get the ID of the snapshot, but how do I pass that to the remove-snapshot command?

0 Kudos
5 Replies
jpsider
Expert
Expert

‌ccan I ask why you are using the same name for the snapshots? :smileyconfused:

0 Kudos
jakemike
Contributor
Contributor

I am not, and doesn't happen intentionally, but occasionally I have seen snapshots with the same names (and vmware don't prevent you from creating snapshots with the same names).

0 Kudos
jpsider
Expert
Expert

‌ok, what is creating or taking the snapshots?

USing the the regular powercli cmd let, you will end up deleting g all of the snapshots if you do so by name. Not sure how you'd differ based on the name tomget the id. Is it a timing thing you can base the delete off of?

0 Kudos
LucianoPatrão

Hi,

Snapshots are bound to a VM, so need to connect to a VM to delete the snapshot.

So even you do it by script you will always to connect(minimum Get-VM) to VM first.

So I think you are safe to delete them.

Luciano Patrão

VCP-DCV, VCAP-DCV Design 2023, VCP-Cloud 2023
vExpert vSAN, NSX, Cloud Provider, Veeam Vanguard
Solutions Architect - Tech Lead for VMware / Virtual Backups

________________________________
If helpful Please award points
Thank You
Blog: https://www.provirtualzone.com | Twitter: @Luciano_PT
0 Kudos
ylandrum
Contributor
Contributor

Hate to be THAT guy who resurrects a 6-year-old thread, but just as an aside for future googlers, Ivanti will do this when patching VMs if it is set to take a pre-patch snapshot. Every snapshot it creates is named STPatch.

0 Kudos