Wednesday, December 28, 2011

Chargeback 2.0: report

The screenshow below shows a sample report for 51 VMs. It shows 0 host as this hierarchy is not based on the host/cluster hierarchy.

The data center “Mgmt Products” have multiple folders, and I’ve expanded 1 of them so it lists the VM. You can’t expand a VM to see more breakdown (example: to see the cost of each Fixed Cost if there are multiple of them).

Some of the VMs are powered off, so they only incur disk storage cost.

There is no Fixed Cost associated with this Cost Model.

As I select “Mgmt Products”, the charts on the right is about this selection. So the Entity is “Mgmt Products” data center. It has 9 children. The pie charts will only show 6, so it will automaticaly group the smallest ones and call it “Othe..”

The “Base at zero” checkbox will set the axis to be 0, so the chart will look flat as a result.


The charts will not “expand” so it can be difficult to guess which children are which. Below is the screenshot when I give the charts more space. Luckily if you mouse over it will show the entire full name.


You can export the report as CSV file. The outcome is naturally a flatten hierarchy.

If you need to recreate the hierarchy, luckily there is “Parent” column. The “Parent Report Entity Id” field links a child to its parent. For example, you can see here that there are 2 Datacenters: “Mgmt Products” and “Testing & Development”. This is because their “Parent Report Entity Id” field is 1.

If you’re not interested to show the hierarchy and actually just want the VMs, you can filter as there is a field called “Entity Type”. It looks like “Folder” as entity type 5 and VM has entity type 0.

Chargeback 2.0: mapping cost to entity

The screenshot below shows how you map/assign/give a Cost Model to Entity. Entity can have multiple levels or structure in a Hierarchy. Here is showing a hierarchy named “VC Hierarchy”.

You can apply multiple Cost Model. This is really handy as sometimes we don’t know which Cost Model will be the right one in the long run. You can also have internal and external models, where internal is a model you don’t want your customer to see, where external is what you give to them.

The Cost Model has Duration, another word it can be effective dated. If you key in the From and To field, you can get the cost configuration for that period. It would be nice if future version shows us all the cost configurations that we set.

The next field is the “Apply a Cost Template”. It is an optional step as you can assign Fixed Costs and Rate Factors directly in the “Update cost configuration” section.

If you choose it, it will automatically fill the Rate Factors and Fixed Costs tab.

1 Cost Model can only have 1 Cost Template. But if the Cost Template does not exactly meet your requirement, you can change or overwrite it.

The Rate Factors have “Historical Values”. Be careful here, once you set it you can’t delete it. In the screenshot below, there is no way to delete that historical value for the CPU. So I set it to 1 so it will not impact any calculation.


The Fixed Costs tab shows the Fixed Costs that are mapped/assigned to this Entity. I’m not sure what happens if you choose “All” in the Propagate column. It has VMs, Hosts and vApps as entity types. Remember that a Fixed Cost is generic. It has no field for entity type. So a Fixed Cost can be applied to VM, Host or vApp. You might have a Fixed Cost called “VM Back up” and can still apply it to ESXi host. In the screenshot below, if you choose “All”, does it mean the Fixed Cost will be applied to vApps also? That can mean double charging. Since vApp is essentially a resource pool, why resource pool is not listed? If you know the answer please let me know.


vCenter Chargeback 2.0: Concept

1 Cost Model can only have 1 Billing Policy at a given time. You can change your billing policy as it is dated. For now, there is no view for you to easily see the past Billing Policy and their covered period.
1 Cost Model can only have 1 currency, and you cannot change it.

1 Cost Model can only have 1 Base Rates at a given time. You can change your base rates are it is dated.

On the above screen, the “Computing Resource” is controlled by the “Computing Resources” feature, under the “Settings” tab.
In this global settings, I have disable Disk Read and a few others. That explains why you only see them in the Cost Model dialog box.

1 Cost Model can only have 1 set “built-in” Fixed Costs. There is no “effective date” field here so I’m assuming it will be effective immediately, but your history is computed with previous method. Example, you charge HA $10 and make it Hourly on 1 Jan 2011. In 16 Jan 2011, you change it to Monthly but you do NOT prorate it. If you run a weekly report on 18 Jan, I am not sure what will be charged…
I call the above as “built-in” Fixed Costs as the fields are the same with the Fixed Cost fields. To refresh your memory, below are the Fixed Cost screenshots. All the fields are here, plus you have “effective date”. So this gives flexibility, but at the expense of complexity. You will need to map them manually, plus you need to be careful with your Currency as Chargeback does not provide currency conversion. All your costs have to be in 1 currency for a given report.

You will also notice that in the “built-in” Fixed Cost, there is “Guest OS” cost. This is a clever one, as you can’t specify it in the Fixed Cost section. You notice in the Fixed Cost screenshots above, there is no field called “Guest OS”. So to bill based on specific Guest OS, you need to specify it here.

Billing Policy is cost computation for the Computing Resources. It is how you calculate the cost. It is not dated, so changing it will change the billing policy with immediate effect.
In the above screen, please look at the memory resource. I’ve already highlighted it. If you know the difference between “size” and “allocation”, let me know. A VM might have 4 GB of vRAM, given 2 GB of reservation, and using 3 GB. So I’m not sure where the 4th attribute is for, especially since vCPU and CPU do not have 4 attributes. I suspect it has something to do with Transparent Page Sharing.

Chargeback 2.0: Cost Template and Fixed Cost

Cost Template serves 2 purposes:
  • Group multiple Fixed Costs so you can apply them as 1 instead of choosing them one by one.
  • Provides adjustment to Base Rate.
Based on the above, Cost Template is optional.

Below is the Fixed Cost screen. I have 3 Fixed Costs below.

Below is the Cost Template screen. I have 2 Cost Template here. The “ABC Corp” cost template has 2x multiplier for CPU and 0.5x multiplier (a discount basically) for Disk Write.

1 Fixed Cost can only be associated to 1 Cost Template. Once a Fixed Cost is assigned to a Cost Template, it will not be available to other Cost Template
Notice from the screenshot below: The only Fixed Cost available is “Fixed Cost: Admin Fee”. The other 2 Fixed Costs are not made available.

In vCenter Chargeback 2.0, there is no more concept of “local” and “global”.
You can also prorate the cost. I have not tested the non prorate to find out whether it charges in advance or in arrear.

You might notice in the Cost Template, I have “Disk Write” only. So where is “Disk Read” or even “Disk Read/Write”?

The answer is “Computing Resources”, under the “Settings” tab.
In this global settings, I have disable them. This is useful in situation where you are not doing complex chargeback, and do not want all these details get shown or accidentally used.

How Chargeback 2.0 calculates cost

I can’t find info on how Chargeback computes cost, so I setup a simple Fixed cost to answer these questions:
  • Does Chargeback prorate? I mean if I setup $24/day and $1/hour, is it the same thing?
    • Answer is Yes. And you can configure this by ticking the Prorate checkbox.
  • When it prorates, if I setup $300/month, does it differ between month with 31 day and month with 28 days?
    • Answer is Yes. Chargeback does not assume a simple 30 day average.
  • If I setup multiple Fixed Cost, does it provide breakdown in the report, since it does not provide breakdown at the Dashboard?
    • Answer is yes.
Part 1 is easy to test. Below is the test of Part 2 and 3.

I setup 2 Fixed Cost as shown below. One is $300/month, the other is $30/month.

I waited for 1+ day, then run a report that use it.
The report cut off is 23:59 hours.
Based on the actual report below, this particular report covers 1+ day. To be precise, it is 1 day 4 hours 38 minutes. This is 28:38 hours.
I ran the report in Dec, which has 31 days.
When I divide $300 / 31 days / 24 hours / 60 minutes, I get the per minute cost.
Multiplying the above per minute cost with 28:38 hours, I got $11.546.

If I use 30 days, I did not get $11.54.

Sunday, December 25, 2011

Installing Quest PowerGUI 3.1

In the previous post, I shared about installing PowerCLI.
After you do that, you should get a GUI tool. I’m using PowerQUI. The free edition is good enough for my needs.

Below is the installation process. Just follow the wizard.

In the screen below, don’t forget to choose the “vSphere Client Integration”. It is not shown on the screen below.
Also, choose VMware in the PowerPacks. It is basically a “plug-in” to PowerGUI. You need to install vSphere PowerCLI first.

Follow the wizard. At the end of the process, you will see this screen. You can launch either.

Below is the console. I’ve already connected to vCenter. Simply by clicking the “Virtual Machines”, I got the list of VM.

Hope that helps.

Installing vSphere PowerCLI 5

PowerCLI is a key component in vSphere 5. Every VMware Admin should learn and use this flexible tool.
First step is to install it on your admin client. I think you can thinapp it too, although I need to check with Ron Wang (VMware ASEAN desktop specialist) on this.

The installation is pretty easy. Along the way, you will see a warning below.
Just click continue on the above.
The next couple of screens are pretty simple. Pretty much follow the wizard. You can change location

And soon you will see a screen like this.

At the end of installation, you will see this screen.

That’s it. The next step is to install some sort of GUI tool. I use Quest PowerGUI.

Saturday, December 24, 2011

Deleting the locked file in NFS

I was not able to power on one of the VM in the lab. The error message was shown below. So a file was locked.


Luckily it is an NFS datastore, not VMFS, so removing the lock is a matter of deleting the lock file.

But the lock file is a hidden file, so we can’t delete from the Datastore browser.


So it’s a matter of using ssh. Just connect to the ESXi, then traverse the /vmfs directory. Yes, NFS datastore is also stored in /VMFS directory.

As the file is hidden, I need to use the ls –la command to show the hidden file.