Google Cloud Associate Cloud Engineer — Question 14
You have a virtual machine that is currently configured with 2 vCPUs and 4 GB of memory. It is running out of memory. You want to upgrade the virtual machine to have 8 GB of memory. What should you do?
Answer options
- A. Rely on live migration to move the workload to a machine with more memory.
- B. Use gcloud to add metadata to the VM. Set the key to required-memory-size and the value to 8 GB.
- C. Stop the VM, change the machine type to n1-standard-8, and start the VM.
- D. Stop the VM, increase the memory to 8 GB, and start the VM.
Correct answer: D
Explanation
The correct answer is D because it directly addresses the need to increase the memory of the VM by stopping it, adjusting the memory allocation, and then starting it again. Option A is incorrect as live migration does not resolve memory limitations. Option B is not valid since adding metadata does not increase the VM's memory. Option C changes the machine type but does not specifically increase the memory to the desired amount.