Google Compute Engine : Use snapshot from another project?

前端 未结 7 1422
别那么骄傲
别那么骄傲 2020-12-13 10:07

I have two projects in my developer console. I have taken a \"Snapshot\" of one of the VMs in project-1. I want to create a new VM in project-2 using the snapshot created in

7条回答
  •  难免孤独
    2020-12-13 10:53

    The answer posted by @chrispomeroy worked for me, but I was able to simplify it a little as I need to do this more and more.

    Let's say you have an image in project-1, and need to create an instance using that image in project-2.

    gcloud config set project "project-2"
    gcloud compute instances create  \
        --image  \
        --image-project "project-1"
    

    This eliminates the need to worry about using a URL for anything.

    EDIT: My answer pretty much looks like his at this point, but the docs for this stuff is here:

    gcloud compute instances create

提交回复
热议问题