我可以在Google Compute Engine上创建超过10GB的操作系统映像吗? [英] Can I create an OS image of more than 10GB on Google Compute Engine?

查看:66
本文介绍了我可以在Google Compute Engine上创建超过10GB的操作系统映像吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用特定的映像启动约500个实例,以处理需要POSIX访问超过10GB的大文件.根据该文档, https://developers.google.com/compute/docs/images 创建超过10GB的启动盘是不可能的,我需要POSIX访问超过10 GB.这是否意味着我将需要在每个需要磁盘空间的实例上创建另一个非引导磁盘?还有另一种方法吗?

I need to boot about 500 instances with an specific image to do a job with big files that requires POSIX access to more than 10GB. According to that doc https://developers.google.com/compute/docs/images it's impossible create a boot disk of more than 10GB and I need POSIX access to more than 10 GB. Does this mean I will need to create another non-boot disk on each instance with disk space I need? Is there another way to do that?

推荐答案

您可以使用打包器创建图像在GCE上,它将在启动时自动调整大小.我已经针对这个带有演示的问题专门创建了一个 repo 使用最新版本的Debian-7反向端口或容器优化的VM映像来自动调整大小的映像.

You can use Packer to create images on GCE which will auto-resize on boot. I have created a repo specifically for this question which has a demo of an auto-resizing image using recent versions of either Debian-7 backports or container-optimized VM images.

它使用 cloud-initramfs-growroot :

在首次启动时自动调整根分区的大小

此软件包为initramfs-tools构建的initramfs添加了功能.安装后,initramfs将对磁盘重新分区,以使根卷占用其后的所有空间.

This package adds functionality to an initramfs built by initramfs-tools. When installed, the initramfs will repartition a disk to make the root volume consume all space that follows it.

除非您知道自己在做什么,否则您很可能不希望该软件包.在虚拟化环境中,可以以大于原始大小的大小预配磁盘,这是非常有趣的.在这种情况下,安装此软件包后,您可以自动使用新空间,而无需重新引导以重新读取分区表.

You most likely do not want this package unless you know what you are doing. It is primarily interesting in a virtualized environment when a disk can provisioned with a size larger than its original size. In this case, with this package installed, you can automatically use the new space without requiring a reboot to re-read the partition table.

请参阅我的脚本 growroot.sh 了解详细信息以及如何使其适应用例.

See my script growroot.sh for details and how you can adapt it to your use case.

这篇关于我可以在Google Compute Engine上创建超过10GB的操作系统映像吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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