Skip to content

Commit 6c2aa24

Browse files
authored
Merge pull request #272979 from ShawnJackson/maintenance-configurations
[AQ] edit pass: Five articles about the Maintenance Configurations feature
2 parents b02113a + 11b43c6 commit 6c2aa24

5 files changed

+304
-259
lines changed

articles/virtual-machines/maintenance-configurations-cli.md

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Maintenance Configurations for Azure virtual machines using CLI
3-
description: Learn how to control when maintenance is applied to your Azure VMs using Maintenance configurations and CLI.
2+
title: Maintenance Configurations for Azure virtual machines using the Azure CLI
3+
description: Learn how to control when maintenance is applied to your Azure VMs by using Maintenance Configurations and the Azure CLI.
44
author: ju-shim
55
ms.service: virtual-machines
66
ms.subservice: maintenance
@@ -15,26 +15,26 @@ ms.author: jushiman
1515

1616
**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Windows VMs :heavy_check_mark: Flexible scale sets :heavy_check_mark: Uniform scale sets
1717

18-
Maintenance Configurations lets you decide when to apply platform updates to various Azure resources. This topic covers the Azure CLI options for using this service. For more about benefits of using Maintenance Configurations, its limitations, and other management options, see [Managing platform updates with Maintenance Configurations](maintenance-configurations.md).
18+
You can use the Maintenance Configurations feature to control when to apply platform updates to various Azure resources. This article covers the Azure CLI options for using this feature. For more information about the benefits of using Maintenance Configurations, its limitations, and other management options, see [Managing platform updates with Maintenance Configurations](maintenance-configurations.md).
1919

2020
> [!IMPORTANT]
21-
> There are different **scopes** which support certain machine types and schedules, so please ensure you are selecting the right scope for your virtual machine.
21+
> Specific *scopes* support certain machine types and schedules. Be sure to select the right scope for your virtual machine (VM).
2222
2323
## Create a maintenance configuration
2424

25-
The first step to creating a maintenance configuration is creating a resource group as a container for your configuration. In this example, a resource group named *myMaintenanceRG* is created in *eastus*. If you already have a resource group that you want to use, you can skip this part and replace the resource group name with your own in the rest of the examples.
25+
The first step in creating a maintenance configuration is creating a resource group as a container for your configuration. This example creates a resource group named *myMaintenanceRG* in *eastus*. If you already have a resource group that you want to use, you can skip this part and replace the resource group name with your own in the rest of the examples.
2626

2727
```azurecli-interactive
2828
az group create \
2929
--location eastus \
3030
--name myMaintenanceRG
3131
```
3232

33-
After creating the resource group, use `az maintenance configuration create` to create a maintenance configuration.
33+
After you create the resource group, use `az maintenance configuration create` to create a maintenance configuration.
3434

3535
### Host
3636

37-
This example creates a maintenance configuration named *myConfig* scoped to host machines with a scheduled window of 5 hours on the fourth Monday of every month.
37+
This example creates a maintenance configuration named *myConfig* scoped to host machines, with a scheduled window of 5 hours on the fourth Monday of every month:
3838

3939
```azurecli-interactive
4040
az maintenance configuration create \
@@ -47,26 +47,26 @@ az maintenance configuration create \
4747
--maintenance-window-start-date-time "2020-12-30 08:00" \
4848
--maintenance-window-time-zone "Pacific Standard Time"
4949
```
50-
51-
Using `--maintenance-scope host` ensures that the maintenance configuration is used for controlling updates to the host infrastructure. If you try to create a configuration with the same name, but in a different location, you will get an error. Configuration names must be unique to your resource group.
5250

53-
You can check if you have created the maintenance configuration successfully by querying for available maintenance configurations using `az maintenance configuration list`.
51+
Using `--maintenance-scope host` ensures that the maintenance configuration is used for controlling updates to the host infrastructure. If you try to create a configuration with the same name but in a different location, you'll get an error. Configuration names must be unique to your resource group.
52+
53+
To check if you successfully created the maintenance configuration, you can query for available maintenance configurations by using `az maintenance configuration list`:
5454

5555
```azurecli-interactive
5656
az maintenance configuration list
5757
--query "[].{Name:name, ID:id}"
5858
--output table
5959
```
6060

61-
> [!NOTE]
62-
> Maintenance recurrence can be expressed as daily, weekly or monthly. Some examples are:
63-
> - **daily**- maintenance-window-recur-every: "Day" **or** "3Days"
64-
> - **weekly**- maintenance-window-recur-every: "3Weeks" **or** "Week Saturday,Sunday"
65-
> - **monthly**- maintenance-window-recur-every: "Month day23,day24" **or** "Month Last Sunday" **or** "Month Fourth Monday"
61+
You can express maintenance recurrence as daily, weekly, or monthly. Here are some examples:
62+
63+
- **Daily**: A `maintenance-window-recur-every` value of `"Day"` or `"3Days"`.
64+
- **Weekly**: A `maintenance-window-recur-every` value of `"3Weeks"` or `"Week Saturday,Sunday"`.
65+
- **Monthly**: A `maintenance-window-recur-every` value of `"Month day23,day24"` or `"Month Last Sunday"` or `Month Fourth Monday`.
6666

67-
### Virtual Machine Scale Sets
67+
### Virtual machine scale sets
6868

69-
This example creates a maintenance configuration named *myConfig* with the osimage scope for virtual machine scale sets with a scheduled window of 5 hours on the fourth Monday of every month.
69+
This example creates a maintenance configuration named *myConfig* with the OS image scope for virtual machine scale sets, with a scheduled window of 5 hours on the fourth Monday of every month:
7070

7171
```azurecli-interactive
7272
az maintenance configuration create \
@@ -82,7 +82,7 @@ az maintenance configuration create \
8282

8383
### Guest VMs
8484

85-
This example creates a maintenance configuration named *myConfig* scoped to guest machines (VMs and Arc enabled servers) with a scheduled window of 2 hours every 20 days. To learn more about this maintenance configurations on guest VMs see [Guest](maintenance-configurations.md#guest).
85+
This example creates a maintenance configuration named *myConfig* scoped to guest machines (VMs and Azure Arc-enabled servers), with a scheduled window of 2 hours every 20 days. [Learn more about maintenance configurations on guest VMs](maintenance-configurations.md#guest).
8686

8787
```azurecli-interactive
8888
az maintenance configuration create \
@@ -106,7 +106,7 @@ Use `az maintenance assignment create` to assign the configuration to your machi
106106

107107
### Isolated VM
108108

109-
Apply the configuration to an isolated host VM using the ID of the configuration. Specify `--resource-type virtualMachines` and supply the name of the VM for `--resource-name`, and the resource group for to the VM in `--resource-group`, and the location of the VM for `--location`.
109+
Apply the configuration to an isolated host VM by using the ID of the configuration. Specify `--resource-type virtualMachines`. Supply the name of the VM for `--resource-name`, the VM's resource group for `--resource-group`, and the location of the VM for `--location`.
110110

111111
```azurecli-interactive
112112
az maintenance assignment create \
@@ -121,7 +121,7 @@ az maintenance assignment create \
121121

122122
### Dedicated host
123123

124-
To apply a configuration to a dedicated host, you need to include `--resource-type hosts`, `--resource-parent-name` with the name of the host group, and `--resource-parent-type hostGroups`.
124+
To apply a configuration to a dedicated host, you need to include `--resource-type hosts`, `--resource-parent-name` with the name of the host group, and `--resource-parent-type hostGroups`.
125125

126126
The parameter `--resource-id` is the ID of the host. You can use [az-vm-host-get-instance-view](/cli/azure/vm/host#az-vm-host-get-instance-view) to get the ID of your dedicated host.
127127

@@ -138,7 +138,7 @@ az maintenance assignment create \
138138
--resource-parent-type hostGroups
139139
```
140140

141-
### Virtual Machine Scale Sets
141+
### Virtual machine scale sets
142142

143143
```azurecli-interactive
144144
az maintenance assignment create \
@@ -164,9 +164,9 @@ az maintenance assignment create \
164164
--maintenance-configuration-id "/subscriptions/{subscription ID}/resourcegroups/myMaintenanceRG/providers/Microsoft.Maintenance/maintenanceConfigurations/myConfig"
165165
```
166166

167-
## Check configuration
167+
## Check the configuration
168168

169-
You can verify that the configuration was applied correctly, or check to see what configuration is currently applied using `az maintenance assignment list`.
169+
You can verify that the configuration was applied correctly, or check to see what configuration is currently applied, by using `az maintenance assignment list`.
170170

171171
### Isolated VM
172172

@@ -194,7 +194,7 @@ az maintenance assignment list \
194194
--output table
195195
```
196196

197-
### Virtual Machine Scale Sets
197+
### Virtual machine scale sets
198198

199199
```azurecli-interactive
200200
az maintenance assignment list \
@@ -220,11 +220,11 @@ az maintenance assignment list \
220220

221221
## Check for pending updates
222222

223-
Use `az maintenance update list` to see if there are pending updates. Update --subscription to be the ID for the subscription that contains the VM.
223+
Use `az maintenance update list` to see if there are pending updates. Update `--subscription` to be the ID for the subscription that contains the VM.
224224

225-
If there are no updates, the command will return an error message, which will contain the text: `Resource not found...StatusCode: 404`.
225+
If there are no updates, the command returns an error message that contains the text `Resource not found...StatusCode: 404`.
226226

227-
If there are updates, only one will be returned, even if there are multiple updates pending. The data for this update will be returned in an object:
227+
If there are updates, the command returns only one, even if multiple updates are pending. The data for this update is returned in an object:
228228

229229
```text
230230
[
@@ -241,7 +241,7 @@ If there are updates, only one will be returned, even if there are multiple upda
241241

242242
### Isolated VM
243243

244-
Check for pending updates for an isolated VM. In this example, the output is formatted as a table for readability.
244+
Check for pending updates for an isolated VM. In this example, the output is formatted as a table for readability:
245245

246246
```azurecli-interactive
247247
az maintenance update list \
@@ -255,7 +255,7 @@ az maintenance update list \
255255

256256
### Dedicated host
257257

258-
To check for pending updates for a dedicated host. In this example, the output is formatted as a table for readability. Replace the values for the resources with your own.
258+
Check for pending updates for a dedicated host. In this example, the output is formatted as a table for readability. Replace the values for the resources with your own.
259259

260260
```azurecli-interactive
261261
az maintenance update list \
@@ -271,11 +271,11 @@ az maintenance update list \
271271

272272
## Apply updates
273273

274-
Use `az maintenance apply update` to apply pending updates. On success, this command will return JSON containing the details of the update. Apply update calls can take up to 2 hours to complete.
274+
Use `az maintenance apply update` to apply pending updates. On success, this command returns JSON that contains the details of the update. Calls to apply updates can take up to 2 hours to complete.
275275

276276
### Isolated VM
277277

278-
Create a request to apply updates to an isolated VM.
278+
Create a request to apply updates to an isolated VM:
279279

280280
```azurecli-interactive
281281
az maintenance applyupdate create \
@@ -286,10 +286,9 @@ az maintenance applyupdate create \
286286
--provider-name Microsoft.Compute
287287
```
288288

289-
290289
### Dedicated host
291290

292-
Apply updates to a dedicated host.
291+
Apply updates to a dedicated host:
293292

294293
```azurecli-interactive
295294
az maintenance applyupdate create \
@@ -302,9 +301,9 @@ az maintenance applyupdate create \
302301
--resource-parent-type hostGroups
303302
```
304303

305-
### Virtual Machine Scale Sets
304+
### Virtual machine scale sets
306305

307-
Apply update to a scale set
306+
Apply updates to a scale set:
308307

309308
```azurecli-interactive
310309
az maintenance applyupdate create \
@@ -315,11 +314,11 @@ az maintenance applyupdate create \
315314
--provider-name Microsoft.Compute
316315
```
317316

318-
## Check the status of applying updates
317+
## Check the status of applying updates
319318

320-
You can check on the progress of the updates using `az maintenance applyupdate get`.
319+
You can check on the progress of the updates by using `az maintenance applyupdate get`.
321320

322-
You can use `default` as the update name to see results for the last update, or replace `myUpdateName` with the name of the update that was returned when you ran `az maintenance applyupdate create`.
321+
To see results for the last update, use `default` as the update name. Or replace `myUpdateName` with the name of the update that was returned when you ran `az maintenance applyupdate create`.
323322

324323
```text
325324
Status : Completed
@@ -331,7 +330,8 @@ ute/virtualMachines/DXT-test-04-iso/providers/Microsoft.Maintenance/applyUpdates
331330
Name : default
332331
Type : Microsoft.Maintenance/applyUpdates
333332
```
334-
LastUpdateTime will be the time when the update got complete, either initiated by you or by the platform in case self-maintenance window was not used. If there has never been an update applied through maintenance control it will show default value.
333+
334+
`LastUpdateTime` is the time when the update finished, whether you initiated the update or the platform initiated it because you didn't use the self-maintenance window. If an update was never applied through Maintenance Configurations, `LastUpdateTime` shows the default value.
335335

336336
### Isolated VM
337337

@@ -363,7 +363,7 @@ az maintenance applyupdate get \
363363
--output table
364364
```
365365

366-
### Virtual Machine Scale Sets
366+
### Virtual machine scale sets
367367

368368
```azurecli-interactive
369369
az maintenance applyupdate get \
@@ -379,7 +379,7 @@ az maintenance applyupdate get \
379379

380380
## Delete a maintenance configuration
381381

382-
Use `az maintenance configuration delete` to delete a maintenance configuration. Deleting the configuration removes the maintenance control from the associated resources.
382+
To delete a maintenance configuration, use `az maintenance configuration delete`. Deleting the configuration removes the maintenance control from the associated resources.
383383

384384
```azurecli-interactive
385385
az maintenance configuration delete \
@@ -389,4 +389,5 @@ az maintenance configuration delete \
389389
```
390390

391391
## Next steps
392-
To learn more, see [Maintenance and updates](maintenance-and-updates.md).
392+
393+
To learn more, see [Maintenance for virtual machines in Azure](maintenance-and-updates.md).

0 commit comments

Comments
 (0)