You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Nik Martin <ni...@nfinausa.com> on 2012/12/27 17:32:23 UTC

Cloudstack Usage API (list* commands)

Hello,

Does a white paper or best practices guide exist on how to use the usage 
API commands to actually coalesce the mountains of usage data that are 
returned to build useful metering reports?  I have the API and 
Developers guide, and it just dictates the mechanics of connecting to 
the API, which I can do fine.

The commands seem to be organized a bit peculiar.

In particular, my current desired workflow for usage metering is:
1. Get a list of top level domains using listDomains.
2. For each domain, get a list of virtual machines using 
listVirtualMachines passing in domainid.
3. Get a list of network resources used by the domain, such as networks, 
IPs, etc.

3. for each VM returned, get the particulars of it, like CPUs, mHz, 
template, etc.

THIS is where things kind of fall apart:
4. Now, get the VM id, and run listUsageRecords, to determine the usage 
of that VM in run time, network, disk, etc.
The problem is, you can't pass a VM id to listUsageRecords.  So, it 
Looks Like I have to get a complete set of usage records for a domain, 
then loop through that list thousands of times for each VMid/usagetype 
combination, and build a huge in-memory DB to sort, filter, and order 
this list.  Since there isn't enough information in just the usage 
records themselves, the listUsagerecords command should allow 
specifiying a VMid as an argument since I need to bill hourly usage per 
core, per GB of storage, and speed usage per core/per mHz.

Ami I missing an obvious shortcut to building a usage report for a 
domain's resources? I just want to account for usage per domain, not per 
account. We may add sub-account usage reporting, but for now, a domain 
is the top level of usage that I bill each customer for.


-- 

Regards,

Nik

Nik Martin
nfina Technologies, Inc.
+1.251.243.0043 x1003
http://nfinausa.com
Relentless Reliability