I need to add more CPU Core and RAM in Running VM Instance. Is there any way i can do that?
4 Answers
This is no longer the best way (as of 2016). Now the easiest way to do it is to stop the instance, then click on edit and change the machine type to what you want—you can even customize it. Once done, just hit start and it'll come back up with the new type you've selected.
There is no longer a need to clone it to grow it.

- 221
- 2
- 4
-
With a stopped instance it is now possible to use the command: [`gcloud compute instances set-machine-type`](http://stackoverflow.com/a/38950577/462302) – aculich Aug 15 '16 at 07:49
you can't dynamically change RAM and CPU values of compute Engine Instances, but you can create a snapshot of instance and create a larger instance from the snapshot.

- 876
- 5
- 8
-
4This answer is out of date, since it is now possible on a stopped instance to use the command: [`gcloud compute instances set-machine-type`](http://stackoverflow.com/a/38950577/462302) – aculich Aug 15 '16 at 07:50
You can stop the machine, then edit it, and then start it again. Just be sure the disk is not destroy in the process. Check this: https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance
It's fairly easy to scale up a machine from a snapshot read this first though: https://cloud.google.com/compute/docs/disks#snapshots
"Before you create a persistent disk snapshot, you should ensure that you are taking a snapshot that is consistent with the desired state of your persistent disk. If you take a snapshot of your persistent disk in an "unclean" state, it may force a disk check and possibly lead to data loss. To help with this, Google Compute Engine encourages you to make sure that your disk buffers are flushed before you take your snapshot. For example, if your operating system is writing data to the persistent disk, it is possible that your disk buffers are not yet cleared. Follow these instructions to clear your disk buffers:"
CAVEAT: Make sure you unmount any mounted volumes, I've had snapshots bricked where this hasn't been done.

- 2,059
- 20
- 18