VMware {code} Community
xx213421312
Contributor
Contributor

vCloud Java SDK - How to get Resource information for ORG

Hi,

I am struggling to figure out how to get resources (CPU, Mem, Disk) available on a given org. So if a org has multiple pools, I want to get all pool information separated by CPU, mem and storage (Adding all pool information together).

3 Replies
cfor
Expert
Expert

I am not sure how far along on this you are, so I will start near the beginning to hopeful get your to the information you need.

An Org has one or more VDC's, resources are at the VDC level not the org level.  So you need to look at the VirtualDataCenters in an org for the data you want.  Now to be a little more specific you need to look at the AdminVDC object base as you want to know system admin level information - what cpu is around, mem ect.

AdminVDC has several properties that might help (and many more in case you need other details), I would start by looking at VCpuInMhz, Capabilities, ComputeCapacity.

Link to API doc with more details.

http://pubs.vmware.com/vcd-55/index.jsp#doc/index.html

I have not used the Java SDK but as I understand it is similar to the .NET SDK...

ChrisF (VCP4, VCP5, VCP-Cloud) - If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
xx213421312
Contributor
Contributor

Hi cfor,

Thank you for the reply. I managed to get to the level you mentioned and get the CPU, Memory, Storage information.

The problem I am trying to resolve now is how to get cpu used, memory used information. This always seems to be null.

The idea basically is, I want to be able to check the org (Vdc) to see if it has enough space for a new VM provision etc.. so I need to be able to check how much is currently used etc.. We currently set limits at the VDC level with a reservation, so for example we have a limit set of 1 million Mhz for CPU and a reservation of 25% = 250,000Mhz (250Ghz). However if I build 10 vm's with 1 vCPU each (each vcpu is 2.9Ghz) the remaining CPU reservation should be (221Ghz).

However since I cant get the CPU used figure this become a very tedious task of figuring out what VM's belong to this org, getting their configuration and calculating the total VM's data (cpu mem) and then working out what is being used. In my case this become even more tedious as we have 5 VDC per ORG so the VM's are spread across these vdc's.

0 Kudos
cfor
Expert
Expert

I know this is not the best way but one option would be to look at the resource pool via the vCenter API.  But I know this only works if it is a private cloud and you have access to all the parts.

ChrisF (VCP4, VCP5, VCP-Cloud) - If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos