EXPORTING A CUSTOM IMAGE TO GOOGLE CLOUD STORAGE

Diana Moraa
3 min readFeb 15, 2022

--

Custom images capture the contents of a single disk, for example, a boot disk, which can be used to create new instances that are preconfigured with the apps that you need, so that you don’t have to configure public images from scratch

If you are to migrate your instances from Google cloud platform to another destination like VMware, Hyper-V, or even AWS or you even want to download and store instances in disks off the GCP platform, You can export Google cloud disk to a compatible format with the destination environment such as VMDK(Virtual machine disk) , VHDX(Hyper V virtual hard disk) , VPC(VirtualPC), VDI(VirtualBox disk image) etc.…

The steps include:

  1. Prepare the VM for an image.

Stop the VM so that it can shut down and stop writing any data to the persistent disk

2. Selecting the disks you want to export

3. Creating a new google custom image from selected source disk

4. Exporting Google image to supported format

In the console, Go to images and click the name of the image you want to export , click export to open the export image page then choose the export format of the image.

5. Choose an existing cloud storage location to export your image and select or create a new storage bucket to store the exported image to cloud storage. Then click export.

The cloud console displays the image export history where you can view the export process. For additional details about the image export process, click the cloud build ID to go to the image export details where you can view and download the export log. Image export require cloud API activation and you should enable it and you must also have the cloud build permission

6. Go to cloud storage page to access the exported image, get the cloud storage public link and download the image

7. Delete the custom image so you don’t incur costs.

ALTERNATIVELY:

Another preferred way to export an image to cloud storage is to use the gcloud compute images export command. The command chains together the multiple steps that are required to export the image.

Using the gcloud command-line tool, run:

gcloud compute images export — destination-uri [DESTINATION_URI] \

— image [IMAGE]

Where :

[DESTINATION URL] is the cloud storage URI destination for the exported virtual disk file.

[IMAGE] is the name of the disk image to export.

--

--

Diana Moraa
Diana Moraa

Written by Diana Moraa

Passionate and motivated about Cloud Computing technology because it continues to allow us to modernize, consolidate IT infrastructure and automate workloads.

No responses yet