Skip to content

Commit 68fb77c

Browse files
authored
Merge pull request #102981 from v-davit/patch-2
Updated file with responses
2 parents 7a83929 + af18e57 commit 68fb77c

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

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

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ With maintenance control, you can:
2828
> Maintenance Control is currently in public preview.
2929
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
3030
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
31-
>
31+
>
3232
3333
## Limitations
3434

3535
- VMs must be on a [dedicated host](./linux/dedicated-hosts.md), or be created using an [isolated VM size](./linux/isolation.md).
3636
- After 35 days, an update will automatically be applied.
37-
- User must have **Resource Owner** access.
37+
- User must have **Resource Contributor** access.
3838

3939

4040
## Install the maintenance extension
@@ -148,6 +148,23 @@ az maintenance assignment list \
148148

149149
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.
150150

151+
If there are no updates, the command will return an error message, which will contain the text: `Resource not found...StatusCode: 404`.
152+
153+
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:
154+
155+
```text
156+
[
157+
{
158+
"impactDurationInSec": 9,
159+
"impactType": "Freeze",
160+
"maintenanceScope": "Host",
161+
"notBefore": "2020-03-03T07:23:04.905538+00:00",
162+
"resourceId": "/subscriptions/9120c5ff-e78e-4bd0-b29f-75c19cadd078/resourcegroups/DemoRG/providers/Microsoft.Compute/hostGroups/demoHostGroup/hosts/myHost",
163+
"status": "Pending"
164+
}
165+
]
166+
```
167+
151168
### Isolated VM
152169

153170
Check for pending updates for an isolated VM. In this example, the output is formatted as a table for readability.
@@ -163,7 +180,7 @@ az maintenance update list \
163180

164181
### Dedicated host
165182

166-
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.
183+
To check for pending updates for a dedicated host (ADH). In this example, the output is formatted as a table for readability. Replace the values for the resources with your own.
167184

168185
```azurecli-interactive
169186
az maintenance update list \
@@ -179,7 +196,7 @@ az maintenance update list \
179196

180197
## Apply updates
181198

182-
Use `az maintenance apply update` to apply pending updates.
199+
Use `az maintenance apply update` to apply pending updates. On success, this command will return JSON containing the details of the update.
183200

184201
### Isolated VM
185202

@@ -188,7 +205,7 @@ Create a request to apply updates to an isolated VM.
188205
```azurecli-interactive
189206
az maintenance applyupdate create \
190207
--subscription 1111abcd-1a11-1a2b-1a12-123456789abc \
191-
-g myMaintenanceRG\
208+
--resource-group myMaintenanceRG \
192209
--resource-name myVM \
193210
--resource-type virtualMachines \
194211
--provider-name Microsoft.Compute
@@ -202,7 +219,7 @@ Apply updates to a dedicated host.
202219
```azurecli-interactive
203220
az maintenance applyupdate create \
204221
--subscription 1111abcd-1a11-1a2b-1a12-123456789abc \
205-
-g myHostResourceGroup \
222+
--resource-group myHostResourceGroup \
206223
--resource-name myHost \
207224
--resource-type hosts \
208225
--provider-name Microsoft.Compute \
@@ -214,17 +231,17 @@ az maintenance applyupdate create \
214231

215232
You can check on the progress of the updates using `az maintenance applyupdate get`.
216233

217-
### Isolated VM
234+
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`.
218235

219-
Replace `myUpdateName` with the name of the update that was returned when you ran `az maintenance applyupdate create`.
236+
### Isolated VM
220237

221238
```azurecli-interactive
222239
az maintenance applyupdate get \
223240
--resource-group myMaintenanceRG \
224241
--resource-name myVM \
225242
--resource-type virtualMachines \
226243
--provider-name Microsoft.Compute \
227-
--apply-update-name myUpdateName
244+
--apply-update-name default
228245
```
229246

230247
### Dedicated host
@@ -238,7 +255,7 @@ az maintenance applyupdate get \
238255
--provider-name Microsoft.Compute \
239256
--resource-parent-name myHostGroup \
240257
--resource-parent-type hostGroups \
241-
--apply-update-name default \
258+
--apply-update-name myUpdateName \
242259
--query "{LastUpdate:lastUpdateTime, Name:name, ResourceGroup:resourceGroup, Status:status}" \
243260
--output table
244261
```

0 commit comments

Comments
 (0)