Recreating a VM on a different GCP project: How can I transfer a disk snapshot across projects in Google Cloud Platform projects?

0 votes

I am having a VM instance  in project A in GCE. I want to make a brand new instance that supported this VM in another project B.
I know that I could spawn a new instance via a disk snapshot but, is there any option to transfer such a snapshot across project?
What's the way to transfer a disk snapshot across projects in Google Cloud Platform projects?
Is there an improved way to reach this aside from employing a docker image?

Oct 16 in GCP by Karan
• 5,700 points
42 views

1 answer to this question.

0 votes

Since I can't shutdown the source VM because it is used in the production environment, I can follow these steps to create a mirror VM in another project:

1) Create a snapshot of the boot disk of the source VM instance

2) Create a disk which is based on this snapshot in the target project

gcloud compute disks create vm-prod-disk --source-snapshot \
 https://www.googleapis.com/compute/v1/projects/<source-\
 project>/global/snapshots/<source-vm-snapshot> --project target-project

3) Create a VM based on the new disk from step 2

gcloud compute instances create vm-prod-duplicate \
--project target-project --disk name=vm-prod-disk,boot=yes

answered Oct 16 by Sirajul
• 37,930 points

Related Questions In GCP

0 votes
1 answer

How can I find out who created a project in GCP?

You could probably use Stackdriver Cloud Audit ...READ MORE

answered Oct 9 in GCP by Sirajul
• 37,930 points
15 views
0 votes
1 answer

How do I disable suspend a project in Google Cloud?

Shutting down a project within the console releases all ...READ MORE

answered Oct 16 in GCP by Sirajul
• 37,930 points
37 views
0 votes
1 answer

Creating a SQL Server instance using Google Compute engine.

Google Compute Engine provides public images preconfigured with ...READ MORE

answered Sep 23 in GCP by Sirajul
• 37,930 points
36 views
0 votes
1 answer

How do i install gcloud compute?

The gcloud compute command-line tool enables you to easily ...READ MORE

answered Sep 23 in GCP by Sirajul
• 37,930 points
43 views
0 votes
1 answer

How do I create a Google Cloud Platform (GCP) account?

In order to access the services provided ...READ MORE

answered Sep 20 in GCP by Sirajul
• 37,930 points
51 views