Thursday, October 24, 2013

Creating vCenter Operations Manager Dashboards Using Customized Interactions Mode.

In my recent vCenter Operations Manager projects, I have extensively worked on customizing vCOps for customers to meet the needs of their specific use cases. In one such engagement, I was asked to build up a custom dashboard which shows all the key metrics of a selected object. The use case of this dashboard is to showcase 3 heatmaps, one each for Virtual Machines, ESXi Host and Datastore. These heatmaps would change colors from Green to Red once there fault score changes from 0 to 1. As soon as there is a fault with any of the VMs, Hosts or Datastores the color of the object changes to RED. Later you can click on the object and it will show the key metrics related to that object in the right pane (metric spark-lines). Look at the screenshot below:-

FAULT - METRIC DASHBOARD

Figure 1


This is possible using Heatmap widget on the left which showcases Faults and Metric Sparklines widget on the left. Then an interaction has been set between widgets as sown below in the screenshot.

Figure 2


























These interactions are used by setting up the interaction mode in the Metric Sparklines and other similar widgets. Here is a screenshot which shows where the interaction mode is set:-

Figure 3
In the default mode the Interactions Mode shows the metrics which are shown in the above screenshot as soon as you select the object, however the requirement which I got was different.

I was asked to create a custom list of metrics which should be shown as soon as a VM, ESXi Host or a Datastore is selected from the heatmap. To meet this requirement, I had to find a way by which I can set the interaction mode to point towards a custom XML which would then show the desired metrics on the metric spark lines.

The custom-metric.xml which I wrote is shown below along with its description below:-

Figure 4


You can download this file from the following link - https://docs.google.com/file/d/0B9F7kU-3lhdfUWNvRXJTNUR0ejA/edit?usp=sharing

Once you have downloaded this file, you can change the thresholds or define new metrics or objects to solve your use cases. In order to get the details of all the metrics which are available for an object, you can login to vSphere UI and navigate to the operations tab as shown in the screenshot below:-

Figure 5
























Your next task would be to upload this xml on the vCOps UI VM . Once it is uploaded we will be able to use this file for interaction instead of Default mode as shown in Figure 3.  The path on UI VM where u need to store this - 

/usr/lib/vmware-vcops/tomcat-enterprise/webapps/vcops-custom/WEB-INF/classes/resources/reskndmetrics

I will use winscp to move the "custom-metrics.xml" file to the above mentioned location on my UI VM and then give it the exact rights as other existing files which are available in this directory as shown is Figure 6 and Figure 7 below.

Figure 6























Figure 7
























Alright, now we just need to edit the dashboard which I showed in Figure 1  and edit all the 3 widgets for VM Sparklines, ESXi Host Sparklines and Datastore Sparklines and click on the drop-down below Res. Interaction Mode to select the brand new interaction option which we just created and uploaded. See the screenshot below and you will notice the new custom-views option which is available now. Make sure to set this interaction mode for all the metric spark-lines widgets on by one.

Figure 8


















Once you are done, you need to just select any VM, Host and Datastore in the left pane and now you will see the metrics which you asked for in the custom-views.xml file. See Figure 9 below and compare it with Figure 1 and Figure 4 and you will notice that the metrics shown now are the metrics which you defined in your xml file.

Figure 9

















Now this can be really powerful as you can use this customization method to filter the metrics which you want in a dashboard rather than depending upon what is available out of the box. Let me know if you have any questions on this and I will be happy to help you.



Share and Spread the Knowledge. 



************Article Update - 27th Oct 2013*************

Another update to the article on the basis of discussions I had with my buddy Lior Kamrat. He has done some great work on vCOps and XMLs. If you have a super metric which you want to capture as an attribute key, you need to use the following format:-

"<Metric attrkey="Super Metric|sm_X" (X as number(ID) of the SM)


************Article Update - 25th Oct 2013*************

In the comments on this article, Matthew asked a question on how to get the "Metricattrkey" for a given metric. Please find my response in the comments section and also see Figure 10 below.

Figure 10



8 comments:

  1. Sunny,

    Great post. How do you figure out the metric attrkey names for the metrics that you want to add? Also, how do the red,orange, and yellow thresholds correlate to the sparklines?

    ReplyDelete
  2. Thanks Matthew.

    Check the steps mentioned before Figure 5. You can browse for a desired metric in the vSphere UI-->Operations-->All Metrics. Click on the + symbols to get to a metric and click on it.

    Once you click on the metric, it will show you the metric spark line and the legend associated with it. (have updated a screenshot named Figure 10)

    Red, Orange and Yellow Thresholds have to be defined for the color of the sparkline.

    For Example, you want to configure a sparkline to be yellow colored if CPU Usage% = 50%, Orange Color if if CPU Usage% = 70%, and Red if CPU Usage% = 80%. You can choose the colors on the basis of a metric and define your thresholds.

    ReplyDelete
  3. Nice post. How do you which resourcekind and adapterkind to use for the Super Metric attribute keys when building the XML file?

    Thanks

    ReplyDelete
  4. When creating a custom metrics file, is there anyway to leverage wildcards? An example would be wanting to list Latency metrics of all disks individually.

    I suppose I could add all datastores individually something like:



    Another example would be displaying all the remaining capacity for each attached vmdk, where the number of disks could vary from one guest to another...

    However, that is a pain, and certainly doesn't provide for any dynamic updates as disks are added/removed.

    Any ideas?

    ReplyDelete
    Replies
    1. Aaaand my syntax disappeared, exciting...

      Metric attrkey="devices|naa.99999999999999999|totalReadLatency_average" label="Device X Total Read Latency Average" unit="ms" yellow="12" orange="15" red="20"

      Delete
  5. hi

    anybody know how to use this xml to view objects in a tier?

    ReplyDelete
  6. Nice Post Thanks For Sharing to get more information Managers Dashboard Software Visit here.

    ReplyDelete