forked from Azure/PSRule.Rules.Azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(new): Added Azure.VMSS.ZoneBalance (Azure#2948)
* feat(new): Added Azure.VMSS.ZoneBalance * fix: Updated ref * fix: Fixed culture * Update docs/en/rules/Azure.VMSS.ZoneBalance.md Co-authored-by: Bernie White <[email protected]> * Update docs/en/rules/Azure.VMSS.ZoneBalance.md Co-authored-by: Bernie White <[email protected]> * Update docs/en/rules/Azure.VMSS.ZoneBalance.md Co-authored-by: Bernie White <[email protected]> * Minor updates --------- Co-authored-by: Bernie White <[email protected]>
- Loading branch information
1 parent
5095d47
commit f0f8f9d
Showing
5 changed files
with
165 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
severity: Important | ||
pillar: Reliability | ||
category: RE:07 Self-preservation | ||
resource: Virtual Machine Scale Sets | ||
online version: https://azure.github.io/PSRule.Rules.Azure/en/rules/Azure.VMSS.ZoneBalance/ | ||
--- | ||
|
||
# Deploy virtual machine scale set instances using best-effort zone balance | ||
|
||
## SYNOPSIS | ||
|
||
Deploy virtual machine scale set instances using the best-effort zone balance in supported regions. | ||
|
||
## DESCRIPTION | ||
|
||
Virtual machine scale sets (VMSS) scale-in/ out based on scaling rules your configured. | ||
When scaling-out (adding instances) using availability zones instances are distribution over the configured zones. | ||
However, it may not be possible to create an instance in a zone if there is an active issue affecting that zone. | ||
|
||
The distribution behavior of instances across zones can be configured with two modes: | ||
|
||
- **Best-effort zone balance** - Attempt to scale-in/ out while maintaining balance across zones. | ||
If that is not possible, allow temporary imbalance so the scaling operation can complete. | ||
- On subsequent scale-out attempts, the scale set adds VMs to the zones needing more VMs to restore balance. | ||
- On subsequent scale-in attempts, the scale set removes VMs from zones that have more VMs than required to restore balance. | ||
- **Strict zone balance** - Only allow the scaling operation to continue if zone balanced can be maintained. | ||
If that is not possible, the scaling operation will fail. | ||
|
||
Key points: | ||
|
||
- Both modes attempt to keep balance across zones but have a different approach when balance can't be maintained. | ||
- Scale-out typically occurs to reduce pressure on the already provisioned instances by increasing capacity. | ||
- If scale-out fails, the workload may become unstable due to increasing pressure. | ||
- Balance only applies when two or more zones are configured on the VMSS. | ||
- An outage or disruption in a zone may impact a higher percentage of the workload instances when the workload is not balanced. | ||
|
||
## RECOMMENDATION | ||
|
||
Consider using best-effort zone balancing to maintain stability of the workload under load. | ||
|
||
## EXAMPLES | ||
|
||
### Configure with Azure template | ||
|
||
To set best-effort zone balance for a virtual machine scale set: | ||
|
||
- Set the `properties.zoneBalance` property to `false`. | ||
|
||
For example: | ||
|
||
```json | ||
{ | ||
"type": "Microsoft.Compute/virtualMachineScaleSets", | ||
"apiVersion": "2023-09-01", | ||
"name": "[parameters('name')]", | ||
"location": "[parameters('location')]", | ||
"sku": { | ||
"name": "b2ms", | ||
"tier": "Standard", | ||
"capacity": 3 | ||
}, | ||
"properties": { | ||
"zoneBalance": false | ||
}, | ||
"zones": [ | ||
"1", | ||
"2", | ||
"3" | ||
] | ||
} | ||
``` | ||
|
||
### Configure with Bicep | ||
|
||
To set best-effort zone balance for a virtual machine scale set: | ||
|
||
- Set the `properties.zoneBalance` property to `false`. | ||
|
||
For example: | ||
|
||
```bicep | ||
resource vmss 'Microsoft.Compute/virtualMachineScaleSets@2023-09-01' = { | ||
name: name | ||
location: location | ||
sku: { | ||
name: 'b2ms' | ||
tier: 'Standard' | ||
capacity: 3 | ||
} | ||
properties: { | ||
zoneBalance: false | ||
} | ||
zones: [ | ||
'1' | ||
'2' | ||
'3' | ||
] | ||
} | ||
``` | ||
|
||
<!-- external:avm res/compute/virtual-machine-scale-set zoneBalance --> | ||
|
||
## LINKS | ||
|
||
- [RE:07 Self-preservation](https://learn.microsoft.com/azure/well-architected/reliability/self-preservation) | ||
- [Zone balancing](https://learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-use-availability-zones#zone-balancing) | ||
- [Azure resource deployment](https://learn.microsoft.com/azure/templates/microsoft.compute/virtualmachinescalesets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters