Create a standby pool
Article 02/20/2025
2 contributors
Feedback
In this article
This article steps through creating a standby pool for Virtual Machine Scale Sets with Flexible Orchestration.
Prerequisites
To allow standby pools to create and manage virtual machines in your subscription, assign the appropriate permissions to the standby pool resource provider.
In the Azure portal, navigate to your subscriptions.
Select the subscription you want to adjust permissions.
Select Access Control (IAM) .
Select Add and Add role assignment .
Under the Role tab, search for Virtual Machine Contributor and select it.
Move to the Members Tab.
Select + Select members .
Search for Standby Pool Resource Provider and select it.
Move to the Review + assign tab.
Apply the changes.
Repeat the above steps and assign the Network Contributor role and the Managed Identity Operator role to the Standby Pool Resource Provider. If you're using images stored in Compute Gallery assign the Compute Gallery Sharing Admin and Compute Gallery Artifacts Publisher roles as well.
For more information on assigning roles, see assign Azure roles using the Azure portal .
Create a standby pool
Navigate to your Virtual Machine Scale Set.
Under Availability + scale select Standby pool .
Select Manage pool .
Provide a name for your pool, provisioning state and maximum and minimum ready capacity.
Select Save .
You can also configure a standby pool during Virtual Machine Scale Set creation by navigating to the Management tab and checking the box to enable standby pools.
Create a standby pool and associate it with an existing scale set using az standby-vm-pool create .
az standby-vm-pool create \
--resource-group myResourceGroup \
--location eastus --name myStandbyPool \
--max-ready-capacity 20 \
--min-ready-capacity 5 \
--vm-state "Deallocated" \
--vmss-id "/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
Create a standby pool and associate it with an existing scale set using New-AzStandbyVMPool .
New-AzStandbyVMPool `
-ResourceGroup myResourceGroup `
-Location eastus `
-Name myStandbyPool `
-MaxReadyCapacity 20 `
-MinReadyCapacity 5 `
-VMState "Deallocated" `
-VMSSId "/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
Create a standby pool and associate it with an existing scale set. Create a template and deploy it using az deployment group create or New-AzResourceGroupDeployment .
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "east us"
},
"name": {
"type": "string",
"defaultValue": "myStandbyPool"
},
"maxReadyCapacity" : {
"type": "int",
"defaultValue": 20
},
"minReadyCapacity" : {
"type": "int",
"defaultValue": 5
},
"virtualMachineState" : {
"type": "string",
"defaultValue": "Deallocated"
},
"attachedVirtualMachineScaleSetId" : {
"type": "string",
"defaultValue": "/subscriptions/{subscriptionID}/resourceGroups/StandbyPools/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
}
},
"resources": [
{
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
"apiVersion": "2024-03-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"properties": {
"elasticityProfile": {
"maxReadyCapacity": "[parameters('maxReadyCapacity')]",
"minReadyCapacity": "[parameters('minReadyCapacity')]"
},
"virtualMachineState": "[parameters('virtualMachineState')]",
"attachedVirtualMachineScaleSetId": "[parameters('attachedVirtualMachineScaleSetId')]"
}
}
]
}
Create a standby pool and associate it with an existing scale set. Deploy the template using az deployment group create or New-AzResourceGroupDeployment .
param location string = resourceGroup().location
param standbyPoolName string = 'myStandbyPool'
param maxReadyCapacity int = 20
param minReadyCapacity int = 5
@allowed([
'Running'
'Deallocated'
])
param vmState string = 'Deallocated'
param virtualMachineScaleSetId string = '/subscriptions/{subscriptionID}/resourceGroups/StandbyPools/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet}'
resource standbyPool 'Microsoft.standbypool/standbyvirtualmachinepools@2024-03-01' = {
name: standbyPoolName
location: location
properties: {
elasticityProfile: {
maxReadyCapacity: maxReadyCapacity
minReadyCapacity: minReadyCapacity
}
virtualMachineState: vmState
attachedVirtualMachineScaleSetId: virtualMachineScaleSetId
}
}
Create a standby pool and associate it with an existing scale set using Create or Update .
PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/myStandbyPool?api-version=2024-03-01
{
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
"name": "myStandbyPool",
"location": "east us",
"properties": {
"elasticityProfile": {
"maxReadyCapacity": 20
"minReadyCapacity": 5
},
"virtualMachineState":"Deallocated",
"attachedVirtualMachineScaleSetId": "/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
}
}
Next steps
Learn how to update and delete a standby pool .