VMware

This Question is Answered

1 2 Previous Next 25 Replies Last post: Sep 10, 2009 12:20 AM by LucD  

How to list delta files in all datastores posted: Oct 8, 2008 9:06 AM

Click to view kastek's profile Novice 12 posts since
Jul 11, 2007

I've recently found the VI Toolkit and have learned a lot from these forums.

I'd like to be able to search the contents of all datastores for the existence of any delta files, indicating the presence of lingering snapshots...old or new.

I'd like to see the paths, filenames, sizes and dates of any delta files.

Can anyone point me in the right direction?

Thank you...Mike

Re: How to list delta files in all datastores

1. Oct 8, 2008 11:28 AM in response to: kastek
Click to view c_shanklin's profile Master 754 posts since
Dec 3, 2007
This is pretty easy with the VI Toolkit Community Extensions.

If you use that, you can run
get-datastore | get-tkedatastorefile | where { $_.Path -match "delta" }
to find these files.

The extensions require PowerShell 2 CTP2. If that's a non-starter for you for some reason the script code should at least tell you enough to get started.

Re: How to list delta files in all datastores

3. Oct 8, 2008 1:10 PM in response to: kastek
Click to view c_shanklin's profile Master 754 posts since
Dec 3, 2007
Either pipe the output into
format-list *
or you can pipe it into
select Path, Modification
.

Re: How to list delta files in all datastores

6. Oct 14, 2008 10:03 AM in response to: kastek
Click to view LucD's profile Champion 2,430 posts since
Oct 31, 2005
The message says you are not connected.
So perhaps add a Connect-VIServer at the beginning of your c:\deltachk.ps1 script.

Re: How to list delta files in all datastores

7. Oct 14, 2008 10:04 AM in response to: kastek
Click to view Skark166's profile Novice 12 posts since
May 5, 2008

I always use this to initialize the toolkit:
$vmsnap = Get-PSSnapin vmware* -ErrorAction SilentlyContinue
if ($vmsnap -eq $NULL) { Add-PSSnapIn -Name VMWare.VimAutomation.core }
Initialize-VIToolkitEnvironment.ps1

Skark166

Re: How to list delta files in all datastores

8. Oct 14, 2008 10:16 AM in response to: Skark166
Click to view LucD's profile Champion 2,430 posts since
Oct 31, 2005
That loads the VITK snapin and defines some aliases and functions (in Initialize-VIToolkitEnvironment.ps1) but it doesn't do a Connect-VIServer.

Re: How to list delta files in all datastores

10. Oct 14, 2008 10:35 AM in response to: kastek
Click to view LucD's profile Champion 2,430 posts since
Oct 31, 2005
To further analyse what exactly goes wrong it would perhaps be useful if you posted the script.

Re: How to list delta files in all datastores

12. Oct 14, 2008 10:42 AM in response to: kastek
Click to view Skark166's profile Novice 12 posts since
May 5, 2008

I think you'd be ok if you ditched line 4.

Skark166

Re: How to list delta files in all datastores

14. Oct 14, 2008 10:57 AM in response to: kastek
Click to view c_shanklin's profile Master 754 posts since
Dec 3, 2007
The problem may be that the connection is not actually succeeding.

Can you replace line 6 with just "get-datastore" and see if you get any output?

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities