Soru

Zorluk: OrtaManaging Compute Engine Resources

An engineer needs to resize a standalone Compute Engine virtual machine instance named `db-primary` to a larger machine type (`e2-standard-8`) to handle increased workload demand. The instance is currently in the RUNNING state and has a persistent disk attached. Which process must be used to successfully modify the machine type of this VM instance?

  1. Stop the VM instance, execute `gcloud compute instances set-machine-type db-primary --machine-type=e2-standard-8`, and start the VM instance.Cevap
  2. B
    Execute `gcloud compute instances set-machine-type db-primary --machine-type=e2-standard-8` directly while the VM is in the RUNNING state to update vCPU and memory without downtime.
  3. C
    Change the VM provisioning model to a Spot VM so that Google Cloud automatically scales up vCPU and RAM resources during high workload demand.
  4. D
    Submit a Compute Engine resource quota increase request to allow live modification of running VM machine types.

Cevap

The correct action is to stop the VM instance, change the machine type using `gcloud compute instances set-machine-type`, and then start the VM instance.
To modify the machine type (vCPU and RAM) of an unmanaged or standalone Compute Engine VM instance, the instance must first be stopped. Once in the TERMINATED state, running `gcloud compute instances set-machine-type` reconfigures the VM attributes. Restarting the instance brings it back online with the requested compute resources.

Adım Adım Çözüm

1
Stop the running Virtual Machine
The instance transitions from RUNNING to TERMINATED status.
Compute Engine standalone VM hardware configurations (vCPU/RAM) cannot be altered while the hypervisor is actively executing the host OS.
2
Update the machine type configuration
Execute `gcloud compute instances set-machine-type db-primary --machine-type=e2-standard-8`.
This updates the VM metadata and resource allocation specifications while the instance is stopped.
3
Start the Virtual Machine
The instance boots up with 8 vCPUs and the updated memory profile.
Starting the VM boots the OS on host infrastructure allocated according to the new machine type settings.

Anahtar Kavram

Modifying Compute Engine Instance Machine Types
Tahmini Süre:1m 30s
Bu soruyu puanla