Showing posts with label XML Coding. Show all posts
Showing posts with label XML Coding. Show all posts

Saturday, October 31, 2015

Using a Help Desk Dashboard to Simplify Operations With vRealize Operations Manager!

This post is a resultant of our VMworld 2015 content which we ( me and Iwan Rahabok) have been brewing since the mid of this year. Without taking any credit, I must say that all the content which we presented in various events such as architect bootcamps, VMworld and recently at the VMware APJ Tech Summit was the brainchild of my awesome buddy & colleague Iwan Rahabok.

Post these events, a lot of people have reached out to help them with development of dashboards which can help them effectively use vRealize Operations in there environments. With this post I would share a basic dashboard which can help you with day 2 day operations especially around performance troubleshooting in an organized manner.

We call it the help desk dashboard which can be ideally used by your level 1 team to quickly understand the infrastructure areas which could be a performance bottleneck for a virtual machine.

Let me quickly show you the dashboard and then I will help you build this in your vROps instance:






















It's a simple yet effective dashboard and here are a few USE CASES where you can use the dashboard:-

Use Case 1 -  Quickly search for an affected VM & look at the Key Performance Indicators to get a direction for further troubleshooting (CPU, RAM, DISK, NETWORK etc.)

Use Case 2 - Quickly review the utilization of a VM for a past few days to months in case you have a request for resource addition such as CPU or Memory expansion.

Use Case 3 - This can also help the VM Right-Sizing Efforts as you can easily pull out the statistics around CPU or RAM utilization going back in Time and share the same with the app owners to get approvals on right-sizing.

Here are the key metrics which can be viewed with a click of a button in this dashboard:-
  • CPU Usage %
  • CPU Contention %
  • Memory Usage %
  • Memory Contention %
  • Network Workload %
  • Virtual Disk Latency (ms) aggregate for all disks in the VM

Well, if this interests you then let's see how we can get this dashboard. To begin with go ahead and download the following file by clicking on the link below. This is the original export of the dashboard which we will import later:-

Click here - HELPDESK-DASHBOARD EXPORT


Let's start building the dashboard now:-

1- Login to vRealize Operations with a user who has privileges to create a new dashboard.

2- Click on the Content tab and click on Manage Metric Config in the inventory window (you need vROps 6.0.1 or later versions for you to see this option. 

3- Under Manage Metric Config, click on ResKndMetric directory and click on the + Sign to create a new XML named - vmperf.xml

Paste the following xml code in blue color on the right pane and click on Save. A screenshot follows to guide you.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AdapterKinds>
   <AdapterKind adapterKindKey="VMWARE">
      <ResourceKind resourceKindKey="VirtualMachine">
         <Metric attrkey="cpu|usage_average" label="" unit="%" yellow="85" orange="90" red="95" />
         <Metric attrkey="cpu|capacity_contentionPct" label="" unit="%" yellow="15" orange="20" red="30" />

         <Metric attrkey="mem|usage_average" label="" unit="%" yellow="85" orange="90" red="95" />
         <Metric attrkey="mem|host_contentionPct" label="" unit="%" yellow="15" orange="20" red="30" />

         <Metric attrkey="net|workload" label="" unit="%" yellow="85" orange="90" red="95" />
         <Metric attrkey="virtualDisk:Aggregate of all instances|totalLatency" label="" unit="ms" yellow="20" orange="30" red="40" />
         <Metric attrkey="virtualDisk:Aggregate of all instances|commandsAveraged_average" label="" unit="IOPS" yellow="10000" orange="30000" red="40000" />
         <Metric attrkey="diskspace|snapshot" label="" unit="" yellow="1" orange="2" red="3" />
      </ResourceKind>
   </AdapterKind>
   <AdapterKind adapterKindKey="bbb">
   </AdapterKind>
</AdapterKinds>





4- Now let's import the dashboard file which we downloaded before. Click on Content -> Dashboards - > Settings Button -> Import Dashboards. 


5- Select the HELPDESKDB.json file you downloaded earlier and click on OK to import the dashboard.



The above step would create the dashboard for you. Let us quickly share the dashboard as well.


6- Under the Dashboards Tab, Click on the settings button again and click on Share Dashboards.



















7 - Now select the newly created HELPDESK Dashboard and drag & drop it on the groups with whom you want to share the same.





By now, you should have your dashboard ready to use. Please do let me know as to how you are using this dashboard in your environment in the comments sections..

Till then.. Do not forget to SHARE & SPREAD THE KNOWLEDGE!! 




Tuesday, April 15, 2014

Part 3 - vCOps Cluster Utilization Dashboard - Bringing it all together!

This is the last and final part of a 3 post series on creating a vCOps Cluster Utilization Dashboard. Before you read or implement this part on your instance of vCenter Operations Manager, you need to ensure that you follow the following articles:-


Part 2 - Creating Supermetrics for Cluster Utilization Dashboard in vCOps!


So from the last part of this series you have the Supermetrics ID of all the Supermetrics which you have created in your environment. We have 8 supermetrics with id's from 1 to 8.


To begin with download the following XML file which has the code for the Utilization Metrics:-



Open this file in a notepad after downloading it and now replace the shown metrics with the supermetrics ID which you have captured in the part 2 of this post. For me the Supermetrics ID is from 1 to 8 & I have highlighted the same. You need to edit the file with the supermetric ID corresponding to your instance of vCOps.

WARNING - DO NOT CHANGE ANYTHING ELSE IN THE FILE NOR THE NAME OF THE FILE. LEAVE EVERYTHING AS IT IS.

Here is how the file will look like and the values you need to edit.


STEP 1 - Place the edited xml file in a specific location of the UI VM

1- Use an SCP software to login to the UI VM using the root credentials. I am using WinSCP.

2- Change the directory to the following location /usr/lib/vmware-vcops/tomcat-enterprise/webapps/vcops-custom/WEB-INF/classes/resources/reskndmetrics


3- Drag and drop the 3-Cluster Wise Utilization - int-file-ver2.xml file from your system where you downloaded it to this directory as shown in the screenshot below.




4- Right click on the target file and click on Properties to change the permission level to 644 (For Read & Execute rights) as shown below.






You are done with STEP 1. Let's look at STEP 2. Before that download the dashboard xml which you need to import from here:-


STEP 2 - Import the dashboard in vCOps Custom UI

1- Login to vCOps Custom UI with an ID with Administrative Privileges.

2- Click on the Import Option under Dashboard Tools.


3- Browse to the location where you have saved the 3-Cluster Wise Utilization-DB-ver2 and click on Import.

4- You will get a dialog box that your dashboard it successfully imported. Close the same and click on the Dashboards Menu to find a new dashboard named "CLUSTER WISE UTILIZATION"

5- Click on this and you will get the dashboard which we saw in the beginning of this post. Ain't it simple :-)

6- In case you do not see a blank dashboard, Edit the Resources Widget on the Left Pane, Browse to Resource Kinds - > Cluster Compute Resource -> Click on All Attributes once and click on OK. This will get you the list of the clusters and you will be good to go!!


Hope you enjoy this dashboard :-)

Closing this series. Will see you with another custom dashboard soon. Till then!!


********************************Update 29-July-2014*******************************

As per the comments from Jeff and Kenneth, post implementing the steps mentioned in this 3 part blog post, they had a Blue Box with a question mark and No Data written on the CPU-TOTAL CAPACITY and MEMORY-TOTAL CAPACITY

The Blue Box represents that the data is not being collected for the metric for that particular object. On investigation it was found that the metrics of CPU Total (Mhz) and Memory Total (Kb) were not being collected on the vCOps instance since they were running a balance profile for metrics collection. Here are the steps to enable collection.

Login to Custom UI - Environment - Configuration - Attribute Packages - Select Adapter Kind as VMware Adapter - Select Resource Kind as Cluster Compute Resource - Select Default Attributes and Click on OK - Expand CPU Usage and Check Total CPU - Expand Memory and Check Total Memory) - Click on Okay. Log out of vCOps and login after 5 minutes.



Share & Spread the Knowledge!!






Monday, April 14, 2014

Part 2 - Creating Supermetrics for Cluster Utilization Dashboard in vCOps!

Continuing from the previous part where I gave you an overview of the Cluster Utilization Dashboard, in this post we will create all the 8 Supermetrics required for this dashboard. We will start with one example, wherein I will give you step by step instructions and you would need to repeat the steps for the rest of the Supermetrics.

To begin with let's look at the Supermetrics which we need to create:-



CREATING THE SUPERMETRICS

Let's create the SM 1. Here we need to get the Total VMs a cluster can host, hence to get that number we will add Total VMs deployed so far with the Total Remaining. This is how the formula would look like:-




Note:- For someone new to super metric concept, I would recommend you read this white paper from VMware.

1- Login to vCOps Custom UI with a user with appropriate access rights.

2- Click on Environment -> Super Metrics










3- Click on the Add New icon on this window to create a new super metric.











4-  Configure your super metric as shown in figure below. Follow the steps from 1 to 5 and click on OK


5- Now you need to configure the rest of the 8 Super metrics the same was as I showed you the first one. Here are the formulas which can help you get to the correct metric.


SM 2




SM 3




SM 4



SM 5



SM 6



SM 7




SM 8




6- Once you have created all the Supermetrics, your list will appear as mine. Please make sure that you note down all the Supermetrics ID as we would need them in PART 3 when we bring this all together. For me they are Number 1 to 8.



CREATING A SUPERMETRICS PACKAGE AND ADDING THE SUPERMETRICS

We will now create a Supermetric package where we will add all these Supermetrics and then apply them on the clusters of my environment to start calculating this metric.

7- Click on Package Editor and click on the + symbol to add a package.




8- Since all these Supermetrics are for Cluster level, give it a name, I call it SM-CLUSTER. Put a check against all the supermetrics you want to add to this package. You can then setup DT configuration if required else just click on OK.





APPLYING THE SUPERMETRICS PACKAGE ON THE EXISTING & NEW CLUSTERS

Now that your Supermetrics package is ready, you need to apply the same on the existing clusters and also apply the same on the Cluster Compute Resource kind to ensure that all these supermetrics are calculated for any new cluster which you bring into vCenter Operations Manager. Here are the steps:-


9- Click on Environment -> Environment Overview.

10- On the left pane navigate to Resource Kinds -> Cluster Compute Resources -> Default Attributes as shown in the screenshot below. This will list all the existing clusters in your environment.



11- Select all the clusters and click on the Edit Button to edit the properties of the selected cluster. If you have a lot of clusters then you can select the 1st item (Press the CTRL + SHIFT) on the keyboard and select the last item. This will select all the clusters. Click on the Edit button as shown below.



12- Under Supermetric package apply the package, SM-CLUSTER which we created in Step 8 by clicking on the drop down arrow as shown below & click on OK. This will apply all the supermetrics on all the existing clusters.



13 - Finally, let us apply this package on the Cluster Compute Resource Kinds to ensure that every new cluster has these metrics by default. Click on Environment -> Configuration -> Resource Kinds Default.

14 - Select Cluster Compute Resource on the Left pane and Select the SM-CLUSTER package under super metric package & click on OK.




Alright, so we are done with the trivial part.. In the Next Part, I will help you bring together these Supermetrics and an XML file which I have created for you guys to download to get your final Cluster Utilization Dashboard.

Till then - stay tuned...



***Share & Spread the Knowledge***




Tuesday, April 8, 2014

Part 1 - Creating a Cluster Utilization Dashboard in vCOps Custom User Interface!

A few days back I wrote a post on creating a One-Click Cluster Capacity Dashboard which was liked by a number of people in the virtual world. In-fact it was so easy to download and replicate that within a few hours of rolling out that post, I could see a number of people coming back to me stating that they have deployed the Dashboard and have started looking at the Capacity numbers for their infrastructure. Many of them asked as to how can they create their own XMLs for creating similar dashboards. I wrote another post in a few days which spoke about Creating your own XMLs for Custom Dashboards and got some great feedback on that as well.

Doing this is so much fun, however more often it is difficult to think of the various problems you can solve with these Custom Dashboards. With my continuous engagements with the customers on the field, I get some fancy requests which keeps my brain working on digging out possibilities with vCenter Operations Manager. 

In my last engagement with a customer, I installed the Capacity Dashboard for him which I have already shared with you guys before. The immediate reaction of the customer after looking at the dashboard was to have something similar for his environment which could help him gauge the UTILIZATION of each cluster with a single click. This includes, CPU, Memory & Disk Utilization. The client was very clear with what he needs and that helped me create the following dashboard.

I will do this Dashboard in a 3 Part Series.

Part 1 - Introduction to the Cluster Utilization Dashboard (This post)
Part 2 - Creating the required Supermetrics for the Cluster Utilization Dashboard
Part 3 - Bringing it all together.

NOTE - This dashboard uses both Regular vCOps Derived Metrics and SuperMetrics. I have marked the Scorecard boxes which are using Supermetrics with the initials "SM <Number>". We would need to create these SuperMetrics before we could use the .XML file and import the Dashboard as we did previously. 


















Let us first look at the features & use cases for this dashboard and then we would proceed with the steps on how to build the each component of this dashboard.

CLUSTER UTILIZATION DASHBOARD - FEATURES

1 - Gives you a single page view of the Utilization of all your vSphere Clusters being monitored by vCenter Operations Manager. (One of Multiple vCenter Servers). Click on a cluster on the left pane for which you want to know the UTILIZATION data and on the right pane you will see the same.

2- The 1st row gives you an overview on how many VMs can be deployed in a cluster based on the vCOps average profile, how many are deployed and how many more can be deployed based on the deployment trends.

3- Then you have 3 rows of CPU , Memory & Storage Total Capacity,  Allocated Capacity, Usage, Usage in percentage & finally the number of VMs remaining keeping a resource in mind such as CPU, Memory & Storage.

4- It is important to note that vCOps uses local storage if available on the ESXi hosts, hence the storage stats might be a bit skewed. You can create groups within vCOps to isolate local storage from SAN cluster wise but then it will not allow you to have a dynamic dashboard such as this. You will have to then create a separate dashboard for each of your cluster & create a new one every time you add a cluster. But with THIS cluster utilization dashboard everything is automatic and dynamic ;-)

5- This is the most asked Dashboard by CxO's as they want a one click summary of what they have, how much they have used and what is remaining. This is the LARGEST use case hands down.

6- Their are last 30 days trend-lines as well for the specific metric which makes it a bit more informative.


CLUSTER UTILIZATION DASHBOARD - SUPERMETRICS??

I wrote another post on vCenter Operations Manager some time back where I have showcased how to create Supermetrics. In this post, I will show you how to create one of the Supermetric through screenshots and then give you the formula for rest of the super metrics which you can create yourself following the example. If you closely look at the screenshot of the dashboard, you will notice that this dashboard displays 20 metrics in total. 8 out of 20 are Supermetrics. The table below shows what metrics & Supermetrics are being displayed.


Need less to say that the one in RED are the Supermetrics and the others are derived metrics. Before we bring this all together, let me share the steps to create a Supermetric, let's say SM 1

I will close this part right now and in PART 2, I will explain as to how we need to create all these Supermetrics. That should be out by tomorrow so stay tuned :-)


***Share & Spread the Knowledge***



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