Here is how we do chargeback:  GHz consumed * rate per GHz vRAM Allocated * Uptime % * rate per vRAM GB  Storage Allocated in GB * rate per GB allocated  The rationale is this:  CPU dynamically allocates, and the number of cores is generally irrelevant for the most part.  (Yes, I know about vCPU to Core ratio, but in real life environments, CPU isn't generally the bottleneck)  vRam is not dynamically allocated, so using Allocated RAM encourages customers to pay attention to what they are asking for, and helps them focus on cooperative right-sizing efforts.  Storage is the same, you pay for what you ask for, and if you want to pay less, reduce your allocation.  ====================================================================================================  This is actually a pretty simple thing to write a report for, and doesn't require the built-in chargeback module at all (we don't use it).  create a simple WCF function called calcFunction to take in 4 double values as contexts, and return args[0] * args[1] * args[2] * args[4] create another simple WCF function called calcStorageAllocated, using vm of type VMWVirtualMachine as context, with the following code:  storageTotal = 0.0d vm?.storage?.datastoreUsage?.each{usage-> storageTotal += ((usage?.committed + usage?.uncommitted) / 1024/1024/1024)} return storageTotal  create a query to list the VMs in a context entry on a row oriented table. add additional context for cpuRate, vRamRate, and storageRate  add the following columns: context/cpus/hostCPUs/usedHz calcFunction      parameters: context/cpus/hostCPUs/usedHz/period/average, 0.0000000001, cpuRate, 1 context/memory/allocated/period/average context/uptimePercent/period/average      calcFunction      parameters: context/memory/allocated/period/average,context/uptimePercent/period/average,vRamRate,0.0009765625 calcStorageAllocated      parameters: context  calcFunction      parameters: calcStorageAllocated context , storageRate, 1,1   that's a start, anyway.  might need a bit of tweaking, and lots of room for enhancements, but that will give you a basic chargeback report.
I am trying to figure out if there is a way to get more meaningful chargeback reports than what comes out of the box with vFoglight 6.7.1.  If I use tiered flat rate I am going to have to create too many tiers and add-ons (and spend way too much time assigning them).  If I use MRU I get closer to what I am seeking, but I am not sure how much value storage I/O adds.  I need to account for storage costs, but I need to be able to charge per GB, not IOPs.  Has anyone figured out a way to dynamically charge for things like the number of CPUs, RAM, and storage (by the GB)?  It doesn't seem practical to create add ons for the many configurations you end up with when you have hundreds or thousands of VMs.  In short, I would like to be able to set a cost per vCPU, GB of RAM, and GB of storage and be able run that against my VMs.  If using MRU I would like to be able to replace storage I/O with storage space utilized, or at least add it as an option.  If there is a way to make add ons dynamic that would work, too.  Thanks
Need help getting meaningful chargeback reports