VMware Cloud Community
burdweiser
Enthusiast
Enthusiast
Jump to solution

search the datastores

I'm looking into how I can create this or if I've already got a script. I need to search through all of my datastores for any files with the "*.000001.vmdk" or  "*.000002.vmdk". It seems that we have some orphaned snapshot files that do not show up in the snapshot manager, so I need to do a search of all datastores to see how many of these files that are out there that may not be registered in the snapshot manager.

James

0 Kudos
1 Solution

Accepted Solutions
avlieshout
VMware Employee
VMware Employee
Jump to solution

Please be aware that snapshot files that don't show up in the snapshot manager, not necessarily mean they aren't used and are orphaned.

Don't try to delete them unless you're absolutely sure they aren't used.

You can use PowerGUI's VMware management pack. There's a scriptnode in there that searches for orphaned files.

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
4 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

Hi James,

you can search through all your datastores for files named *.000001.vmdk" -or "*.000002.vmdk" with the following PowerCLI command:

Get-ChildItem vmstores: -Recurse | `
Where-Object {$_.Name -like  "*.000001.vmdk" -or $_.Name -like  "*.000002.vmdk"}

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
avlieshout
VMware Employee
VMware Employee
Jump to solution

Please be aware that snapshot files that don't show up in the snapshot manager, not necessarily mean they aren't used and are orphaned.

Don't try to delete them unless you're absolutely sure they aren't used.

You can use PowerGUI's VMware management pack. There's a scriptnode in there that searches for orphaned files.

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
burdweiser
Enthusiast
Enthusiast
Jump to solution

Understood. I'm not looking to delete anything. In fact, I know there are some VM's out there that are activly using these snapshots but they do not show up in snapshot manager. These have only been identified through a manual process. I'm currently working with support on this issue, I'm just trying to find if there are any more out there.

0 Kudos
burdweiser
Enthusiast
Enthusiast
Jump to solution

The powercli script took a while, but I found the PowerGUI option much more informative! Thanks for the reminder on PowerGUI!

James

0 Kudos