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?
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.
D is correct. If you pay attention to the question, option C mentions n1-standard-8. That instance type has 8vCPUs and 30 GB RAM, and we only need 8GB. On top of that, it is possible to use custom machine type to adjust current VM RAM to the value we need. Got the answer from this course I did to prepare the exam: https://www.udemy.com/course/google-cloud-associate-engineer-exam-practice-tests/?couponCode=21CDE6A4C2B95F79BD97
good luck!
In Google Cloud, you cannot directly modify the memory allocation for an existing VM. Instead, you must change the VM's machine type to one with the desired memory and vCPU configuration (e.g., n1-standard-8, which has 8 GB of memory). The VM needs to be stopped before making this change, and then it can be restarted.
Why not other options?
A (Live migration): Live migration moves workloads during maintenance but does not change the VM's memory allocation.
B (Metadata change): Adding metadata does not affect memory allocation.
D (Directly increasing memory): You cannot manually increase only the memory of a VM; you must select a predefined machine type.
ANSWER D is correct because it is the correct process to follow to increase the memory of a virtual machine in the Google Cloud Platform.
To increase the memory of a virtual machine, you need to first stop the VM, since it is not possible to modify the memory of a running VM. Then, you can increase the memory of the VM by editing the machine type and selecting a machine type with more memory. Once you have made the change, you can start the VM again.
ANSWER A is not the best approach as it relies on live migration which can be a risky operation.
ANSWER B is incorrect because adding metadata to the VM will not change the amount of memory allocated to the VM.
ANSWER C is incorrect because changing the machine type to n1-standard-8 would also increase the number of vCPUs to 8, which may not be necessary and could result in overprovisioning of resources. In addition, changing the machine type would also affect the cost of the VM instance, which may not be desired. Since the primary concern in this scenario is to increase memory.
The reason A is not correct is because live migration simply moves an existing VM between hosts, no attributes or properties are changed otherwise. Hence, you cannot live migrate from 1 VM type to another.
https://cloud.google.com/compute/docs/instances/live-migration
To be exact... There is no "n1" option that has 2vCPU and 4GB. The closest would be n1-standard-2 with 2vCPU and 7.50GB RAM. This machine is already custom. So, option D.
We do not have the option to increase memory in GCP VM directly. Instead, machine type needs to be changed. However, given the choices, D is the best answer here.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
cesar7816
Highly Voted 4 years, 10 months agoiambatmanadarkknight
3 years, 3 months agospatidar2711
2 years, 6 months agochikorita
1 year, 9 months agoCarlS
Highly Voted 4 years, 10 months agoVeera_Venkata_Satyanarayana
2 years, 7 months agowarbon
Most Recent 1 week, 6 days agomartin2099
3 months agoCaptain1212
1 year, 5 months agogpais
1 year, 5 months agosamrat46
1 year, 10 months agoBuruguduystunstugudunstuy
1 year, 11 months agocslince
2 years, 2 months agoleogor
2 years, 3 months agosanthu1039
2 years, 6 months agoharoldbenites
2 years, 8 months agoChiefArch
2 years, 10 months agomchaconr
3 years, 1 month agovishnukumartr
3 years, 2 months agoJaira1256
3 years, 2 months agoGpjha
3 years, 6 months ago