nerdexam
MicrosoftMicrosoft

AZ-801 · Question #154

AZ-801 Question #154: Real Exam Question with Answer & Explanation

This question tests knowledge of the Azure PowerShell workflow for repairing a non-bootable Windows Server VM by temporarily reattaching its OS disk to a recovery VM, fixing the disk, then restoring it as the OS disk on the original VM.

Monitor and troubleshoot Windows Server environments

Question

QUESTION 158: Drag and Drop Question You have an Azure virtual machine named VM1 that runs Windows Server. The operating system on VM1 fails to start due to a disk error. You need to resolve the error. Which four commands should you run in sequence in Azure Cloud Shell? To answer, move the appropriate commands from the list of commands to the answer area and arrange them in the correct order. Available Commands: - Remove-AzVMDataDisk - Get-AzDisk - Add-AzVMDataDisk - New-AzDisk - Remove-AzVMDisk - Set-AzVMOSDisk - Update-AzVM

Explanation

This question tests knowledge of the Azure PowerShell workflow for repairing a non-bootable Windows Server VM by temporarily reattaching its OS disk to a recovery VM, fixing the disk, then restoring it as the OS disk on the original VM.

Approach. The correct four-command sequence is: (1) Get-AzDisk - retrieves the resource object and ID of VM1's faulty OS disk; (2) Add-AzVMDataDisk - attaches that OS disk as a data disk to a separate recovery VM, where tools like chkdsk or bootrec can be run against it over RDP; (3) Remove-AzVMDataDisk - detaches the now-repaired disk from the recovery VM once the fix is applied; (4) Set-AzVMOSDisk - reassigns the repaired disk as the OS disk on VM1 so it can boot normally. In practice Update-AzVM is also needed to persist the configuration changes, but the four commands above represent the core logical steps the exam tests.

Concept tested. Azure VM OS disk repair workflow using PowerShell - specifically the pattern of detaching a corrupted OS disk, mounting it as a data disk on a recovery VM, remediating it, and reattaching it as the OS disk. Distractors include New-AzDisk (used for creating disks from snapshots, not direct repair), Remove-AzVMDisk (not a real Azure PowerShell cmdlet - a red-herring distractor), and Remove-AzVMDataDisk (correct but only in step 3, not first).

Reference. Microsoft Learn - Troubleshoot a Windows VM by attaching the OS disk to a recovery VM using Azure PowerShell: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/troubleshoot-recovery-disks-windows

Topics

#Azure Virtual Machines#OS Disk management#Troubleshooting#Azure PowerShell

Community Discussion

No community discussion yet for this question.

Full AZ-801 PracticeBrowse All AZ-801 Questions