vSphere Performance data – Monitoring VMware vSAN performance

In my blog series on building a solution for monitoring vSphere Performance we have scripts for pulling VM and Host performance. I did some changes to those recently, mainly by adding some more metrics for instance for VDI hosts.

This post will be about how we included our VSAN environments to the performance monitoring. This has gotten a great deal easier after the Get-VSANStat cmdlet came along in recent versions of PowerCLI.

We will build with the same components as before, a PowerCLI script pulling data and pushing it to an InfluxDB time-series database and finally visualizing it in some Grafana dashboards. continue reading

Automating iLO config and OneView setup for HPE servers

We have quite a few Blade Enclosures with BL460c server blades in them and have been happy with those. For managing these we are primarly using HPE OneView and in some cases the Onboard Administrator (OA).

Our latest batch of new hardware however was DL360 and DL380 rack servers. These will also be managed by OneView primarly, but initially we need to do some iLO config on each server which in the case of blades are done by the OA. They will also have to be added to OneView manually while the blades would be brought in automatically from the chassis. With lots of new servers to configure this is a tedious process, and there are risk for errors and inconsistency when doing it manually.

To the rescue comes the APIs provided by HPE and our favourite tool, Powershell. continue reading

Import-SpbmStoragePolicy error – Object reference not set to an instance of an object

In a previous post I’ve talked about issues in the StoragePolicy and Tag cmdlets in PowerCLI. I found a workaround by ignoring certificate warnings and setting my date format to en-US.

Today I tried to replicate some Storage Policies from one vCenter to another and I found that I got new errors…

I can export the policies without issues, but when I try to Import the policy to the new vCenter I get the following error: “Object reference not set to an instance of an object”. Update 2018-04-06: VMware has confirmed the issue and stated it will be fixed in PowerCLI 10.1 continue reading

Creating a Powershell module as an API wrapper

We all love today’s modern web with lots of API’s available, both for retrieving information from various sources, gaining additional insights and for transform and enrich your data. Most API’s today are RESTFUL, meaning that they should follow the REST principles. REST is not a standard, it’s more a guideline for how to design your API.

With the REST guidelines in place many API’s share the same or similar structure and with that it gets easier to work with API’s as you can make use of the same techniques. If you’re familiar with Windows Powershell this is one of the easiest ways of exploring an API.

This was also the reason why my good colleague Martin Ehrnst and I decided to do a talk on using Powershell and API’s on the Nordic Infrastructure Conference (NIC) in Oslo this year. The slides and demos from that session, Invoke-{your}RestMethod will available here shortly. continue reading

More DRS group automation

Following up on my last post on Automating DRS Groups with PowerCLI I found that we also need to automatically remove VMs and Hosts from a given DRS Group.

Although I could have included this in the previous script which creates the groups and adds members I wanted to separate them. There could for instance be times when you would like to run such a script on a different interval than the one that adds members as well as other scenarios. I believe it’s also a good practice to build smaller scripts and functions that have more specific tasks. You could argue that the creation script also could be split up into a part that creates groups and a part that adds the members, and even maybe further splitting Hosts from VMs but that would be a future task.

Anyways, the removal of entities like Hosts and VMs from a DRS group is as easy as putting them in. continue reading

Automating DRS groups with PowerCLI

In vCenter we have lot’s of DRS functionalities. I won’t go into all of them here, you’ll probably know about most of them already.

This blog post will talk about the VM/Host affinity functionality, i.e. rules to keep VMs running one or more specific host(s).

There is multiple use-cases for this. You might want to keep some VMs together on the same host to minimize latency, maybe you are doing some port mirroring and so on. In my scenario the use case is keeping some VMs on specific hosts for license compliance. Licensing is a huge topic and are always subject to change so this might not be a use-case in the future. continue reading

vSphere Performance data – Part 8 – Wrap-up and next steps

This is Part 8 and last part (I think…) of my series on vSphere Performance data.

Part 1 discusses the project, Part 2 is about exploring how to retrieve data, Part 3 is about using Get-Stat for the retrieval. Part 4 talked about the database used to store the retrieved data, InfluxDB. Part 5 showed how data is written to the database. Part 6 was about creating dashboards to show off the data. Part 7 added more data to the project. This part will try to wrap up and look at some future steps.

When I started my project I did it with a clear picture on how and what software I would use. Therefore I didn’t look around much for if and how others had done it. After a while I did find that (of course) several others have done similar projects with vSphere performance data, InfluxDB and Grafana. continue reading

vSphere Performance data – Part 7 – More data

This is Part 7 of my series on vSphere Performance data.

Part 1 discusses the project, Part 2 is about exploring how to retrieve data, Part 3 is about using Get-Stat for the retrieval. Part 4 talked about the database used to store the retrieved data, InfluxDB. Part 5 showed how data is written to the database. Part 6 was about creating dashboards to show off the data. This post adds even more data to the project!

One thing I’ve learned by this project is that when you gather data you are always looking out for other data sources to add! Until now we’ve seen how we have retrieved metrics from all VMs in our environment on 20 second intervals. But what about the ESXi hosts running those VMs? And what about the Storage arrays they use? continue reading

vSphere Performance data – Part 6 – The Dashboard(s)

This is Part 6 of my series on vSphere Performance data.

Part 1 discusses the project, Part 2 is about exploring how to retrieve data, Part 3 is about using Get-Stat for the retrieval. Part 4 talked about the database used to store the retrieved data, InfluxDB. Part 5 showed how data is written to the database. This post will show some results of our work!

As I talked about in Part 1 I had decided to go with Grafana as the front-end. Grafana is an open source software for time series analytics which can make use of several datasources, making it the perfect match for the data in my InfluxDB. continue reading

vSphere Performance data – Part 5 – The script

This is Part 5 of my series on vSphere Performance data.

Part 1 discusses the project, Part 2 is about exploring how to retrieve data, Part 3 is about using Get-Stat for the retrieval. Part 4 talked about the database used to store the retrieved data, InfluxDB. This one will do some actual work and will retrieve data from vCenter and write it to the database.

The last post showed how to write some data to the performance database InfluxDB through its API. As Powershell is good at interacting with APIs this is what I will use for writing the data. continue reading