In dit artikel wordt stapsgewijs uitgelegd hoe u een stand-bypool maakt voor virtuele-machineschaalsets met flexibele indeling.
Opmerking
Het instellen van de stand-by pool VM-status in slaapstand is nog niet beschikbaar in de Azure portal. Gebruik een alternatieve SDK, zoals CLI of PowerShell, als u een stand-bypool wilt configureren met een gesluimerde VM-status.
- Navigeer naar uw virtuele-machineschaalset.
- Selecteer stand-bypool onder Beschikbaarheid en schaal.
- Selecteer Groep beheren.
- Geef een naam op voor uw pool, selecteer een inrichtingsstatus en stel de maximale en minimale gereedheidscapaciteit in.
- Selecteer Opslaan.
U kunt ook een stand-bypool configureren tijdens het maken van een virtuele-machineschaalset door naar het tabblad Beheer te gaan en het selectievakje in te schakelen om stand-bypools in te schakelen.
Maak een stand-bypool en koppel deze aan een bestaande schaalset met behulp van 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"
Maak een stand-bypool en koppel deze aan een bestaande schaalset met behulp van 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"
Maak een stand-bypool en koppel deze aan een bestaande schaalset. Maak een sjabloon en implementeer deze met behulp van az deployment group create of 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/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
}
},
"resources": [
{
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
"apiVersion": "2025-03-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"properties": {
"elasticityProfile": {
"maxReadyCapacity": "[parameters('maxReadyCapacity')]",
"minReadyCapacity": "[parameters('minReadyCapacity')]"
},
"virtualMachineState": "[parameters('virtualMachineState')]",
"attachedVirtualMachineScaleSetId": "[parameters('attachedVirtualMachineScaleSetId')]"
}
}
]
}
Maak een stand-bypool en koppel deze aan een bestaande schaalset. Implementeer de sjabloon met behulp van az deployment group create of 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/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet'
resource standbyPool 'Microsoft.standbypool/standbyvirtualmachinepools@2025-03-01' = {
name: standbyPoolName
location: location
properties: {
elasticityProfile: {
maxReadyCapacity: maxReadyCapacity
minReadyCapacity: minReadyCapacity
}
virtualMachineState: vmState
attachedVirtualMachineScaleSetId: virtualMachineScaleSetId
}
}
Maak een stand-bypool en koppel deze aan een bestaande schaalset met behulp van Maken of Bijwerken.
PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/myStandbyPool?api-version=2025-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"
}
}