How to recreate a google compute engine VM from one project in another project?

0 votes
How to recreate a google compute engine vm from one project (that is in production) to another project?
Nov 14 in GCP by anonymous
• 6,650 points
22 views

1 answer to this question.

0 votes

Since I cannot turn off the source VM because it is currently in use in a production environment, I have to use the following steps to create a mirror VM in another project:

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

2) Create a disk 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 Nov 14 by Sirajul
• 40,980 points

Related Questions In GCP

0 votes
1 answer

How to delete a project from Google Cloud Console

First of all, select the project you ...READ MORE

answered Apr 18, 2018 in GCP by kurt_cobain
• 9,280 points
188 views
+1 vote
2 answers

How to open a port on google compute engine

You need to set the firewall rule ...READ MORE

answered Jul 9 in GCP by K sagar
192 views
0 votes
1 answer

How to disable creating users in Google compute engine ?

You can stop a GCE instance from adding accounts ...READ MORE

answered Oct 16 in GCP by Sirajul
• 40,980 points
16 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
• 40,980 points
53 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
• 40,980 points
72 views