A system administrator needs to recover a Compute Engine VM instance whose primary boot disk has suffered operating system corruption. The administrator has access to a recent, uncorrupted disk snapshot. What is the correct sequence of steps to restore the instance to operational status using the gcloud CLI while preserving the VM instance identity and IP configurations?
- 1Stop the affected Compute Engine VM instance using gcloud compute instances stop.
- 2Create a new persistent disk from the snapshot using gcloud compute disks create with the --source-snapshot flag.
- 3Detach the corrupted boot disk from the VM instance using gcloud compute instances detach-disk.
- 4Attach the restored persistent disk to the VM instance using gcloud compute instances attach-disk with the --boot flag.
- 5Start the Compute Engine VM instance using gcloud compute instances start.
Answer
The correct operational sequence requires stopping the instance, creating a persistent disk from the snapshot, detaching the corrupted boot disk, attaching the newly created disk with the --boot flag, and finally starting the instance.
To successfully replace a corrupted boot disk on an existing Compute Engine VM instance, the instance must first be stopped to allow disk modification. Next, a persistent disk must be instantiated from the snapshot because snapshots cannot be mounted directly. The corrupted disk is then detached, the restored disk is attached with the --boot flag, and the instance is started.
Step-by-Step Solution
Key Concept
Compute Engine Boot Disk Recovery and Lifecycle Management