VMware {code} Community
ColinISYS
Contributor
Contributor
Jump to solution

VI Perl - file list of all datastores in a Datacenter

I am trying to sort out a datastore planning issue. To help me do this I need to list all the files on the vmfs partition in all the datastores in a Datacenter.

I have written a script that lists all the Hosts and their datastores and all the VMs and their datastore links but am struggling with the HostDatastoreBrowser object.

Help!

Thanks

0 Kudos
1 Solution

Accepted Solutions
SaranshG
Enthusiast
Enthusiast
Jump to solution

try running attached script, run the following command

It list all the datastores which has file type 'VMFS'.

dsbrowse.pl --url https:///sdk/vimService

--username myuser --password mypassword

--filetype VMFS

View solution in original post

0 Kudos
4 Replies
SaranshG
Enthusiast
Enthusiast
Jump to solution

try running attached script, run the following command

It list all the datastores which has file type 'VMFS'.

dsbrowse.pl --url https:///sdk/vimService

--username myuser --password mypassword

--filetype VMFS

0 Kudos
ColinISYS
Contributor
Contributor
Jump to solution

Thanks for this - I might be able to work it out from here - The script you attached lists all the datastores with VMFS partitions but not the files on them.

I'll let you know how I get on.

0 Kudos
ColinISYS
Contributor
Contributor
Jump to solution

Ah ha - now that I have tried running the script I can see that it does list all the files

Thanks for the help.

0 Kudos
meistermn
Expert
Expert
Jump to solution

If I use the following command :

dsbrowse.pl --url

--username myuser --password mypassword

--filetype VMFS

I get the following Error:

D:\>perl dsbrowse.pl --url --username cbausern

--password XXXX --filetype VMFS

Can't locate VMware/HostUtil.pm in @INC (@INC contains: C:/apps/VMware/VMwareVIP

erlkit/Perl/site/lib C:/apps/VMware/VMwareVIPerlkit/Perl/lib .) at dsbrowse.pl l

ine 10.

BEGIN failed--compilation aborted at dsbrowse.pl line 10.

The File Hostutil is located in : c:\apps\vmware\vmwareviperlkit\appUtil

0 Kudos