New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
2629 views

How to query vmware Vi to sort datastores freespaces?

Hello I really need an urgent help on that topic. I've tried to query vmware which suppose to get sort datastores freespaces and it names correponded names, but without any succes. I thought the query suppose to look like that:

 

propsType - Datastore

 

propsPathSet - info.name, sort-object.freesSpaceGB 

 

Didn't Work for me as I've said. Do you guys have any idea where I've been mistaken?


Labels (1)
0 Likes
8 Replies
Highlighted
Absent Member.
Absent Member.

Of course I used Advance Search Operation to accomplish that. 

0 Likes
Highlighted
Absent Member.
Absent Member.

There is a sample flow called "Get Freespace on Datastores" in the VMware Virtual Infrastructure and vSphere integration that shows you how to get freespace of a datastore.

 

The "sort-object.freesSpaceGB" is not a valid property for the Datastore object.  Instead you'll want to specify "info.freespace".  That property will be the freespace in bytes that is available on the datastore.

 

Dan.

0 Likes
Highlighted
Absent Member.
Absent Member.

how to fetch Memory/CPU hot add limit for virtual machine by using 'Advanced search' ?

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi,
I think what you try to accomplish is to get the free space in your Datastore

summary.freeSpace this will give you the free space in bytes.

http://pubs.vmware.com/vsphere-50/topic/com.vmware.wssdk.apiref.doc_50/vim.Datastore.Summary.html
Regards,
Mahmoud Ibrahim
https://www.itmthoughts.com
New version of Mahmoudthoughts witten by other IT experts, if you want to share tips and tricks you are invited to join and write your own articles.
  • Say thanks by clicking the "Thump Up!" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Highlighted
    Absent Member.
    Absent Member.

    how in additional I can get claster name where this datastore is nested? 

    =-=-=-=-=-=-=-=-=-=-=-=--=-=
    In wine wisdom!
    In the beer force!
    In water, the microbes...
    0 Likes
    Highlighted
    Absent Member.. Absent Member..
    Absent Member..

    Hi,
    The information you are looking for is located in this link
    http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.Datastore.html
    I assume it is Datastore.host
    Regards,
    Mahmoud Ibrahim
    Highlighted
    Absent Member.
    Absent Member.

    Thanks! And additional question - is it posible to limit return result only for one datastore I am intresting (as for now its return for all datastores in such cluster)? (I have claster name and datastore name as input)

    =-=-=-=-=-=-=-=-=-=-=-=--=-=
    In wine wisdom!
    In the beer force!
    In water, the microbes...
    0 Likes
    Highlighted
    Commander
    Commander

    Did you have any answer to your question?

    I also have many (MANY!) Datastores on my Infrastructure and I only need to know the freespace on a given DataStore.

    I already have the datastore name, Is there a way to get the freespace without querying all the datastores?

    0 Likes
    The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.