You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Applies to:**:heavy_check_mark: Linux VMs :heavy_check_mark: Windows VMs :heavy_check_mark: Flexible scale sets :heavy_check_mark: Uniform scale sets
17
17
18
-
Maintenance Configurations lets you decide when to apply platform updates to various Azure resources. This topic covers the Azure CLI options for Dedicated Hosts and Isolated VMs. 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
+
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).
19
19
20
20
> [!IMPORTANT]
21
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.
22
22
23
23
## Create a maintenance configuration
24
24
25
-
Use `az maintenance configuration create` to create a maintenance configuration. This example creates a maintenance configuration named *myConfig* scoped to the host.
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.
26
26
27
27
```azurecli-interactive
28
28
az group create \
29
29
--location eastus \
30
30
--name myMaintenanceRG
31
-
az maintenance configuration create \
32
-
-g myMaintenanceRG \
33
-
--resource-name myConfig \
34
-
--maintenance-scope host\
35
-
--location eastus
36
31
```
37
32
38
-
Copy the configuration ID from the output to use later.
33
+
After creating the resource group, use `az maintenance configuration create` to create a maintenance configuration.
34
+
35
+
### Host
39
36
40
-
Using `--maintenance-scope host` ensures that the maintenance configuration is used for controlling updates to the host infrastructure.
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.
41
38
42
-
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.
--maintenance-window-time-zone "Pacific Standard Time"
49
+
```
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.
43
52
44
-
You can query for available maintenance configurations using `az maintenance configuration list`.
53
+
You can check if you have created the maintenance configuration successfully by querying for available maintenance configurations using `az maintenance configuration list`.
45
54
46
55
```azurecli-interactive
47
-
az maintenance configuration list --query "[].{Name:name, ID:id}" -o table
56
+
az maintenance configuration list
57
+
--query "[].{Name:name, ID:id}"
58
+
--output table
48
59
```
49
60
50
-
### Create a maintenance configuration with scheduled window
51
-
You can also declare a scheduled window when Azure will apply the updates on your resources. This example creates a maintenance configuration named myConfig with a scheduled window of 5 hours on the fourth Monday of every month. Once you create a scheduled window you no longer have to apply the updates manually.
61
+
> [!NOTE]
62
+
> Maintenance recurrence can be expressed as daily, weekly or monthly. Some examples are:
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.
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.
Use `az maintenance assignment create` to assign the configuration to your machine.
78
106
79
107
### Isolated VM
80
108
81
-
Apply the configuration to a 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 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`.
82
110
83
111
```azurecli-interactive
84
112
az maintenance assignment create \
@@ -88,7 +116,7 @@ az maintenance assignment create \
You can verify that the configuration was applied correctly, or check to see what configuration is currently applied using `az maintenance assignment list`.
@@ -137,9 +191,32 @@ az maintenance assignment list \
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 upto 2 hours to complete.
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.
197
275
198
276
### Isolated VM
199
277
200
278
Create a request to apply updates to an isolated VM.
Copy file name to clipboardExpand all lines: articles/virtual-machines/maintenance-configurations-powershell.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ You may also be asked to confirm that you want to install from an *untrusted rep
55
55
56
56
## Create a maintenance configuration
57
57
58
-
Create 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.
58
+
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.
59
59
60
60
```azurepowershell-interactive
61
61
New-AzResourceGroup `
@@ -188,7 +188,7 @@ After you have created your configuration, you might want to also assign machine
188
188
189
189
### Isolated VM
190
190
191
-
Apply the configuration to a VM using the ID of the configuration. Specify `-ResourceType VirtualMachines` and supply the name of the VM for `-ResourceName`, and the resource group of the VM for `-ResourceGroupName`.
191
+
Assign the configuration to a VM using the ID of the configuration. Specify `-ResourceType VirtualMachines` and supply the name of the VM for `-ResourceName`, and the resource group of the VM for `-ResourceGroupName`.
Use [Get-AzMaintenanceUpdate](/powershell/module/az.maintenance/get-azmaintenanceupdate) to see if there are pending updates. Use `-subscription` to specify the Azure subscription of the VM if it is different from the one that you are logged into.
Copy file name to clipboardExpand all lines: articles/virtual-machines/maintenance-configurations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ ms.author: cynthn
18
18
Maintenance Configurations gives you the ability to control and manage updates for many Azure virtual machine resources since Azure frequently updates its infrastructure to improve reliability, performance, security or launch new features. Most updates are transparent to users, but some sensitive workloads, like gaming, media streaming, and financial transactions, can't tolerate even few seconds of a VM freezing or disconnecting for maintenance. Maintenance Configurations is integrated with Azure Resource Graph (ARG) for low latency and high scale customer experience.
19
19
20
20
>[!IMPORTANT]
21
-
> Users are required to have a role of at least contributor in order to use maintenance configurations.
21
+
> Users are required to have a role of at least contributor in order to use maintenance configurations. Users also have to ensure that their subscription is registered with Maintenance Resource Provider to use maintenance configurations.
0 commit comments