Score:-3

GCP Console script to automatically migrate VPS to higher tier?

cn flag

Is there a sample gccloud script to migrate a machine from general-purpose to compute-optimised ? Its a webserver so I'd rather the new machine keeps the IP also. Downtime 10-20 min is OK.

John Hanley avatar
cn flag
Resizing Compute Engine instances is well documented. Please update your question with a problem that you are experiencing that is not covered by the documentation. I am voting to close this question and downvoting for showing no reasonable effort in solving your task before posting this question.
Boppity Bop avatar
cn flag
infinite knowledge can be gained with infinite amount of time
Score:0
cn flag

Changing VM type in gcloud requires setting default region and zone for the project, stopping VM, changing type:

# set defaults
gcloud compute project-info add-metadata \
  --metadata google-compute-default-region=us-east4,google-compute-default-zone=us-east4-c

# check it was set (see commonInstanceMetadata section)
gcloud compute project-info describe --project YOURPROJECTNAME

# reinit gcloud to enable new defaults
gcloud init

# change machine type
gcloud compute instances stop VMNAME

gcloud compute instances set-machine-type VMNAME --machine-type e2-highcpu-4

gcloud compute instances start VMNAME

Note: you need static IP to be 100% sure IP wont change afterwards

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.