Automating vSAN Policy Application: Building the Dashboard 2 of 5
## Introduction:
In the second installment of our series on automating vSAN policy application, we dive into the crucial aspect of Super Metrics. Understanding the I/O characteristics of a VM is paramount in determining the appropriate vSAN policy. Let’s explore the creation of essential Super Metrics to fine-tune policy decisions.
## Super Metrics for I/O Characteristics
#### 1. vDisk Write Percentage Super Metric
Purpose:
This Super Metric is designed to calculate the percentage of write operations relative to the total I/O commands for a virtual disk. Understanding the write intensity of a VM is crucial for selecting an appropriate vSAN policy.
– Navigate to: Configure -> Super Metrics -> Add
– Configuration:
– Name: vDisk Write Percentage
– Description: vDisk Write Percentage
– Object types: Virtual Machine
– Formula:
(max({This Resource: virtualDisk:Aggregate of all instances|numberWriteAveraged_average})
/
max({This Resource: virtualDisk:Aggregate of all instances|commandsAveraged_average}))
* 100
– Policies: Default policy (or based on your preferences)
Explanation:
- It calculates the ratio of averaged write operations to averaged total I/O commands.
- The result is multiplied by 100 to obtain the percentage of write operations.
#### 2. vDisk Read Percentage Super Metric
Purpose:
Similar to the vDisk Write Percentage, this Super Metric focuses on read operations. It calculates the percentage of read operations relative to the total I/O commands for a virtual disk.
– Navigate to: Configure -> Super Metrics -> Add
– Configuration:
– Name: vDisk Read Percentage
– Description: vDisk Read Percentage
– Object types: Virtual Machine
– Formula:
(max({This Resource: virtualDisk:Aggregate of all instances|numberReadAveraged_average})
/
max({This Resource: virtualDisk:Aggregate of all instances|commandsAveraged_average}))
* 100
– Policies: Default policy (or based on your preferences)
Explanation:
- Calculates the ratio of averaged read operations to averaged total I/O commands.
- Multiplies the result by 100 to get the percentage of read operations.
#### 3. vSAN RAID Policy Super Metric
Purpose:
This Super Metric combines various factors to determine the appropriate RAID policy for vSAN. It considers disk space usage, write operations, and read percentage.
– Navigate to: Configure -> Super Metrics -> Add
– Configuration:
– Name: vSAN RAID Policy
– Description: vSAN RAID Policy
– Object types: Virtual Machine
– Formula:
count({This Resource: diskspace|used, depth=1, where= ($value >= 1000)})
&&
count({This Resource: virtualDisk:Aggregate of all instances|numberWriteAveraged_average, depth=1, where= ($value <= 250)})
&&
count({This Resource: Super Metrics|vDisk Read Percentage, depth=1, where= ($value >= 30)})
? 5: 1
– Policies: Default policy (or based on your preferences)
Explanation:
- Checks if disk space usage is above 1000 (condition for one aspect of RAID).
- Ensures that write operations are below 250 (another RAID aspect).
- Considers the read percentage (from vDisk Read Percentage Super Metric) to be above 30.
- Assigns a RAID level of 5 if all conditions are met; otherwise, it defaults to RAID 1.
### Script Integration
For seamless integration with the script, import these Super Metrics. If import issues arise, manually create them. When manually creating the “vSAN RAID Policy” Super Metric, note down the ID. You’ll need it for updating the PowerShell script.
Stay tuned for the next blog!
