easuck
Contributor
Contributor

Anyway to get current usage stat from vCenter via REST API?

Jump to solution

I'm using REST API to develop a web-based private cloud management system that can monitor and have some automated functions like

"auto-create VM as user want if there are enough resources" and "auto-remove unused VM for a time (e.g. 1 month)".

There are anyway to get some stat from vCenter like CPU, RAM, Storage usage to use for "auto-create VM if there are enough resources" cause I get appliance health it's show as "Green" not the values.

Update:

I had use this REST API - query to get monitoring data but I don't know how to use these data values.

I thought the "16423596.0" was something like total memory in KB but I converted it to GB its not equal to actual memory on vCenter host.

Capture.JPG

My cloud environment contains 1 vCenter and 1 seperate ESXi as host.

ESXi spec:

Intel(R) Xeon(R) CPU E5620 @ 2.40GHz (8 Logical Processor)

4 GB Memory

402 GB Storage

Sorry for my bad english

Message was edited by: Chatchai Wongdetsakul

0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal

You need to be using vROps for this which does have it available via REST. vCenter still doesn't not have a complete REST API implementation yet.

View solution in original post

0 Kudos
6 Replies
daphnissov
Immortal
Immortal

You need to be using vROps for this which does have it available via REST. vCenter still doesn't not have a complete REST API implementation yet.

View solution in original post

0 Kudos
easuck
Contributor
Contributor

If I don't have vROps, can I use the REST API - query or there is another way to get the vCenter host spec?

0 Kudos
daphnissov
Immortal
Immortal

Not at this time. You need vROps really badly if you're actually trying to write your own private cloud from scratch.

easuck
Contributor
Contributor

Thanks for answer but I still wonder about other SDK like vSphere Automation SDK for Java - VMware {code} will required vROps same as REST?

or any advice that I needed to know to create those functions.

0 Kudos
daphnissov
Immortal
Immortal

What I'm trying to say is that, at this time, performance counters aren't even ​available in the REST API. It doesn't matter what bindings you use, they simply aren't there yet. REST is still a WIP with only a fraction of all the stuff available there. The vast majority is still SOAP.

skv0011
Contributor
Contributor

Hi,

Could you please let me know if this is now available through REST API (figured I will ask as its been couple of years since the last update on this question)?

 

Thanks,

Sampath

0 Kudos