Thanks to Ara Petrosyan, Felix Azizyan, Ani Harutyunyan and Thomas Kopton for their help.
One of the most used features in VCF Operations is its integrated capacity management engine. It has comprehensive capabilities to take metrics like HA, buffers and more into consideration and present the remaining capacity automatically.
VCF Operations provides a capacity view for native clusters as well as vSAN clusters. For vSAN however the default setting just looks at the absolute free vSAN space – not honoring vSAN storage policies. This is valid if the absolute capacity of the platform. It’s however desirable to get a more workload-oriented view which honors the vSAN storage policy to be used. For example, the “vSAN Default Storage Policy” defines that a workload is deployed using a RAID-1 mirroring mechanism which means that if every VM leverages this policy, the available space is cut by half.
To show the storage policy details, VCF Operations has introduced capacity metrics to reflect the different vSAN storage policies available. Though the default capacity dashboard does not use them. In this blog I will explain how the capacity engine can be modified to meet that requirement.
VCF Operations capacity presentation
The storage capacity in vCenter is shown under the vSAN Cluster / Monitor / vSAN / Capacity section. It shows the absolute space details as well as the effective free space honoring the vSAN storage policy selected.
VCF Operations includes a capacity view on the vSAN Cluster object (tree vSAN Adapter / vSAN Cluster / <vSAN Cluster>). This view only represents the absolute capacity calculation. No storage policies are taken into consideration.
In addition, VCF Operations has introduced specific what-if-metrics related to the available vSAN storage policies. You find them on the vSAN cluster object in the vSAN / What If Analysis metric section. They show the free space on the vSAN storage with the assumption that the respective storage policy is used for all new workloads – like the vCenter view explained above.
The question now is: How can those metrics be used to reflect the projection in the native capacity screen?
In one VCF Operations 8.18.0 the functionality has been added to use custom metrics for the capacity calculation engine. Having the projection metrics above available it’s just a matter of getting the right values in a metric that matches the capacity engine. This is where super metrics come into the game.
Creating a Super Metric
Please note: There might be differences on how capacity is calculated based on the settings for “operations and host rebuild reserve” in vCenter. In my example I was using a vSAN ESA configuration with both settings enabled.
To tailor the capacity engine, we need a super metric that reflects the total capacity of the datastore based on the projection of the storage policy free space. Therefore, on a high level the default capacity calculation is as following:
Total capacity – reserved capacity – used space = capacity remaining
This reflects the absolute values.
The what if metrics shown in the previous example do provide the information how much space would be available for VMs if the selected storage policy is applied to all of them. To reflect this in the capacity calculation we could simply replace the absolute total capacity by the total capacity compiled using the capacity remaining metric and the potential free space metric with the storage policy in place.:
Total capacity with storage policy = Total capacity – capacity remaining – reserved space + storage policy free space
Be aware this would not expose reserved capacity/slack space and virtually set it to 0. If a different way of handling is desired, the formula can certainly be adapted.
From a super metric perspective, the formula will look like this:ettings enabled.
To tailor the capacity engine, we need a super metric that reflects the total capacity of the datastore based on the projection of the storage policy free space. Therefore, on a high level the default capacity calculation is as following:
{This Resource: vsan|diskSpace|totalDiskSpace} - {This Resource: summary|cluster_capacity_remaining} - {This Resource: vsan|slackSpace|hostRebuildCapacity} -{This Resource: vsan|slackSpace|minSpaceRequiredForVsanOp} + {This Resource: vsan|WhatIf:vSAN Default Storage Policy|effectiveFreeSpace}
Formatted:
${this, metric=vsan|diskSpace|totalDiskSpace} - ${this, metric=summary|cluster_capacity_remaining} - ${this, metric=vsan|slackSpace|hostRebuildCapacity} -${this, metric=vsan|slackSpace|minSpaceRequiredForVsanOp} + ${this, metric=vsan|WhatIf:vSAN Default Storage Policy|effectiveFreeSpace}
Here’s how I created the super metric. For the lazy ones there is an export available for download.
Note: The Unit was set to GB otherwise the capacity policy configuration will send a warning message.
Just apply the super metric on the policy where your vSAN clusters are in and wait min. 5 minutes for it to appear in the metrics list.
Customization of the capacity metrics
As mentioned above, VCF Operations since version 8.18.0 allows for customization of the capacity metrics. We will make use of this capability and replace the default total capacity metric with the new super metric created. To do that go to your respective policy definition and edit its capacity settings.
Make sure you go to the “Capacity Thresholds and Metrics” section and select “vSAN Cluster” under the “vSAN Adapter” in the tree. On the right hand side, you will find a second tab “Custom Metrics”. In this tab you must enable editing (lock symbol) and edit the Total Capacity metric by selecting the super metric created before.
Testing the solution
Once all configuration is done, just wait a couple of minutes for the capacity engine to adjust. Finally you will see the capacity sceen has adapted and now shows the capacity remaining value that matches what vCenter is presenting (smaller variation might be possible due to how the capacity engine works). As mentioned, slack space is shown as 0.
Have fun!
- Capacity Management for vSAN Storage Policies - 20. December 2024
- Extend vCenter metrics with Management Pack Builder - 20. December 2024
- VCF Automation – VM with post script execution - 18. December 2024