Google Compute Engine : Use snapshot from another project?

前端 未结 7 1414
别那么骄傲
别那么骄傲 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:45

    Instances can be created across the project using images. Now, if you have an image in Project 1, you can select that in Project 2 as well.

    But, as of today, you can't see the disks across the project. If you have to migrate an VM with associated additional disks from Project 1 to Project 2, follow the below.

    1. Use the snapshot and create the disk in Project 2 by connecting the gcloud command interface. Connect to Project 2, and then execute:

      gcloud compute --project "GCPProject2" disks create "myserver-disk1" --size "50" --zone "us-east1-b" --source-snapshot https://www.googleapis.com/compute/v1/projects/GCPProject1/global/snapshots/snapshot-myserver-disk1 --description "DriveName" --type "pd-standard"
      
    2. Above will create the disk in Project2. Then you need to delete the instance in Project1 by retaining the boot disk. Then, create the image from the disk myserver-bootdisk. Once the image is created, switch over to Project 2 and then create the server from image, use the dropdown and select the image from Project 1.

    3. Add the additional disk which you have crated from the snapshot and create the VM.

提交回复
热议问题