目前看來有兩個方式,都可以 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]