Загрузить свой собственный образ виртуальной машины в GCE

1481
Bruno Finger

Я подготовил очень легкий, урезанный и оптимизированный для задач, интенсивно использующих процессор, систему Debian для запуска на Google Cloud Engine. Но, как и в AWS, я не могу найти способ загрузить эту виртуальную машину в Google. Является ли это возможным?

1

1 ответ на вопрос

1
chrispomeroy

Source: https://cloud.google.com/compute/docs/creating-custom-image#importing_an_image

Also see here for requirements: https://cloud.google.com/compute/docs/tutorials/building-images

Import a RAW image

You can import a RAW image file into Compute Engine and use it to create new instances. In order to import a RAW file, the file must fulfill the following requirements:

The RAW file must be named disk.raw. The RAW file must be packaged as a gzipped tar file with the tar.gz file extension. For example, you can package a RAW file using the tar command: $ tar -Sczf example-image.tar.gz disk.raw The file must be stored in Google Cloud Storage. Note: The tar file must be Compute Engine-compatible, created either through the Export an image to Google Cloud Storage section or the Build an image from scratch documentation. Tarballs created in any other way are not guaranteed to work on Compute Engine Users running Mac OS X can use Homebrew to install the gnu-tar package. This package creates tar files that are compatible with Compute Engine. To add a RAW image to your project, add the tar file containing the disk.raw image to your images list. In gcloud compute, run the following:

$ gcloud compute images create IMAGE_NAME --source-uri URI You must choose an image name that is unique among all images in the project and provide the URI of your tar file in Google Cloud Storage, using either of the URI scheme shown below:

gs://BUCKET_NAME/IMAGE_NAME.image.tar.gz https://storage.googleapis.com/BUCKET_NAME/IMAGE_NAME.image.tar.gz You can check if the image is ready to use by performing a images describe command, which returns the image state as well. After the image is READY, you can use it for your instances.

When you add an image, Google Compute Engine makes a private copy of the image to use. Any changes that you make the original Google Cloud Storage object won't affect the image used by Google Compute Engine.

Note: Compute Engine images will automatically be stored in the same location as the source Cloud Storage object to improve the performance of these images in that location. Once you have successfully added the image to Compute Engine, you can use to it start new instances.