This post is more than 5 years old

144535

January 30th, 2013 15:00

Need help getting meaningful chargeback reports

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

132 Posts

January 30th, 2013 15:00

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.

171 Posts

January 30th, 2013 15:00

It's not possible with the out of the box components, but I've done an allocation based model numerous times for customers.  Essentially, we just define a cost per unit like you mention and then tie that to a tier (usually something like a Cluster or vCenter) and then all the VMs are automatically calculated based on that.  From there if you wanted to see utilization based vs. the allocation it would only take a little more work to make that possible as well.  It would be something PSO could certainly deliver, but I've been meaning to release it to the community (at least a starter).  Also there should be some of this in the future releases later this year as we integrate the vKernel product into vFoglight.

Top