如何在项目之间共享Google计算引擎图像? [英] How to share google compute engine images across projects?

查看:56
本文介绍了如何在项目之间共享Google计算引擎图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自文档我知道图像是全局资源,任何资源中的任何资源都可以访问同一项目中的区域"..

From documentation I know that images are global resources that "are accessible by any resource in any zone within the same project".

我正在寻找类似于在AWS中共享AMI的功能.也就是说,我创建了一个图像,将其公开,任何人都可以立即使用它.

I am looking for a functionality similar to sharing AMIs within AWS. That is, I create an image, make it public and anyone can use it immediately.

如何在GCE中最好地实现类似目标?问题是我需要创建的映像很大-大约100GB.因此,我正在寻找一种共享图像的方式,而不会涉及慢速复制(例如,从Google云存储中的存储桶中复制).

How to best achieve something similar in GCE? The problem is that the image I need to create would be large - around 100GB. So I am looking for a way of sharing the image that wouldn't involve slow copying (e.g. from a bucket in google cloud storage).

推荐答案

您可以使用Google Cloud Storage,但是每次下载时都会向您收费,并且会花费很长时间(如果为100 GB)

You could use Google Cloud Storage, but then you will be charged every time it will be downloaded, and it will take long time (if it is 100 GB).

更好的解决方案是授予用户可以查看"对您的项目的访问权限.然后,用户可以使用您的图像使用gcloud命令行创建实例.但是请注意,该用户将看到您在项目中拥有的所有内容,只是无法更改.

The better solution is to give the user "Can view" access to your project. Then user can create a instance using your image, using gcloud command line. But be aware, that user will see all that you have in the project, he just won't be able to change it.

如果图像的所有者已在要使用的区域中使用了该解决方案,则此解决方案速度更快.因为图像在此处兑现,所以它将立即开始.另一个优点是,如果有人下载此图片,该所有者将无需付费.

This solution is faster, if the owner of the image, has used it in the zone, you want to use. Because the image is cashed there, and it will start instantaneously. Another plus is, that owner doesn't get charged if someone downloads this image.

`gcloud compute instances create [INSTANCE_NAME]
    --image-family [IMAGE_FAMILY]
    --image-project [IMAGE_PROJECT]
    --machine_type=<type-of-machine> 
    --network="default"
    --family my-image-family`

如果您想授予更多人访问权限,则可以创建一个Google组,允许组成员可以查看"对项目的访问权限.现在,您可以使用您的Google网上论坛控制谁可以访问它.

If you want to give access to a larger group of people, you can create a Google group, allow group members "Can view" access to the project. Now you can control who can access it, using your Google group.

这篇关于如何在项目之间共享Google计算引擎图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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