hpoo_legend Absent Member.
Absent Member.
1974 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 (2)
0 Likes
8 Replies
hpoo_legend Absent Member.
Absent Member.

Re: How to query vmware Vi to sort datastores freespaces?

Of course I used Advance Search Operation to accomplish that. 

0 Likes
Daniel_Linsley Absent Member.
Absent Member.

Re: How to query vmware Vi to sort datastores freespaces?

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
jadda007 Absent Member.
Absent Member.

Re: How to query vmware Vi to sort datastores freespaces?

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

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How to query vmware Vi to sort datastores freespaces?

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
  • Say thanks by clicking the "Kudos! Star" 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.
  • Kvark Absent Member.
    Absent Member.

    Re: How to query vmware Vi to sort datastores freespaces?

    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
    Absent Member.. Mahmoud-Ibrahim Absent Member..
    Absent Member..

    Re: How to query vmware Vi to sort datastores freespaces?

    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
    Kvark Absent Member.
    Absent Member.

    Re: How to query vmware Vi to sort datastores freespaces?

    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
    FranciscoLeiria Trusted Contributor.
    Trusted Contributor.

    Re: How to query vmware Vi to sort datastores freespaces?

    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.