Boppity Bop Asked: 2021-11-01 03:29:19 +0800 CST2021-11-01 03:29:19 +0800 CST 2021-11-01 03:29:19 +0800 CST GCP 控制台脚本自动将 VPS 迁移到更高层? 772 是否有gccloud将机器迁移到general-purpose的示例脚本compute-optimised?它是一个网络服务器,所以我宁愿新机器也保留 IP。停机 10-20 分钟即可。 google-cloud-platform google-compute-engine 1 个回答 Voted Best Answer Boppity Bop 2021-11-04T06:12:54+08:002021-11-04T06:12:54+08:00 更改 VM 类型gcloud需要为项目设置默认区域和区域,停止 VM,更改类型: # 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 注意:您需要静态 IP 才能 100% 确定 IP 之后不会更改
更改 VM 类型
gcloud
需要为项目设置默认区域和区域,停止 VM,更改类型:注意:您需要静态 IP 才能 100% 确定 IP 之后不会更改