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?
Click on the arrows to vote for the correct answer
A. B. C. D.D.
The correct answer is option C: Stop the VM, change the machine type to n1-standard-8, and start the VM.
Explanation:
When a virtual machine is running out of memory, the first step is to increase the amount of memory available to the virtual machine. In Google Cloud, virtual machines are created with a specific machine type that specifies the number of virtual CPUs, the amount of memory, and other attributes.
To increase the memory of a virtual machine from 4 GB to 8 GB, we need to change the machine type to a higher configuration that supports 8 GB memory.
Option A is incorrect because live migration is used to move workloads from one virtual machine to another without downtime, but it does not address the issue of increasing the amount of memory available to the virtual machine.
Option B is also incorrect because adding metadata to a virtual machine does not change its hardware configuration.
Option D is partially correct because it suggests increasing the memory of the virtual machine, but it does not mention how to do it. Increasing the memory while the virtual machine is running can cause data loss or corruption, so the virtual machine needs to be stopped before the memory is increased.
Therefore, the correct option is C: Stop the VM, change the machine type to n1-standard-8, and start the VM. This option will change the machine type to one that supports 8 GB memory and will allocate the additional memory to the virtual machine. After the virtual machine is started with the new configuration, it will have 8 GB of memory available to it.