A Cloud Engineer needs to restore a corrupted boot disk on a Compute Engine virtual machine instance named `app-server-1` using an existing disk snapshot named `app-boot-snapshot-v2`. In what sequence should the engineer execute the `gcloud` operations to replace the boot disk and restore the server?
- 1Stop the instance using `gcloud compute instances stop app-server-1`.
- 2Create a new persistent disk from the snapshot using `gcloud compute disks create restored-disk --source-snapshot=app-boot-snapshot-v2`.
- 3Detach the corrupted boot disk using `gcloud compute instances detach-disk app-server-1 --disk=corrupted-disk`.
- 4Attach the restored disk as the new boot disk using `gcloud compute instances attach-disk app-server-1 --disk=restored-disk --boot`.
- 5Start the instance using `gcloud compute instances start app-server-1`.
Cevap
The correct operational sequence to restore the VM boot disk from a snapshot is: 1) Stop the `app-server-1` VM instance; 2) Create a new persistent disk from the snapshot; 3) Detach the corrupted boot disk; 4) Attach the new persistent disk with the `--boot` flag; 5) Start the VM instance.
To replace a boot disk on a Compute Engine instance using a snapshot, the engineer must follow a strict order: first, stop the instance because root disks cannot be detached while active; second, restore the snapshot to a new persistent disk; third, detach the broken boot disk; fourth, attach the newly restored disk using the `--boot` flag to declare it as the OS boot drive; and finally, start the VM instance.
Adım Adım Çözüm
Anahtar Kavram
Compute Engine VM Boot Disk Replacement & Snapshot Recovery