Automation

 View Only
  • 1.  search the datastores

    Posted Feb 25, 2011 03:29 PM

    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



  • 2.  RE: search the datastores

    Posted Feb 25, 2011 04:05 PM

    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



  • 3.  RE: search the datastores
    Best Answer

    Broadcom Employee
    Posted Feb 25, 2011 04:18 PM

    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.



  • 4.  RE: search the datastores

    Posted Feb 25, 2011 04:24 PM

    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.



  • 5.  RE: search the datastores

    Posted Feb 25, 2011 06:40 PM

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

    James