A common request from Tenant of IaaS business is Utilization Report. If a Tenant or Customer has 100 VMs, she wants to see the summary of the VMs utilization. You need to sum up the utilization amount.
Be careful not to bill based on Utilization. A tenant in SDDC or Private Cloud looks at things from different view. She does not care about the infrastructure as it’s a service to her. From a business viewpoint, she pays either based on Utilization or Configuration.
I encourage based on Configuration as Utilization can lead to argument.
- She may question why you are charging her more when her application is hardly doing any business transactions. You end up digging into the VM Utilization even though you have no access to the VM, nor understand the application behaviour.
- Utilization varies per minute. It can even spike within a minute. Do you bill per second, minute, hour, day, month…? Where do you draw the line for fair charging without spending a lot of money calculating the bill? 1 month has 30 days or 720 hours. If you do hourly charge, you perform the calculation 720x in a month.
Ok, enough about money. Money can certainly give headache 🙂 Let’s talk something technical instead 🙂
We will discuss how to report Total VM utilization. This is a common requirements. Money aside, a Tenant Management certainly wants to know how much work is done. That’s a fair request.
High Level Requirement: Show Total Utilization across all VMs every month.
To present a monthly chart that strikes a balance between accuracy and usability, you need to roll up the data. 1 month has 720 hours. A data at 5-minute average will be way too details and unreadable. Hourly is in fact relatively very accurate. On the other hand, averaging at hourly means a 10 minute spike will not appear. In the example below, the 2 peak will be lost when you average all the numbers.
When it comes to utilization, Peak is important. So what you should do is roll the 5-minute peak into each hour.
The steps are not straightforward, so I’ll give a summary first.
- Create a group per Tenant
- The group simply has all the VMs of 1 tenant. If you have a proper naming convention, you can create a dynamic group. Any VM that you add/remove from the group will automatically be included/excluded from the calculation.
- Create summary values
- The value you want are:
- The total CPU Utilization for all VMs.
- The total RAM Utilization for all VMs
- Create super metric for each.
- For CPU, you need to take into account the number of vCPU. A 16-vCPU VM running at 10% consumes more CPU than a 1-vCPU VM running at 100%.
- Since what you want is a %, not GHz, you need to divide with the Total Capacity.
- The value you want are:
- Create a View widget
- The View widget allows data transformation. The metric chart does not allow that.
- Roll up the data every hour. This makes the chart readable.
- Default the View to monthly data
- Create a Dashboard
- Ideally, you want this to be a report so it can be automatically sent for each Tenant.
To create a group, use the screenshot below as your guide. You can mix the dynamic members and static members. Create 1 per tenant.
Once you created the groups, you end up with something like this. You can park the group under any group type. It does not have to be Environment as shown below. You should create a group type called Tenant.
Create the super metrics, using the screenshot as a guide. You should create the following:
- Sum of all VM vCPU. The unit is no of vCPU.
- Sum of all VM CPU Demand. The unit is MHz
- Sum of all VM CPU Configured. The unit is MHz.
- Sum of all VM CPU Demand / Sum of all VM CPU Configured. This gets you a %, which is what you want to report.
The last super metric is derived from super metric no 3 and 4. I’ve shown the formula below.
When a Tenant has a lot of VM, the sum can be a big number. If you want to assure yourself that you got the right sum, you can use the View widget to show you the expected total. As you can see from the following screenshot, it can do a summation.
Now that you have the super metric, time to plot into a chart. Here is where you do the roll up in the View widget.
The roll up smoothens the chart, which makes it easier to read. The example below shows how an hourly roll up makes the chart more readable. I could only show 1 day data, not 1 month, as it’s too dense without the roll up.
Once the line chart is done, it’s a matter of putting into a dashboard. There are many guides in creating dashboards, so I will just provide a simple screenshot below.
Hope you find it useful!