Soru

Zorluk: OrtaManaging Compute Engine Resources

An Associate Cloud Engineer needs to restore a corrupted secondary data disk attached to a standalone Compute Engine virtual machine named `prod-app-vm`. The engineer has an existing disk snapshot named `data-disk-snap-2026`. What is the correct sequence of steps to safely replace the corrupted disk with a restored disk from the snapshot?

  1. 1Detach the corrupted persistent disk from `prod-app-vm` using `gcloud compute instances detach-disk`.
  2. 2Create a new persistent disk named `data-disk-restored` from the snapshot using `gcloud compute disks create --source-snapshot=data-disk-snap-2026`.
  3. 3Attach the new persistent disk `data-disk-restored` to `prod-app-vm` using `gcloud compute instances attach-disk`.
  4. 4Connect to `prod-app-vm` via SSH to mount the restored persistent disk to the application file system directory.

Cevap

The correct operational sequence is: 1) Detach the corrupted persistent disk from the VM, 2) Create a new persistent disk from the specified snapshot, 3) Attach the newly created disk to the VM, and 4) Connect via SSH to mount the new disk inside the guest operating system.
Restoring data from a Compute Engine persistent disk snapshot requires first detaching the broken disk, creating a new persistent disk from the snapshot using the `--source-snapshot` flag, attaching that new persistent disk to the VM instance, and finally mounting the disk partition inside the guest OS via SSH.

Adım Adım Çözüm

1
Detach the corrupted persistent disk from `prod-app-vm`
The corrupted disk is safely disconnected from the running virtual machine instance.
Detaching the damaged disk prevents resource conflicts and ensures the device location is cleared for replacement.
2
Provision a new disk using the snapshot source flag
A new GCP persistent disk is created containing the point-in-time snapshot data.
Disk snapshots cannot be attached directly to instances; they must first be restored into a persistent disk resource.
3
Attach the restored persistent disk to `prod-app-vm`
The virtual machine gains access to the restored block storage device.
The compute instance must have the new persistent disk attached at the infrastructure level.
4
SSH into `prod-app-vm` and mount the filesystem device
The file system on the restored disk becomes readable and writable by applications.
GCP infrastructure attachment makes the disk available as a device, but operating system mounting is required for application file access.

Anahtar Kavram

Compute Engine Persistent Disk Snapshot Restoration
Bu soruyu puanla