How to move Persistent Disk from one project to another on Google compute engine | CPO200

Two steps to move your Persistent Disk across instances

1) Create your image from your Persistent Disk ( Here is a link to the google cloud documentation )

$ gcloud compute images create [example-image] --source-disk [example-disk] --source-disk-zone ZONE --project="old-project-name"

2) Instantiate the image in the new project. This requires you to have access to both projects.

$ gcloud compute instances create [example-instance-1] --project=[new-project-name] --image="https://www.googleapis.com/compute/v1/projects/[old-project-name]/global/images/[image-name]" --boot-disk-size [XXXGB] --machine-type=[machine-type] --network="default" --zone=[datacenter-zone] 

You can see the URL of your image in the Images tab under “Equivalent REST” in the console. In Google Developer Console, select the old project and go to Compute -> Compute Engine -> Images. Click on the new image (i.e. ), select Equivalent REST and copy the link (something like https://www.googleapis.com/compute/v1/projects//global/images/)

Published: November 19 2016

  • Category :