How to change a machine type on Google Compute Engine?

UPDATE: this answer is no longer true, as the ability to change instance type was added after this answer was written. See accepted answer.

Although there is no direct "edit machine type" option on GCE, the way to achieve that is:

  1. Deleting the old instance (while making sure the disk is not deleted).
  2. Creating a new instance with the desired type and using the disk from the old instance (instead of creating a new one)

This seems to be possible in gcloud:

https://cloud.google.com/sdk/gcloud/reference/compute/instances/set-machine-type

gcloud compute instances set-machine-type 

allows you to change the machine type of a virtual machine in the TERMINATED state (that is, a virtual machine instance that has been stopped). For example, if example-instance is a g1-small virtual machine currently in the TERMINATED state, running:

$ gcloud compute instances set-machine-type example-instance \ 
    --zone us-central1-b --machine-type n1-standard-4

will change the machine type to n1-standard-4, so that when you next start example-instance, it will be provisioned as an n1-standard-4 instead of a g1-small.


It is now possible in the Google compute engine (You can refer to this document).

You just need to stop the instance. And you can then edit the instance type and restart.