I currently have a setup where vCenter Chargeback imports automatically hierarchies from vCloud Director through a Data Collector. I am finding difficulties in mapping a vCloud Director Entity ID into a vCenter Chargeback one.
I will give a pratical example:
In vCloud Director I have organization ORGNAME and vm VMNAME.
I want to generate a report in Chargeback for the VMNAME entity. How do I figure which entity ID I should pass in the report request if the only information I have comes from the vCloud Director?
Thank you beforehand,
Marco
Hi Marco,
To get entity Id of the VM to pass into report request, you have following option:-
Please note that Browse entity API returns very few details about the entity (name and entity id). If you want to filter out your VM (or any other entity) based on name this might be sufficient for you.
But if you want to filter out your VM (or any other entity) on some other criteria, you may have to call "Get Entity, GET <Base URL>/hierarchy/{hierarchyId}/entity/{entityId}" API to get more details about the entity.
If you to filter out you VM(or any other entity) based on custom attribute you may want to use "Get Attributes of an Entity, GET <Base_Url>/hierarchy/{hierarchyId}/entity/{entityId}/attribute" API
Please note that in case of vCloud director hierarchies in vCenter Chargeback which are auto populated, there is a custom attributes named "vCloudEntityId" set on chargeback entities corresponding to vCloud Director entities. The value of "vCloudEntityId" custom attribute represents the type and vCloud entity id of the vCloud Director entity.
For example if an vApp named "helloVapp" has id 123456 in vCloud Director. Then in vCenter chargeback the value of custom attribute "vCloudEntityId" will be "VcloudVappEntity-123456" for this "helloVapp" vApp.
I hope this helps.
-Amrainder
Hi Marco,
To get entity Id of the VM to pass into report request, you have following option:-
Please note that Browse entity API returns very few details about the entity (name and entity id). If you want to filter out your VM (or any other entity) based on name this might be sufficient for you.
But if you want to filter out your VM (or any other entity) on some other criteria, you may have to call "Get Entity, GET <Base URL>/hierarchy/{hierarchyId}/entity/{entityId}" API to get more details about the entity.
If you to filter out you VM(or any other entity) based on custom attribute you may want to use "Get Attributes of an Entity, GET <Base_Url>/hierarchy/{hierarchyId}/entity/{entityId}/attribute" API
Please note that in case of vCloud director hierarchies in vCenter Chargeback which are auto populated, there is a custom attributes named "vCloudEntityId" set on chargeback entities corresponding to vCloud Director entities. The value of "vCloudEntityId" custom attribute represents the type and vCloud entity id of the vCloud Director entity.
For example if an vApp named "helloVapp" has id 123456 in vCloud Director. Then in vCenter chargeback the value of custom attribute "vCloudEntityId" will be "VcloudVappEntity-123456" for this "helloVapp" vApp.
I hope this helps.
-Amrainder
Thanks for the reply.
I was actually using the second approach you described. I will give a try to the first one, especially if it is more efficient in case of complex hierarchies.
Marco
