How to change my machine type for an instance running on GCP?

0 votes
I had initially used an instance that had very limited capabilities as it was a test environment. Now I wish to change the machine type to increase the number of CPUs and other requirements. I have already stopped the instance. What's the way forward?
Nov 4 in GCP by anonymous
• 4,280 points
22 views

1 answer to this question.

0 votes

You can only change the machine type of a stopped instance and an instance is considered stopped only when the instance is in the TERMINATED state. It is not possible to change the machine type of a running instance.

To change a machine type in gcloud, run the following command, replacing INSTANCE with the instance name, and MACHINE-TYPE with the desired machine type:

gcloud compute instances set-machine-type INSTANCE --machine-type MACHINE-TYPE

Your machine type can be a predefined machine type, such as n1-standard-1, or a custom machine type. For example, a custom machine type with 4 vCPUs and 1 GB of memory can be specified as:

--machine-type custom-4-1024

For more info refer https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance

answered Nov 4 by Sirajul
• 38,740 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

Cannot connect to my VM instance on GCP via SSH.

This might be because UFW is installed. ...READ MORE

answered Sep 27 in GCP by Sirajul
• 38,740 points
57 views
0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23 in GCP by Sirajul
• 38,740 points
38 views
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23 in GCP by Sirajul
• 38,740 points
47 views
0 votes
1 answer

Creating password for a windows instance on GCP

Windows Server instances use password authentication instead ...READ MORE

answered Sep 24 in GCP by Sirajul
• 38,740 points
97 views
0 votes
1 answer