我如何下载谷歌计算引擎图像 [英] how can I download a google compute engine image
问题描述
我如何下载从永久磁盘快照创建的谷歌计算引擎映像?似乎没有通过控制台执行此操作的直接方法.
How can I download a google compute engine image that was created from a snapshot of a persistent disk? There doesn't seem to be a direct way to do this through the console.
推荐答案
没有直接的方法可以从GCE下载图像或快照,但是可以保存图像并将其存储在Google Cloud Storage(GCS)中)可以在哪里下载.您可以使用标准的 gcimagebundle
工具执行此操作.
There isn't a direct way to download a image or snapshot from GCE, but there's a way to save an image and store it in Google Cloud Storage(GCS) where it can be downloaded. You can use the standard gcimagebundle
tool to do this.
您还可以使用 dd
命令来创建该图像.在比您要映像的磁盘大的临时磁盘上,运行以下命令:
You can also create this image using the dd
command. On a temporary disk that’s bigger than the one you want to image, run this:
dd if=/dev/disk/by-id/google-diskname of=disk.img bs=5M
然后您可以运行以下命令将其复制到GCS:
You can then run this command to copy it over to GCS:
gsutil cp disk.img gs://bucket/image.img
然后,您可以:
gsutil cat gs://bucket/image.img | dd of=/dev/disk/by-id/google-newdisk bs=5M
这将允许您制作磁盘映像,然后将其发送到GCS,您可以在其中使用Web界面或gsutil下载它.
This will allow you to make an image of your disk and then send it to GCS where you can download it using either the web interface or gsutil.
这篇关于我如何下载谷歌计算引擎图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!