Machine images


This page describes what a machine image is, when to use it, and how it comparesto other resources that store data such as snapshots or custom images.For information about creating a machine image, seeCreating machine images.

A machine image is a Compute Engine resource that stores all theconfiguration, metadata, permissions, and data from multiple disks of avirtual machine (VM) instance.You can use a machine image in many system maintenance, backup and recovery,and instance cloning scenarios.

When to use a machine image

The following table compares the use of machine images,standard disk snapshots,instance templates, andcustom images.

ScenariosMachine imageStandard disk snapshotCustom imageInstance template
Single disk backupYesYesYesNo
Multiple disk backupYesNoNoNo
Differential backupYesYesNoNo
Instance cloningYesNoYesYes
Base image for replicationNoNoYesNo

From the preceding table, you can see that machine images are the mostideal resources for the following use cases:

Multiple Disk backups

Machine images support backups at the instance level. Disks are backed upasdifferential snapshots.

When a machine image is used to copy disks, Compute Engineguarantees that the data across disks is captured in a crash-consistent mannerat a given time. Compute Engine uses globally consistent timestamps toensure this guarantee. This consistency is critical if your instance isrunning and you want to ensure that the backup point across disks is maintained.When the backup point across disks is maintained, you can return to the samepoint in time across disks when you restore a machine image.

Note: This consistency guarantee only applies at the I/O operation level orcrash level. This guarantee isn't applied at the application level. Consistencyguarantees at the application level would require OS and applicationparticipation.

Multiple disk backup

Machine images are suitable for creating backups of all disks that are attachedto a VM instance.A machine image can be used to backup multiple disks at a time. Astandard disk snapshot can only backup a single disk at a time.

Differential disk backup

Machine images store differential snapshots of your previously created machineimages or snapshots. When you generate a machine image from a VM instance,the first machine image contains a full copy of all disk data. Subsequentmachine images are stored as differential copies for better performance andspace efficiency.This mechanism is similar to that used bystandard disk snapshots.

Instance cloning

Machine images can be used to clone instances. You can use machine image tomake copies of an instance that containsmost of the VM configurationsof the source instance. These copies can then be used for troubleshooting,scaling VM instances, debugging, or system maintenance.

Information stored in a machine image

A machine image collects the following information from the source instance:

The following information from the source instance is not collected by a machineimage:

  • Data in memory.
  • Data stored in attachedLocal SSD disks.However, a machine image captures the device mapping of the Local SSD disks.
  • Attributes that are specific to the source instance, such as the name orIP address.

Machine image storage location

To meet compliance needs, you might need to control where yourdata is stored. You can control where your machine image is storedgeographically by specifying astorageLocation during the creation of yourmachine image. Machine images can be stored in aCloud Storage multi-region,such asasia or aCloud Storage region,such asasia-south1.

By default, when creating a machine image from an instance, the machine image isstored in either the Cloud Storage multi-region bucket that contains thesource instance, or the geographically closest Cloud Storage multi-regionbucket to the source instance.

For example, if your source instance is stored inus-central1 your machineimage is stored in theus multi-region by default. However, a default locationlikeaustralia-southeast1 is outside of a multi-region. The closestmulti-region isasia.

Regardless of where the machine image is stored, you can still access the machineimage globally by setting the proper permissions.

Pricing

The cost of using a machine image depends on the size of the machine image,and the location where it is stored.

To determine the cost of your machine image, complete the following steps:

  1. Use thegcloud compute machine-images describe commandto find the storage size in bytes. When an image is created, its storage sizein bytes is based on the set of blocks that have been written on the sourcedisks that are used for the image, regardless of the contents of the blocks.

    gcloud compute machine-images describeMACHINE_IMAGE_NAME

    ReplaceMACHINE_IMAGE_NAMEwith the name of the machine image.

  2. Scroll to the end of the output, review the value stored in thetotalStorageBytes field. This value is in bytes, convert this value toJEDEC binary gigabytes (GB), or IEC gibibytes (GiB), where 1 GiB is230 bytes.

    .......storageLocations:- ustotalStorageBytes: '58688064'
  3. Use the pricing tables on theDisk pricing page to find thecost per GB for your disk type and region.

    Alternatively, you can use theGoogle Cloud Pricing Calculator to estimate themonthly cost.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-18 UTC.