Skip to content

Commit 52298da

Browse files
author
Jill Grant
authored
Merge pull request #274228 from mimckitt/pool-updates-3
Updating Samples
2 parents 5801dcd + 14320b2 commit 52298da

File tree

3 files changed

+150
-64
lines changed

3 files changed

+150
-64
lines changed

articles/virtual-machine-scale-sets/standby-pools-create.md

Lines changed: 77 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@ Register-AzResourceProvider -ProviderNamespace Microsoft.StandbyPool
2929
Register-AzProviderFeature -FeatureName StandbyVMPoolPreview -ProviderNamespace Microsoft.StandbyPool
3030
```
3131

32+
Alternatively, you can register directly in the Azure portal.
33+
1) In the Azure portal, navigate to your subscriptions.
34+
2) Select the subscription you want to enable standby pools.
35+
3) Under settings, select **Resource providers**.
36+
4) Search for **Microsoft.StandbyPool** and register the provider.
37+
5) Under settings, select **Preview features**.
38+
6) Search for **Standby Virtual Machine Pool Preview** and register the feature.
39+
40+
3241
### Role-based Access Control Permissions
33-
In order for standby pools to successfully create Virtual Machines, you need to assign the appropriate RBAC roles.
42+
In order for standby pools to successfully create Virtual Machines, you need to assign the appropriate RBAC permissions.
43+
3444
1) In the Azure portal, navigate to your subscriptions.
3545
2) Select the subscription you want to adjust RBAC permissions.
3646
3) Select **Access Control (IAM)**.
@@ -41,7 +51,7 @@ In order for standby pools to successfully create Virtual Machines, you need to
4151
8) Select the standby pool Resource Provider and select **Review + Assign**.
4252
9) Repeat the above steps and for the **Network Contributor** role and the **Managed Identity Operator** role.
4353

44-
If you're using a customized image in Compute Gallery, ensure to also assign standby pool Resource Provider the **Compute Gallery Sharing Admin** permissions.
54+
If you're using images stored in Compute Gallery when deploying your scale set, also repeat the above steps for the **Compute Gallery Sharing Admin** role.
4555

4656
For more information on assigning roles, see [assign Azure roles using the Azure portal](../role-based-access-control/quickstart-assign-role-user-portal.md).
4757

@@ -88,61 +98,68 @@ New-AzStandbyVMPool `
8898
```
8999

90100
### [ARM template](#tab/template)
101+
Create a standby pool and associate it with an existing scale set. Create a template and deploy it using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
91102

92-
```ARM
103+
104+
```json
93105
{
94-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
95-
"contentVersion": "1.0.0.0",
96-
"parameters": {},
97-
"resources": [
98-
{
99-
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
100-
"apiVersion": "2023-12-01-preview",
101-
"name": "{StandbyPoolName}",
102-
"location": "{Location}",
103-
"properties": {
104-
"maxReadyCapacity": 20,
105-
"virtualMachineState": "Deallocated",
106-
"attachedVirtualMachineScaleSetId": ["/subscriptions/{SubscriptionID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Compute/virtualMachineScaleSets/{ScaleSetName}"]
107-
}
108-
}
109-
]
110-
}
106+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
107+
"contentVersion": "1.0.0.0",
108+
"parameters": {
109+
"location": {
110+
"type": "string",
111+
"defaultValue": "east us"
112+
},
113+
"name": {
114+
"type": "string",
115+
"defaultValue": "myStandbyPool"
116+
},
117+
"maxReadyCapacity" : {
118+
"type": "int",
119+
"defaultValue": 10
120+
},
121+
"virtualMachineState" : {
122+
"type": "string",
123+
"defaultValue": "Deallocated"
124+
},
125+
"attachedVirtualMachineScaleSetId" : {
126+
"type": "string",
127+
"defaultValue": "/subscriptions/{subscriptionID}/resourceGroups/StandbyPools/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
128+
}
129+
},
130+
"resources": [
131+
{
132+
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
133+
"apiVersion": "2023-12-01-preview",
134+
"name": "[parameters('name')]",
135+
"location": "[parameters('location')]",
136+
"properties": {
137+
"elasticityProfile": {
138+
"maxReadyCapacity": "[parameters('maxReadyCapacity')]"
139+
},
140+
"virtualMachineState": "[parameters('virtualMachineState')]",
141+
"attachedVirtualMachineScaleSetId": "[parameters('attachedVirtualMachineScaleSetId')]"
142+
}
143+
}
144+
]
145+
}
111146

112147
```
113148

114-
### [REST](#tab/rest)
115-
Create a standby pool and associate it with an existing scale set using [Create or Update](/rest/api/standbypool/standby-virtual-machine-pools/create-or-update)
116-
117-
```HTTP
118-
PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyPoolName}?api-version=2023-12-01-preview
119-
{
120-
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
121-
"name": "{standbyPoolName}",
122-
"location": "{location}",
123-
"properties": {
124-
"elasticityProfile": {
125-
"maxReadyCapacity": 20
126-
},
127-
"virtualMachineState":"Deallocated",
128-
"attachedVirtualMachineScaleSetId": "/subscriptions/{subscriptionID}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{scaleSetName}"
129-
}
130-
}
131-
```
132149

133150
### [Bicep](#tab/bicep)
134151
Create a standby pool and associate it with an existing scale set. Deploy the template using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
135152

136153
```bicep
137154
param location string = resourceGroup().location
138-
param standbyPoolName string = '{standbyPoolName}'
139-
param maxReadyCapacity int = {maxReadyCapacityCount}
155+
param standbyPoolName string = 'myStandbyPool'
156+
param maxReadyCapacity int = 20
140157
@allowed([
141158
'Running'
142159
'Deallocated'
143160
])
144-
param vmState string = '{vmState}'
145-
param virtualMachineScaleSetId string = '{vmssId}'
161+
param vmState string = 'Deallocated'
162+
param virtualMachineScaleSetId string = '/subscriptions/{subscriptionID}/resourceGroups/StandbyPools/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet}'
146163
147164
resource standbyPool 'Microsoft.standbypool/standbyvirtualmachinepools@2023-12-01-preview' = {
148165
name: standbyPoolName
@@ -157,6 +174,24 @@ resource standbyPool 'Microsoft.standbypool/standbyvirtualmachinepools@2023-12-0
157174
}
158175
```
159176

177+
### [REST](#tab/rest)
178+
Create a standby pool and associate it with an existing scale set using [Create or Update](/rest/api/standbypool/standby-virtual-machine-pools/create-or-update)
179+
180+
```HTTP
181+
PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/myStandbyPool?api-version=2023-12-01-preview
182+
{
183+
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
184+
"name": "myStandbyPool",
185+
"location": "east us",
186+
"properties": {
187+
"elasticityProfile": {
188+
"maxReadyCapacity": 20
189+
},
190+
"virtualMachineState":"Deallocated",
191+
"attachedVirtualMachineScaleSetId": "/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
192+
}
193+
}
194+
```
160195

161196
---
162197

articles/virtual-machine-scale-sets/standby-pools-overview.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ When your scale set requires more instances, rather than creating new instances
4141

4242
When your scale set scales back down, the instances are deleted from your scale set based on the [scale-in policy](virtual-machine-scale-sets-scale-in-policy.md) and your standby pool will refill to meet the max ready capacity configured. If at any point in time your scale set needs to scale beyond the number of instances you have in your standby pool, the scale set defaults to standard scale-out methods and creates new instances directly in the Scale Set
4343

44-
Standby pools will only give out virtual machines from the pool that match the desired power state configured. For example, if your desired power state is set as deallocated, the standby pool will only give the Virtual Machine Scale Set instances matching that current power state. If virtual machines are in a creating, failed or any other state than the expected state, the scale set defaults to new virtual machine creation instead
44+
Standby pools will only give out virtual machines from the pool that match the desired power state configured. For example, if your desired power state is set as deallocated, the standby pool will only give the Virtual Machine Scale Set instances matching that current power state. If virtual machines are in a creating, failed or any other state than the expected state, the scale set defaults to new virtual machine creation instead.
45+
46+
When using a standby pool with a Virtual Machine Scale Set spread across multiple availability zones, the instances in the pool will also be spread across zones. When a scale out is triggered in one of the zones, a virtual machine in the pool in that same zone will be used. If a virtual machine is needed in a zone where you no longer have any pooled virtual machines left, the scale set will create a new virtual machine directly in the scale set.
4547

4648
## Virtual machine states
4749

@@ -70,7 +72,7 @@ There's no direct cost associated with using standby pools. Users are charged ba
7072
- Creating or attaching a standby pool to a Virtual Machine Scale Set with a fault domain greater than 1.
7173
- Creating or attaching a standby pool to a Virtual Machine Scale Set in a different region.
7274
- Creating or attaching a standby pool to a Virtual Machine Scale Set in a different subscription.
73-
- Creating or attaching a standby pool to a Virtual Machine Scale Set that already has a standby pool attached.
75+
- Creating or attaching a standby pool to a Virtual Machine Scale Set that already has a standby pool.
7476
- Creating or attaching a standby pool to a Virtual Machine Scale Set using Uniform Orchestration.
7577

7678
## Next steps

articles/virtual-machine-scale-sets/standby-pools-update-delete.md

Lines changed: 69 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,38 +51,69 @@ Update-AzStandbyVMPool `
5151
-VMState "Deallocated" `
5252
```
5353

54-
### [REST](#tab/rest-2)
55-
Update an existing standby pool using [Create or Update](/rest/api/standbypool/standby-virtual-machine-pools/create-or-update).
54+
### [ARM template](#tab/template)
55+
Update an existing standby pool deployment. Deploy the updated template using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
5656

57-
```HTTP
58-
PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyPoolName}?api-version=2023-12-01-preview
57+
58+
```JSON
5959
{
60-
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
61-
"name": "{standbyPoolName}",
62-
"location": "{location}",
63-
"properties": {
64-
"elasticityProfile": {
65-
"maxReadyCapacity": 20
66-
},
67-
"virtualMachineState":"Deallocated",
68-
"attachedVirtualMachineScaleSetId": "/subscriptions/{subscriptionID}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{scaleSetName}"
69-
}
70-
}
60+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
61+
"contentVersion": "1.0.0.0",
62+
"parameters": {
63+
"location": {
64+
"type": "string",
65+
"defaultValue": "east us"
66+
},
67+
"name": {
68+
"type": "string",
69+
"defaultValue": "myStandbyPool"
70+
},
71+
"maxReadyCapacity" : {
72+
"type": "int",
73+
"defaultValue": 10
74+
},
75+
"virtualMachineState" : {
76+
"type": "string",
77+
"defaultValue": "Deallocated"
78+
},
79+
"attachedVirtualMachineScaleSetId" : {
80+
"type": "string",
81+
"defaultValue": "/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
82+
}
83+
},
84+
"resources": [
85+
{
86+
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
87+
"apiVersion": "2023-12-01-preview",
88+
"name": "[parameters('name')]",
89+
"location": "[parameters('location')]",
90+
"properties": {
91+
"elasticityProfile": {
92+
"maxReadyCapacity": "[parameters('maxReadyCapacity')]"
93+
},
94+
"virtualMachineState": "[parameters('virtualMachineState')]",
95+
"attachedVirtualMachineScaleSetId": "[parameters('attachedVirtualMachineScaleSetId')]"
96+
}
97+
}
98+
]
99+
}
100+
71101
```
72102

103+
73104
### [Bicep](#tab/bicep-2)
74105
Update an existing standby pool deployment. Deploy the updated template using [az deployment group create](/cli/azure/deployment/group) or [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment).
75106

76107
```bicep
77108
param location string = resourceGroup().location
78-
param standbyPoolName string = '{standbyPoolName}'
79-
param maxReadyCapacity int = {maxReadyCapacityCount}
109+
param standbyPoolName string = 'myStandbyPool'
110+
param maxReadyCapacity int = 10
80111
@allowed([
81112
'Running'
82113
'Deallocated'
83114
])
84-
param vmState string = '{vmState}'
85-
param virtualMachineScaleSetId string = '{vmssId}'
115+
param vmState string = 'Deallocated'
116+
param virtualMachineScaleSetId string = '/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet'
86117
87118
resource standbyPool 'Microsoft.standbypool/standbyvirtualmachinepools@2023-12-01-preview' = {
88119
name: standbyPoolName
@@ -97,6 +128,24 @@ resource standbyPool 'Microsoft.standbypool/standbyvirtualmachinepools@2023-12-0
97128
}
98129
```
99130

131+
### [REST](#tab/rest-2)
132+
Update an existing standby pool using [Create or Update](/rest/api/standbypool/standby-virtual-machine-pools/create-or-update).
133+
134+
```HTTP
135+
PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/myStandbyPool?api-version=2023-12-01-preview
136+
{
137+
"type": "Microsoft.StandbyPool/standbyVirtualMachinePools",
138+
"name": "myStandbyPool",
139+
"location": "east us",
140+
"properties": {
141+
"elasticityProfile": {
142+
"maxReadyCapacity": 20
143+
},
144+
"virtualMachineState":"Deallocated",
145+
"attachedVirtualMachineScaleSetId": "/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myScaleSet"
146+
}
147+
}
148+
```
100149

101150
---
102151

@@ -130,7 +179,7 @@ Remove-AzStandbyVMPool -ResourceGroup myResourceGroup -Name myStandbyPool -Nowai
130179
Delete an existing standby pool using [Delete](/rest/api/standbypool/standby-virtual-machine-pools/delete).
131180

132181
```HTTP
133-
DELETE https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/{standbyPoolName}?api-version=2023-12-01-preview
182+
DELETE https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/myResourceGroup/providers/Microsoft.StandbyPool/standbyVirtualMachinePools/myStandbyPool?api-version=2023-12-01-preview
134183
```
135184

136185
---

0 commit comments

Comments
 (0)