June 11, 2012 | Written by: Rossella De Gaetano
Share this post:
One of the messages behind cloud computing is pay-per-use: The adoption of a virtualized, standardized, self service and automated environment should include the possibility to be charged only for the used resources.
IBM SmartCloud Provisioning offers the messages of low complexity, low administration and ease of use.
Keeping these messages in mind, I was thinking of how to extract metering information. I had in mind something easy, doable also by people who definitely do not want to invest in programming, and that does not need any modification to database tables to store historical data.
So, I looked at the available IBM SmartCloud Provisioning interfaces and I found a couple of command-line commands that could help me achieve my goal:
The first command displays the number of images, cores, and the amount of memory and disk space in use by a specific access ID. This command shows the key measures that, in cloud computing, are usually considered for usage and accounting.
The second command shows the relationship between access IDs and user IDs. This mapping helps in building metering information per user and not per access ID. In a simple environment, the map is 1-1; however, you might have the same user accessing more VM regions, for example, and therefore having multiple access IDs associated.
Given these two commands, setting up a couple of cronjobs/periodic tasks can be quite straightforward (depending on whether you want to do it on Linux or on Windows), and that with a predefined sequence (for example once an hour) their output will be stored in a temporary file.
You can then have a another cronjob/periodic task that sums up all this information daily, per user, maybe adding your specific rate codes. If you choose to store this data for example in a CSV file, then you can easily import it into a reporting engine.