Copying Linux VM to Different Project and Region

Configuring compute systems.

You want to make a copy of a production Linux virtual machine in the US-Central region. You want to manage and replace the copy easily if there are changes on the production virtual machine. You will deploy the copy as a new instance in a different project in the US-East region. What steps must you take?

  1. Use the Linux dd and netcat commands to copy and stream the root disk contents to a new virtual machine instance in the US-East region.
  2. Create a snapshot of the root disk and select the snapshot as the root disk when you create a new virtual machine instance in the US-East region.
  3. Create an image file from the root disk with Linux dd command, create a new virtual machine instance in the US-East region
  4. Create a snapshot of the root disk, create an image file in Google Cloud Storage from the snapshot, and create a new virtual machine instance in the US-East region using the image file the root disk. Correct Answer
Answer Correct answer: D — Create a snapshot, convert to an image file in Cloud Storage, and use that image to create a new instance in the target project.

Community Insight

The question tests cross-project and cross-region VM replication, where the common trap is assuming snapshots can be directly used across projects without conversion to an image in Cloud Storage.

This page explains the correct procedure for replicating a production Linux VM to a different project and region using Google Cloud Compute Engine snapshots and images.

Many learners choose Option B (Create a snapshot...), mistakenly believing that global snapshots can be directly attached as root disks in another project, ignoring the need for image conversion or sharing mechanisms.

Community Discussion (97 comments)

eff12c1 👍 1 Selected: B
B. snapshot the root disk, then create the new VM’s boot disk from that snapshot in the target project/region. Why not the others: A. dd + netcat → Manual, fragile, not Google-recommended. C. dd image file → Manual and operationally complex. D. snapshot → image file in Cloud Storage → Unnecessary extra step. You can create a disk/VM directly from a snapshot.
Jorgehr7 👍 2 Selected: B
Why not B. You can create a VM from snapshot in the same project or another
Toothpick 👍 3
In the current state of GCP , Both B and D can be done in 3 gcloud commands each, (and both require equal amount of snapshot handling). D is better if you have more than one instance to create but in this case , they are both equally valid.
Toothpick 👍 1
Edit, B might even be easier , you can directly create a snapshot in a target project and when creating a new vm, simply choose it as a root disk, just tried and verified it myself now
ccpmad 👍 1 Selected: D
We neet to move from one region o another, so we need snapshot of the root disk and send it to Cloud Storage. In the scenario of using in the same region, it is better tu use instance image, not snapshots of root disk.
Toothpick 👍 1
U can directly create the snapshot in any target project
adoyt 👍 2
B isn't correct because you have to create a disk first. You cannot create a VM from a snapshot directly. gcloud compute disks create DISK_NAME \ --source-snapshot SNAPSHOT_NAME \ --project SOURCE_PROJECT_ID \ --zone ZONE
hitmax87 👍 1
Yes you can: gcloud compute instances create my-new-vm \ --zone=us-central1-a \ --machine-type=e2-medium \ --source-snapshot=my-existing-snapshot
odacir 👍 3 Selected: D
https://cloud.google.com/compute/docs/instances/copy-vm-between-projects
Prakzz 👍 3 Selected: D
https://cloud.google.com/compute/docs/instances/copy-vm-between-projects you have to create Image from Snapshot and share it to the destination project.
didek1986 👍 1 Selected: B
B is correct
ananta93 👍 1
B is the correct answer and It is straight forward.
ccpmad 👍 1
No, B is not correct, try your answer in GCP. Yo will not see your snapshot, because in different regions you don't have visibility of snapshots, that's why we need to move it to Cloud Storage first.
PST21 👍 2
B is incorrect as it doesnt create an image uses the snapshot and hence D is the only corret option
AugustoKras011111 👍 1 Selected: D
D seems better, but B actually works too.
romandrigo 👍 4 Selected: D
https://cloud.google.com/compute/docs/instances/copy-vm-between-projects#zonal-boot-disk
Clauther 👍 2 Selected: B
B is the right one as of 01/2023
n_nana 👍 2 Selected: B
Currently , It is possible to create VM from snapshot within same project, different project or even different organisation. so answer B is more straight forward.
n_nana 👍 2
https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots_across_orgs
examch 👍 1 Selected: B
B is the correct answer, We can create VM from snapshot across zones and regions, please read through the link, https://cloud.google.com/compute/docs/instances/moving-instance-across-zones#moving-an-instance-manually
surajkrishnamurthy 👍 1 Selected: D
D is the correct answer
arpitshah20 👍 1 Selected: D
D is correct
Mahmoud_E 👍 1 Selected: D
D is the right answer, B would be a good answer if mentioned to share the snapshot with other project
AzureDP900 👍 1
I will go with D
riyer1 👍 2
The generic flow goes like this: snapshot --> Image --> Instance Template --> MIG The instance is created after the image without an instance template in this question. That will also work.
Nirca 👍 1 Selected: B
B must be the correct one
vincy2202 👍 1 Selected: D
D is the correct answer
joe2211 👍 2 Selected: D
vote D
Omni_Omnom 👍 2
D is the correct answer. Key word - different project in the same region. https://cloud.google.com/compute/docs/instances/copy-vm-between-projects
MikeB19 👍 1
Here is the article explaining how to share snapshots across projects in the same org. https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots
muneebarshad 👍 3
B & D are both Correct . With Option B you can make a copy of the instance in fewer steps than Option D. (a) Create a snapshot from the instance lets say "Snapshot-1" (b) Go to "Snapshot-1" & (b) "Create instance" from the snapshot Snapshot does not have regional/Project limitation (as long as Projects are under the same ORG" ) . Why B is not the right option ?
MikeB19 👍 1
I agree snapshots are org level resources. They can be restored to any region
purushi 👍 3
Copy of production Linux virtual machine in the US-Central region: - Copy = Boot disk + Local VM data ( SSD / HDD ) - Snapshot first. We cannot boot from snapshot. Need to create an image out of it. - Image - Right choice. Booting is possible + data is available in the new VM in new region
tifo16 👍 2
D is correct. see https://cloud.google.com/compute/docs/instances/copy-vm-between-projects#zonal-boot-disk
Svar 👍 2
C is correct. You can create a snapshot of the root disk directly, and use it to create a new VM, as long as the new VM will be created in the same US geographical place, and this is the case becase we're going from us-central to u-east region.
victory108 👍 1
B - Create a snapshot of the root disk and select the snapshot as the root disk when you create a new virtual machine instance in the US-East region.
viv9 👍 2
D- Disk creation from the shared snapshot is required while using snapshot across project. Since "B" only emphasise over snapshot sharing & not over the disk creation and then attaching it to the new instance in different project so "D" seems correct. https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots
un 👍 1
I go with D
getAlok 👍 1
D is correct answer. B is wrong because from snapshot can not use as a the root disk. You can created snapshot in one region. share snap shot with other region, create disk from snap shot and use in VM... B is saying use snapshot as a root disk
register829 👍 2
Manage and replace being the key factors. Image are easier to maintain due to a lifecycle, snapshots may have dependencies as well. B and D are possible. D is recommend due to lifecycle.
tzKhalil 👍 1
B and D is the ans
Ausias18 👍 1
Answer is D
lkjhgfdsa 👍 2
It is D: https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots
lkjhgfdsa 👍 1
D: https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots
gauravagrawal 👍 3
D is ok because here we are talking about setting a new VM in a different project.
VenV 👍 2
Answer is D
willan 👍 2
Agree with D
Bijesh 👍 1
ITs not D anymore If your project belongs to an organization, the organization can have several other projects with varying levels of access to other projects. When you create custom images, you can share these images with other users from other projects within the organization. https://cloud.google.com/compute/docs/images/managing-access-custom-images
VSMu 👍 4
B would have been the answer in the current context. But as I read carefully, it doesnt mention the step of sharing snapshot across projects. It directly expects to use the snapshot. Hence D may be the right answer!
aGr_pX 👍 2
It seems D is correct, according to: https://cloud.google.com/compute/docs/machine-images#when-to-use Persistent disk snapshot is not for instance cloning and replication, but custom image is expected for this action.
emybreth 👍 2
Selected D as final for me, passed exam
Aru23 👍 1
D is correct
shajusn 👍 2
After thought.. Though it is possible to create a vm, I do not agree with 'select the snapshot as the root disk' statement, hence agree with D
shajusn 👍 1
B should be ok.. You can create a new VM in a different project using snapshot. It is not possible to create through console, but you can use gcloud command. cloud compute instances create inst2 --project strategic-atom-283503 --source-snapshot https://www.googleapis.com/compute/v1/projects/new-itid/global/snapshots/snapshot-2 --subnet new-vpc
register829 👍 2
You need to create a disk from snapshot before using it across projects. https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots. Hence D is the best answer.
whitley030390 👍 1
I agree with D being the correct answer here.
AshokC 👍 1
D is right
ArthurL20 👍 16
Only if its in the same zone: https://cloud.google.com/compute/docs/disks/create-snapshots#sharing_snapshots "Note: The disk must be in the same zone as the instance." But this is not the case here, we have: Different zones and different project hence, you must use a bucket.
JasminL 👍 11
I think the question has 2 different answers now as Google improve the snapshot function. Quoted from the link: 'You can create snapshots from disks even while they are attached to running instances. Snapshots are global resources, so you can use them to restore data to a new disk or instance within the same project. You can also share snapshots across projects.'
gupta2020 👍 1
D is correct. Requirement to create a vm in diff project.
kumarp6 👍 1
According to me B is the correct answer. Two things to Consider to answer question: In 1) Create a snapshot and create VM in US-EAST, while creating snapshot you can select to US-EAST as a region so that Snap is created. Create VM there after. Note: In this you will incur some cost, "There may be a network transfer fee if you choose to store this snapshot in a location other than the source disk." 2) Option D: This might be right if you sharing across projects and/or publicly. I dont see any as such requirements mentioned in Question. Which Justify my answer, hope this helps.
VenV 👍 1
It clearly says different project. The answer is D
noussy 👍 8
According to the documentation we can now https://cloud.google.com/compute/docs/disks/create-snapshots
teeess 👍 1
Answer cannot be B (because even though snapshots can be exposed across different projects, the wording says, select snapshot as the root disk (rather than the boot disk). Answer is D.
anant88 👍 5
People are getting confused with option B and D B is not possible - Snapshots are not directly shared across projects (requirement is to put in a new project)
Barry123456 👍 1
The answer is B. The snapshot is copied into a disk when you make the VM. The snapshot is not destroyed either, you can use it again if you like. Try it, it works fine!
Khannas 👍 1
Both B and D are correct but best answer is D
mlantonis 👍 1
At first I was confused with B, but then I figured out that Snapshots are not reachable in a different project. So you need to create an Image. D is the correct answer.
devnull10 👍 2
I think the key here is that the question says "Deploy in a new project" - so it can't be B because snapshots aren't cross-project.
gfhbox0083 👍 1
D, for sure
HectorLeon2099 👍 2
D is correct. B is wrong as snapshots are not reachable in a different project.
asure 👍 1
B and D both are correct
Nirms 👍 1
D is the correct answer
Ziegler 👍 1
D is the correct answer
Javed 👍 1
Agree D
Jack_in_Large 👍 1
No doubt B is the best solution
clouddude 👍 3
I am going to go with D. A and C cannot be correct because using DD in the cloud to create a boot image is not a valid pattern. B doesn't make sense because you can't boot in a new region from a snapshot in another region. D is the only answer that references the use of images.
gcp_aws 👍 2
Because the question talks about creating an instance in a different project, the answer is D. You must create an image. Snapshots can not be shared across projects. Correct me if I am wrong.
fraloca 👍 1
Snapshots are a global resources: https://cloud.google.com/compute/docs/disks/snapshots#accessing_snapshots
rbrto 👍 1
correct images are cross proyect. the anwer is D
desertlotus1211 👍 2
Answer is D: https://stackoverflow.com/questions/36441423/migrate-google-compute-engine-instance-to-a-different-region
definepi314 👍 1
This should be the correct explanation.
Rathish 👍 2
Ans: D Migrating VM to new region: Stop the instance Take a snapshot of instance Create an custom image from snapshot Create new VM Change OS Select Custom Image Choose the image created previously
ADVIT 👍 2
It's D https://cloud.google.com/compute/docs/images/export-image
kmanb 👍 4
I agree with Sudipta, Google recommends you create a image of a snapshot disk if you plan on creating multiple VMs. But we're not, here it says only creating one VM. So B would be the best answer
desertlotus1211 👍 4
However the 'real' question is asks: 'You want to manage and replace the copy easily if there are changes on the production virtual machine'. This ask supersede deploy the copy as a new instance in the US-East region...
2g 👍 2
answer: D
Sudipta 👍 16
Why Not B. https://cloud.google.com/compute/docs/instances/create-start-instance#createsnapshot This clearly tells we can use snapshot to create a VM instance, and only need a custom image if we need to create many instances. Here we are creating only one.
Jack_in_Large 👍 13
You can't use the snapshot created by another project
AWS56 👍 4
Agreed with D
passnow 👍 3
There is no argument to this, D is the correct answer
JJu 👍 5
i think answer is D
AWS56 👍 5
D is fine
JoeShmoe 👍 5
B and D both work but better answer is D
Eroc 👍 31
D is correct. A and B are talking about appending the file system to a new VM, not setting it at the root in a new VM set. Option C is not offered within the GCP because the image must be on the GCP platform to run the gcloud of Google Console instructions to create a VM with the image.
ccpmad 👍 1
you are incorrect. It is D
tartar 👍 10
D is ok

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Option D is the correct answer because it outlines the standard, robust workflow for creating a portable, reusable copy of a disk across different projects and regions. Snapshots are global resources but are tightly bound to the project they were created in; you cannot simply point a new instance in a different project to a snapshot from the source project. To move data to a different project, you must create an Image. While modern GCP allows sharing snapshots via IAM, the most durable and 'easy to manage/replace' method described in traditional certification contexts involves exporting the snapshot to an image file (often stored in Cloud Storage) which can then be imported into the target project to create new instances. This aligns with the requirement to 'manage and replace the copy easily,' as images are versioned and stable.

Why the Other Options Are Wrong

Option A uses dd and netcat, which is a manual, low-level OS approach that does not leverage GCP's managed infrastructure and is prone to errors and downtime. Option B suggests using a snapshot directly in a new project; while snapshots are global, they reside in the source project's namespace and cannot be directly selected as a boot disk for an instance in a different project without first being converted to an image or shared explicitly (which isn't detailed in option B). Option C creates a local image file on the host machine using dd, which is not a GCP-native solution and doesn't address how to deploy it to a GCP instance in US-East.

Community Comment Notes

Community consensus strongly favors Option D. As user ArthurL20 noted, "Snapshots are not directly shared across projects" in the sense that you can't just select them; you need to handle the transfer. User Eroc emphasized that options A and B don't set the root disk correctly for a new VM in a different context. Several users pointed out that while snapshots are global, the cross-project constraint necessitates the image step found in D. The debate about Option B often hinges on whether one considers 'sharing' a snapshot sufficient, but D provides the explicit mechanism (image file) required for cross-project deployment in this exam's logic.

Exam Strategy

When dealing with cross-project or cross-region VM replication, always look for the 'Image' as the intermediate artifact. If the target is a different project, you generally cannot use a Snapshot directly unless you explicitly share it; however, converting to an Image is the standard pattern for creating reusable templates across boundaries.

Frequently Asked Questions

Can I use a snapshot directly from Project A in Project B?

No, snapshots are project-scoped. You must either share the snapshot via IAM permissions or convert it to an Image and import it into Project B.

Why is Option B incorrect for cross-project migration?

Option B implies using the snapshot directly. In GCP, you cannot attach a snapshot from Project A as a boot disk for an instance in Project B without first creating an Image from that snapshot.

More PCA FAQ →

Related Analysis

Practice All PCA Questions

Access 81 questions with complete answers and detailed explanations.

View Full PCA Practice Test →

← Back to PCA Study Guide