Hi mbrkic, Christophe,
What you have described here is partially correct way of achieving the goal. However, in vCloud director hierarchies, this works only with CPU resource and not with Memory. Here is why. Below are a few terms before that.
Usage unit: the amount of usage that should be charged for. This could be actual usage, allocation, reservation etc.
Max expression in billing policy: Compare the resource attributes (usage, allocation, reservation etc) and consider the maximum of these, as usage units for charging
Overage : Compare 'rolled up' usage units (summed up usage units of descendants in hierarchy), with defined allocation at a level and charge based on slabs defined.
When you combine both max and overage, we determine usage units to be charged is by comparing 'rolled up' usage units and considering the max among them. For example, max(usage, allocation) would compare rolled up actual usage with rolled up allocation at a org-vdc level and consider the max for charging.
In case of CPU, there is no allocation defined at VM levels (Remember, there are allocations for vCPU count at VM level but not CPU). Therefore rolled up allocation of CPU at org-vdc level is nothing but defined allocation itself, which is set according to percentage guaranteed. This is compared with rolled up actual usage of CPU and if there are any spikes which exceed percentage guaranteed, rolled up actual usage will be considered for charging, and overage will be rightly applied. In case rolled up actual usage is lesser than rolled up allocation, rolled up allocation is considered as usage units for charging and charged.
However, in case of Memory, allocation is defined at VM levels too. Which means the rolled up allocation at org-vdc level is different than the defined memory allocation at that level unless there are no VMs underneath and rolled up value from them amounts to zero. Only in this case, defined allocation at org-vdc will be considered as rolled up allocation. During evaluation, as before, rolled up allocation is compared with rolled up usage and the max among them is considered for charging. Since actual rolled up allocation could be different depending on VMs underneath, it will not give you a effect of minimum charging. For example, on a org-VDC with 100GB memory and % guaranteed 50%, defined allocation at org-vdc level is 50GB. If it has 3 VMS with 2GB Memory each below it, the rolled up allocation is 6GB. Max(usage, allocation) will return 6GB in this case and will be used for charging.
I will anyway confim these results with actual testing and post the results by tomorrow, but if you get a chance in your own setup, please do try it.
The basic problem here is that charging for minimum is not an explicit feature in chargeback and the method you have mentioned helps in some cases. We already have noted this feature request and are considering it for future releases.
Thanks,
Datta