Start a Conversation

Unsolved

This post is more than 5 years old

185192

March 27th, 2013 12:00

Relating Logical Disks to Datastores

Looking for some fresh eyes on this issue.

I need to produce a report for VMWVirtualMachineLogicalDisks, which shows which VMWDatastore each VMWVirtualMachineLogicalDisk/LogicalDisk resides on.

This is, of course, easy when there is only a single VMWDatastore for the VM.

When more than one VMWDatastore is used by the VM, I see no way to relate the logical disk(s) to the correct datastore.

There is also no way to relate the logical disks to the VMDK file layouts (already went down that rabbit hole.)

VMware Explorer, on the Storage -> Capacity tab,  makes no attempt to do this, either.

Thoughts?

171 Posts

March 27th, 2013 13:00

I've done this on the physical disks that make up the drives, but I can extend it to logical as well.  Below is the older code I used to calculate datastore rates based on physical disks that were on the extent.  You might beat me to it today :-)

Scope:VMWDatastore

sum(#bytesRead from (VMWVirtualMachinePhysicalDisk: name = $scope.extents.name).hostPhysicalDisk#)

132 Posts

March 27th, 2013 14:00

Not really the answer I need.

I need the drive letter and the related datastore name which the logical drive is residing upon.

171 Posts

March 27th, 2013 14:00

Well it was a starting point.  The other response will get you the objects for a given datastore.  If you want it for all of them you can set your scope to logical disks and then do a query for the context of logical disk and find the datastore via a query.  A batch query would be recommended for this if you are going to do it for every logical disk in the environment, since this would be huge.

171 Posts

March 27th, 2013 14:00

Scope: VMWDatastore

#!VMWVirtualMachineLogicalDisk: parents.physicalDisks.name = $scope.extents.name#.getTopologyObjects()

This will get all of the disks and from there you can get the VM up the chain as needed :-)

132 Posts

March 27th, 2013 15:00

Hmmm...Not seeing anything which allows you to relate a specific logical disk to a specific physical disk, either.

I agree that I can get from a physical disk to a datastore, as you indicated, but not seeing how to get from a logical disk to a physical disk

94 Posts

March 27th, 2013 16:00

Hello John,

Have you tried the OOTB Report template called "Datastore Reclamation and Addition". I think it provides what you are looking for.

Regards

Prasad Gadgil

132 Posts

March 27th, 2013 19:00

Hi Prasad,

Again, that does not seem to relate the actual logical drive to the datastore.  It includes all drives for any VM which uses storage on the esx host which is connected to the datastore, which is nice, but not what I need.   (Interesting report, 4200 pages on my test box, good thing I didn't run it on our Prod boxes.)

What I need is a simple list:

VM Name         Logical Drive           Datastore Name         

Without regard to how hard it might be to generate, it seems like it's just not possible at all, due to there appearing to be no way to relate logical drive to physical disk.

171 Posts

March 28th, 2013 01:00

Looked into it and you are right.  I've sent an email internally to see what we can do on this.

Thomas

171 Posts

March 28th, 2013 13:00

We've submitted to find a work around. The VMware SDK api that gathers the guest logical disks info has no way to tie that back to the phsyical disk.

1 Message

December 29th, 2014 10:00

What if we also collect the info with the Infrastructure Cartridge, would that get us to the answer needed?

No Events found!

Top