In part 1 and part 2 for this series we covered the super metrics needed for pulling out ESXi Cluster and shared storage capacity planning data in vCenter Operations. In this part I will cover how to apply a Super Metric package on a cluster, discover the rest of the OOTB metrics needed and how to work with vC Ops Interaction Mode XML files.
Applying Super Metric Package to a Cluster
After creating all the Super Metrics the next step will be to go back to the Super Metrics editor and create a Super Metric package and apply it on a cluster.
To apply to the new package on your cluster go to Environment Overview
List all Clusters Resource Kinds expend Resource Kinds > Cluster Compute Resources and select All Attributes. For the purpose of the example, by clicking the “Edit Resource” button I will apply my package on “Cluster A”
Wait a bit as Super Metrics calculations can take some time to complete and become available for selection (depends on the size of the environment, usually no more then 5-10 min).
Login to vSphere UI, select the cluster you apply the package on and nevigate to Operations > All Metrics. Notice how all the newly created Super Metrics are now available for the cluster.
You can double-click each one of them in order to show it in the Metric Chart on the right.
Out of the box capacity planning metrics
Let’s refresh our memory with table 1, remember that black color metrics are the ones available OOTB.
|CPU||MEMORY||STORAGE||DENSITY AND VM DEPLOYMENT|
|Cluster Total CPU Capacity (GHz)||Cluster Physical Memory Capacity (GB)||Cluster Shared Storage Total Capacity (GB)||Cluster VM to Host Ratio|
|Cluster Total CPU Demand (GHz)||Cluster Total Memory Usage (GB)||Cluster Shared Storage Used Space (GB)||Cluster vCPU to pCPU Ratio|
|Cluster Total CPU Demand (%)||Cluster Memory Usage (%)||Cluster Shared Storage Used Space (%)||Cluster vMem to pMem CPU Ratio|
|Cluster Shared Storage Throughput (KBps)||Cluster Deployed VMs|
|Cluster Total IOPS|
Table 1 – Capacity Planning OOTB Metrics and Super Metrics
Before jumping into the XML part of things we need to discover the OOTB metrics attribute keys.
There are more than one methods to retrieve metric attribute key. For the purpose of this blog post I will be using the “Health Status” widget method. If you want to learn more about the other method using SQL query on the vC Ops database, please open VMware vCenter Operations Manager Administration Guide (pg.101).
- Add a “Health Status” widget to a new temporary custom dashboard.
- Using the “Health Status” widget, our goal is to retrieve the OOTB metrics. On the right side, under the Metric section check the Custom option.
- For example, let’s try to retrieve the attribute key for “Cluster Total CPU Demand (%)”. Start by typing “cpu|dem” and notice how all matches attributes are starting to show.
- Select the “cpu|demandPct” and copy the key to a temporary text file.
- Now, it takes some vC Ops time and practice to know what to look for and match the attribute keys to its corresponding metrics.
My suggestion is for you to select a cluster and use the Operations > All Metrics screen in the vSphere UI so you will get a better holding on which metrics to look for.
In order to ease the pain a little bit I put together Table 2 that includes the OOTB metrics and their matching attribute keys needed for our Capacity Planning dashboard.
|Cluster Total CPU Demand (%)||cpu|demandPct|
|Cluster Memory Usage (%)||mem|usage_average|
|Cluster Total IOPS||disk|commandsAveraged_average|
|Cluster VM to Host Ratio||density|ratio|vm2host|
|Cluster vCPU to pCPU Ratio||density|ratio|vcpu2pcpu|
|Cluster vMem to pMem Ratio||density|ratio|vmem2pmem|
|Cluster Deployed VMs||deployed|countDistinct|vm|
Table 2 –OOTB Metrics Attribute Keys
vC Ops Interaction XML File
Out of the box, vC Ops delivered with two defaults XML files – sample.xml and sampleScoreboard.xml. Currently, only 3 widgets can leverage those XML files – “Metric Graph”, “Generic Scoreboard” and the “Metric SparkLines” widget.
In order to start working with vC Ops XMLs using WinSCP, login to vC Ops UI VM with the “admin” account and navigate to the following path where you will find the two XML files:
Make 4 copies out of the sampleScoreboard.xml file into your desktop (or a folder of your choosing), as those are the ones we will edit later on.
XML File Structure
Before we start editing the file, let’s understand its structure.
- AdapterKind – points from which vC Ops adapter to select a resource. For example, in order to work with the built-in VMWARE adapter kind:
- ResourceKind – points from which resource kind to select attributes keys. For example, in order to work with virtual machine attribute keys, select VirtualMachine
- The metric line includes the following parameters:
- Metric attrkey – This is a unique metric attribute key. Depends on the Resources Kind you are working with, this attribute key will change respectively.
- Label – Determines the label shows for the metric in the widget
- Unit + Unit thresholds by color – Determines how the widget colors the data. This is only relevant to the “Generic Scoreboard” and the “Metric SparkLines” widgets, as the “Metric Graph” doesn’t show colors for the data. You need to fill it anyway so that any of the widgets will be able to read the XML they point to.
Editing the XML
Now that we have all the metrics attribute keys it’s time to add the data into the XML. Change the names of the XML copies you made earlier, each file will include metrics from different Resource Kinds.
For each XML file we need to include both the OOTB metrics and the Super Metrics created during this series.
Edit each file according to the following example. Since we are using the XML files in a “Metric Graph” widget the unit thresholds are less important here because in this kind of widget, colors do not come into play.
Capacity Planning CPU.xml
Two things to notice here:
- Don’t forget to change the resourceKindKey to “ClusterComputeResource”.
- In every vC Ops environment the Super Metrics ID will be different so you will need to match the Super Metrics IDs and add those to the XML. You can find the IDs in the Super Metrics Editor.
Capacity Planning Mem.xml
Capacity Planning Storage.xml
Capacity Planning Density Deployment.xml
After you’ve done with the XML files, copy all 4 to the same folder in the vC Ops UI VM. Make sure you do this after login the UI VM using the “admin” account.
In the last part for this series we will put everything we’ve done so far in the mix to create our 1-Click Capacity Planning Dashboard. Stay tuned…
Please send me your feedback and comments about this #TechTip below, as well as requests for #TechTips on other topics. And yes, follow us on twitter @vcenterops to get the latest on vCenter Operations and Cloud Operations Management topics. For a full list of all blog posts in the vCenter Operations Management Tech Tips series, search for posts with the tag ‘tech tips‘, or just visit http://blogs.vmware.com/management/tag/tech-tips.