How to get stoarge capacity used for Vcc

Hello

We received the total and capacity used in vco 4.2.0

vdc.storageCapacity.allocated;

vdc.storageCapacity.used;

but this code does not work in vco 5.1

It is a new concept in 5.1 of the storage profile that gives us the storage total allocated as

vdc.getStorageProfiles () .limit [0]

But how we find the allocated capacity used?

Thank you

Here's some of my sample code that you may find useful:

System.log("============ Provider VDC: "+providerVdc.name+" ============");
System.log("NOTE: If allocatedMB = 0, then the org vdc has been configured for 'unlimited'");
var vdcs = providerVdc.getAdminVdcs();
var host = providerVdc.getHost();
for each (vdc in vdcs){
 System.log("====== Processing Org VDC: "+vdc.name + " ======");
 var queryService = host.getQueryService();
 var profs = vdc.getStorageProfiles();
 for each (var prof in profs) {
     var expression = new  VclExpression(VclQueryAdminOrgVdcStorageProfileField.HREF,  prof.getReference().href  , VclExpressionType.EQUALS);
     var filter = new VclFilter(expression);
     var params = new VclQueryParams();
     params.setFilter(filter);
     var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINORGVDCSTORAGEPROFILE,params);

     while (resultSet != null) {
         var records = resultSet.getRecords(new VclQueryResultAdminOrgVdcStorageProfileRecord);
         //System.log(records.length + " records found");
             for each (var record in records) {
         System.log("Storage Profile Name (usedMB/allocatedMB): " +  record.name + " ("+record.storageUsedMB+"/"+record.storageLimitMB+")");
             }
     resultSet = resultSet.getNextPage();
     }
 }
 System.log("");
}

// --------------------------- End code Snippet
Sample output:
[2013-03-21 12:27:03.553] [I] ============ Provider VDC: pVDC1 ============
[2013-03-21 12:27:03.554] [I] NOTE: If allocatedMB = 0, then the org vdc has been configured for 'unlimited'
[2013-03-21 12:27:03.763] [I] ====== Processing Org VDC: demo ======
[2013-03-21 12:27:03.859] [I] Storage Profile Name (usedMB/allocatedMB): Shared (0/409497)
[2013-03-21 12:27:03.861] [I]
[2013-03-21 12:27:03.863] [I] ====== Processing Org VDC: tiny ======
[2013-03-21 12:27:03.959] [I] Storage Profile Name (usedMB/allocatedMB): Local (1792/6144)
[2013-03-21 12:27:03.963] [I]
[2013-03-21 12:27:03.965] [I] ====== Processing Org VDC: CimVDC ======
[2013-03-21 12:27:04.016] [I] Storage Profile Name (usedMB/allocatedMB): Shared (231680/0)
[2013-03-21 12:27:04.020] [I]

Tags: VMware

Similar Questions

Maybe you are looking for

  • How can I transfer video from my ipad on my mac

    How can I transfer video from my ipad on my mac

  • Qosmio X 70-problem of fan control

    I formally request the control of my fans! I wish I had the notebook cooler than it already is by JZ my previous changes!The fan starts up very late and temperatures sometimes wear on the border! I use akktuell is no longer my previous Arktic MX4 coo

  • Tabla CheckBox in 1 d

    OLA, bueno, I am doing a VI, where in una tabla los archivos .xls ordenados appears. Box Quiero poner en, as el usurio can para cada campo Seleccionar el archivo appears in the table y lo abra o eliminated. E found several examples of con tablas chec

  • How to use the administrator password

    This is my first time to use windows live family safety {wlfs} I create just a username {removed privacy} and {removed privacy} password. After creating finsh it is active... All my software is block by admin password... When I entered the password o

  • Update Windows 7 seems to be to force the download of windows 10

    I am trying to download and install updates to Windows 7, I see 'Download Windows 10', then 'start download button '. If I select other updates, there are a number of 19, ready to download. I check all the and click OK. Now I'm back to the "Download