Google Compute Engine:使用其他专案的快照? [英] Google Compute Engine : Use snapshot from another project?

查看:261
本文介绍了Google Compute Engine:使用其他专案的快照?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发人员控制台中有两个专案。我已经拍摄了项目-1中的一个虚拟机的快照。我想使用在项目2中创建的快照在项目2中创建一个新的虚拟机。现在快照不会显示在选项中。
如何将快照从一个项目导入另一个项目?

I have two projects in my developer console. I have taken a "Snapshot" of one of the VMs in project-1. I want to create a new VM in project-2 using the snapshot created in project-1. Right now snapshot is not showing in the option. How can I import snapshot from one project to another?

推荐答案

1,然后使用Project 2从该图像创建一个实例。

You can create an image from the snap in Project 1, then create an instance from that image using Project 2.

我假设你在两个项目中都有编辑权限。

I'm assuming you have edit rights in both projects.

你的问题说你有一个快照,并希望在项目2中创建一个实例。

Your question says you have a snapshot and want to make an instance in project 2 from the snap in project 1.

如果你还有您已快照的磁盘,请确保它不再连接到实例。如果它仍然附加到实例,请取消选中删除实例时删除引导磁盘并删除实例。转到图片,然后单击从磁盘创建映像,并从此磁盘创建映像。

If you still have the disk available that you had snapshotted, make sure it's no longer attached to an instance. If it's still attached to the instance, uncheck "delete boot disk when deleting instance" and delete the instance. Go to Images and click create image from disk, and create an image from this disk.

如果您没有磁盘可用, / strong>,创建实例并将引导磁盘设置为快照并选择快照。

If you do not have the disk available, but just the snapshot, create an instance and set the boot disk as a snapshot and select your snapshot. Then follow the directions above to create an image by deleting the instance first.

现在您在项目1中有一个图片。您应该会看到它列在图片下面。

Now you have an image in project 1. You should see it listed under images.

我不知道为什么,但是你不会在项目2中看到控制台中列出的映像,但是您可以使用gcloud在项目2中使用映像创建一个实例在项目1中,单击图像并单击查看REST,将有一个完整的图像URL,类似于:

I'm not sure why, but you won't see the image listed in the console in project 2, however you can use gcloud to create an instance in project 2 using the image from project 1. In project 1, click on the image and click "view REST" there will be a full URL to the image, similar to this:

https://www.googleapis.com/compute/v1/projects/cpomeroy-whitelist/global/images/ruby-image

使用gcloud在项目2中使用项目1中的图像创建实例:

Use gcloud to create an instance in project 2 using the image in project 1:

gcloud config set project <project-id-of-project-2>
gcloud config list

(您应该验证您是否在项目2中)

(You should verify you are in project 2)

gcloud compute instances create <name of instance> --image https://www.googleapis.com/compute/v1/projects/cpomeroy-whitelist/global/images/ruby-image

显然你的URL会有所不同。

Obviously your URL will be different.

我只是测试了这个,它工作。如果您需要更多帮助,请告诉我们。

I just tested this and it works. Let me know if you need more help.

这篇关于Google Compute Engine:使用其他专案的快照?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆