Clone a server from one project to the other in Google Cloud Platform

Phanix
·
·
IPFS
·

目前看來有兩個方式,都可以 work

方法一

# in project-1
$ gcloud compute images create image-v1 --source-disk DISK_ID --source-disk-zone asia-east1-c --family my-image-family

# in project-2
$ gcloud config set project project-2
$ gcloud auth login
$ gcloud compute instances create sandbox-1 --image image-v1 --image-project project-1 --boot-disk-size=100GB --zone=asia-east1-c

方法二

$ gcloud compute images describe [image] --project project-1

#copy the url from 'selfLink' (eg: "https://www.googleapis.com/compute/v1/projects/project-1/global/images/[image]")

$ gcloud config set project project-2

$ gcloud compute instances create [instance name] --image [Link]

Original link: Phanix's Blog

CC BY-NC-ND 2.0 授权

喜欢我的作品吗?别忘了给予支持与赞赏,让我知道在创作的路上有你陪伴,一起延续这份热忱!