How to move an instance to another project
Stay organized with collections
Save and categorize content based on your preferences.
Problem
There is no option in Google Cloud Console or Cloud SDK to move a Google Compute Engine instance between projects.
Environment
- Google Cloud console
- Cloud SDK
Solution
- Stop the VM Instance.
gcloud compute instances stop INSTANCE_NAME --zone=ZONE --project=OLD_PROJECT_ID
- Create an image from the VM Instance disk.
gcloud compute images create IMAGE_NAME --source-disk=DISK_NAME --source-disk-zone=DISK_ZONE --project=OLD_PROJECT_ID
- Confirm the image is created and present.
gcloud compute images list --project=OLD_PROJECT_ID
- Create a new VM Instance using the newly created image.
gcloud compute instances create INSTANCE_NAME --image=IMAGE_NAME --image-project=OLD_PROJECT_ID --project=NEW_PROJECT_ID
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-12 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-12 UTC."],[],[]]