Skip to content

Commit 81dded0

Browse files
Merge pull request #313400 from pri-mittal/patch-47
Implement normalization for ISF ratios in documentation
2 parents c0e6944 + 030356a commit 81dded0

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

articles/cost-management-billing/reservations/instance-size-flexibility.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,82 @@ The ISF ratio information is found in the API response within each catalog item'
8585
- `ReservationsAutofitGroup` - Contains the flexibility group name
8686
- `ReservationsAutofitRatio` - Contains the ratio value for that SKU
8787

88+
## Normalize ISF ratios
89+
90+
The raw ISF ratios from the API and powershell don't always start at `1` for the smallest SKU in a group. For example, the `BS Series` group starts at `0.25` and the `Ddsv5 Series` starts at `2`. To make ratios easier to compare, you can normalize them so the smallest SKU in each flexibility group has a ratio of `1`.
91+
92+
```powershell
93+
# Function to normalize ISF ratios so the smallest SKU in each group = 1
94+
function Get-NormalizedISFRatios {
95+
param(
96+
[Parameter(Mandatory=$true)]
97+
[PSCustomObject[]]$ISFData
98+
)
99+
100+
$NormalizedData = @()
101+
$groups = $ISFData | Group-Object InstanceSizeFlexibilityGroup
102+
103+
foreach ($group in $groups) {
104+
# Find the minimum ratio in the group
105+
$minRatio = ($group.Group | ForEach-Object { [double]$_.Ratio } | Measure-Object -Minimum).Minimum
106+
107+
foreach ($item in $group.Group) {
108+
$NormalizedData += [PSCustomObject]@{
109+
InstanceSizeFlexibilityGroup = $item.InstanceSizeFlexibilityGroup
110+
ArmSkuName = $item.ArmSkuName
111+
Ratio = [math]::Round([double]$item.Ratio / $minRatio, 4)
112+
}
113+
}
114+
}
115+
116+
return $NormalizedData
117+
}
118+
119+
# Normalize the extracted ISF data
120+
$NormalizedRatios = Get-NormalizedISFRatios -ISFData $ISFRatios
121+
122+
# Export to CSV
123+
$NormalizedRatios | Export-Csv -Path "isf-ratios-normalized.csv" -NoTypeInformation
124+
125+
# Display sample results
126+
$NormalizedRatios | Select-Object -First 10 | Format-Table
127+
```
128+
129+
#### Example: before and after normalization
130+
131+
**BS Series**
132+
133+
| ArmSkuName | Original Ratio | Normalized Ratio |
134+
|---|---|---|
135+
| Standard\_B1ls | 0.25 | 1 |
136+
| Standard\_B1s | 0.5 | 2 |
137+
| Standard\_B2s | 2 | 8 |
138+
139+
**Ddsv5 Series**
140+
141+
| ArmSkuName | Original Ratio | Normalized Ratio |
142+
|---|---|---|
143+
| Standard\_D2ds\_v5 | 2 | 1 |
144+
| Standard\_D4ds\_v5 | 4 | 2 |
145+
| Standard\_D8ds\_v5 | 8 | 4 |
146+
| Standard\_D16ds\_v5 | 16 | 8 |
147+
| Standard\_D32ds\_v5 | 32 | 16 |
148+
| Standard\_D48ds\_v5 | 48 | 24 |
149+
| Standard\_D64ds\_v5 | 64 | 32 |
150+
| Standard\_D96ds\_v5 | 96 | 48 |
151+
152+
#### Normalized CSV file structure
153+
154+
| Column | Description |
155+
|---|---|
156+
| `InstanceSizeFlexibilityGroup` | The flexibility group name |
157+
| `ArmSkuName` | The Azure Resource Manager SKU name |
158+
| `Ratio` | The normalized ratio (smallest SKU in each group = 1) |
159+
160+
> [!NOTE]
161+
> After normalization, the ratios remain proportional within each group. A normalized ratio of 2 means the SKU consumes twice the reservation units of the smallest SKU in that group.
162+
163+
88164
## Using PowerShell
89165

90166
### Install required module

0 commit comments

Comments
 (0)