Hi all,
vCloud Director version : 8.1.0
vCO version : 7.0.1
I can see used space of org vdc storage profile on web interface of vCloud Director as you can see below ;
Now, i need to get this information on vCO workflow. I created a lot of workflow related to this project but i'm stuck here. everything looks like fine but why it is not working i don't know. My code is ;
for each ( profile in vdc.vdcStorageProfiles.vdcStorageProfile.enumerate()) { System.log("Tier Name : "+profile.name); System.log("Used Space : "+profile.storageUsedMB); }
Result ;
[2017-09-26 11:39:33.855] [I] Tier Name : SSD
[2017-09-26 11:39:33.866] [I] Used Space : undefined
[2017-09-26 11:39:33.870] [I] Tier Name : SAS
[2017-09-26 11:39:33.872] [I] Used Space : undefined
Also, I tried to get this information using Query Services as you can see below ;
var vdcHost = vdc.getHost(); var queryService = vdcHost.getQueryService(); var expression = new VclExpression(VclQueryAdminOrgVdcStorageProfileField.NAME, profileName, VclExpressionType.EQUALS); var filter = new VclFilter(expression); var params = new VclQueryParams(); params.setFilter(filter); var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINORGVDCSTORAGEPROFILE, params); var storageProfile = new Array(); while (resultSet != null) { var records = resultSet.getRecords(new VclQueryResultAdminOrgVdcStorageProfileRecord()); for each (var record in records) { if (record.vdc == vdc.getReference().href) { var storageProfileRef = new VclReference(); storageProfileRef.href = record.href; storageProfileRef.name = record.name; storageProfileRef.type = record.type; var storageProfiles = vdcHost.getEntityByReference(VclFinderType.VDC_STORAGE_PROFILE, storageProfileRef); if (storageProfiles != null) { storageProfile.push(storageProfiles); System.log("Tier Name : "+storageProfiles.name); System.log("Used Space : " +storageProfiles.storageUsedMB); } } } resultSet = resultSet.getNextPage(); }
Result ;
[2017-09-26 11:39:33.855] [I] Tier Name : SSD
[2017-09-26 11:39:33.866] [I] Used Space : undefined
[2017-09-26 11:39:33.870] [I] Tier Name : SAS
[2017-09-26 11:39:33.872] [I] Used Space : undefined
It is not working ! is there anybody who can help me related to this issue ?