[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-18 (世界標準時間)。"],[[["\u003cp\u003eA machine image is a Compute Engine resource that stores the configuration, metadata, permissions, and data from multiple disks of a virtual machine (VM) instance.\u003c/p\u003e\n"],["\u003cp\u003eMachine images are ideal for multiple disk backups and instance cloning, offering crash-consistent data capture across disks at a specific point in time.\u003c/p\u003e\n"],["\u003cp\u003eMachine images can be stored in specific geographical locations (multi-region or region) for compliance needs, and you can find the size in bytes and determine pricing by running a specific command.\u003c/p\u003e\n"],["\u003cp\u003eUnlike standard disk snapshots, machine images support backing up multiple disks simultaneously and storing differential snapshots for better performance and space efficiency.\u003c/p\u003e\n"],["\u003cp\u003eMachine images capture various VM configurations, including machine type, metadata, labels, and more; however, it will not capture data in memory or in local SSD's, and attributes that are specific to the source instance.\u003c/p\u003e\n"]]],[],null,["*** ** * ** ***\n\nThis page describes what a machine image is, when to use it, and how it compares\nto other resources that store data such as snapshots or custom images.\nFor information about creating a machine image, see\n[Creating machine images](/compute/docs/machine-images/create-machine-images).\n\nA machine image is a Compute Engine resource that stores all the\nconfiguration, metadata, permissions, and data from multiple disks of a\nvirtual machine (VM) instance.\nYou can use a machine image in many system maintenance, backup and recovery,\nand instance cloning scenarios.\n\nWhen to use a machine image\n\nThe following table compares the use of machine images,\n[standard disk snapshots](/compute/docs/disks/create-snapshots),\n[instance templates](/compute/docs/instance-templates), and\n[custom images](/compute/docs/images#custom_images).\n\n| Scenarios | Machine image | Standard disk snapshot | Custom image | Instance template |\n|----------------------------|---------------|------------------------|--------------|-------------------|\n| Single disk backup | Yes | Yes | Yes | No |\n| Multiple disk backup | Yes | No | No | No |\n| Differential backup | Yes | Yes | No | No |\n| Instance cloning | Yes | No | Yes | Yes |\n| Base image for replication | No | No | Yes | No |\n\nFrom the preceding table, you can see that machine images are the most\nideal resources for the following use cases:\n\n- [Multiple disk backups](#disk-backup)\n- [Instance cloning](#cloning)\n\nMultiple Disk backups\n\nMachine images support backups at the instance level. Disks are backed up\nas [differential snapshots](#differential-disk-backup).\n\nWhen a machine image is used to copy disks, Compute Engine\nguarantees that the data across disks is captured in a crash-consistent manner\nat a given time. Compute Engine uses globally consistent timestamps to\nensure this guarantee. This consistency is critical if your instance is\nrunning and you want to ensure that the backup point across disks is maintained.\nWhen the backup point across disks is maintained, you can return to the same\npoint in time across disks when you restore a machine image.\n| **Note:** This consistency guarantee only applies at the I/O operation level or crash level. This guarantee isn't applied at the application level. Consistency guarantees at the application level would require OS and application participation.\n\nMultiple disk backup\n\nMachine images are suitable for creating backups of all disks that are attached\nto a VM instance.\nA machine image can be used to backup multiple disks at a time. A\nstandard disk snapshot can only backup a single disk at a time.\n\nDifferential disk backup\n\nMachine images store differential snapshots of your previously created machine\nimages or snapshots. When you generate a machine image from a VM instance,\nthe first machine image contains a full copy of all disk data. Subsequent\nmachine images are stored as differential copies for better performance and\nspace efficiency.\nThis mechanism is similar to that used by\n[standard disk snapshots](/compute/docs/disks/create-snapshots#before-you-begin).\n\nInstance cloning\n\nMachine images can be used to clone instances. You can use machine image to\nmake copies of an instance that contains [most of the VM configurations](#config-stored)\nof the source instance. These copies can then be used for troubleshooting,\nscaling VM instances, debugging, or system maintenance.\n\nInformation stored in a machine image\n\nA machine image collects the following information from the source instance:\n\n- VM instance configuration. Each VM configuration includes the following\n properties:\n\n - Description\n - [Machine type](/compute/docs/machine-resource#vm_terminology)\n - [Instance metadata](/compute/docs/metadata/overview)\n - [Labels](/compute/docs/labeling-resources)\n - [Network tags](/vpc/docs/add-remove-network-tags)\n - [Maintenance policy](/compute/docs/instances/setting-vm-host-options)\n - If applicable, [Unified Extensible Firmware Interface](https://wikipedia.org/wiki/UEFI) (UEFI) variables\n- The volume mapping used to create [disks](/compute/docs/disks) for the\n source instance.\n\n- Data stored on disks at consistent points in time across the disks.\n\nThe following information from the source instance is not collected by a machine\nimage:\n\n- Data in memory.\n- Data stored in attached [Local SSD disks](/compute/docs/disks#localssds). However, a machine image captures the device mapping of the Local SSD disks.\n- Attributes that are specific to the source instance, such as the name or IP address.\n\nMachine image storage location\n\nTo meet compliance needs, you might need to control where your\ndata is stored. You can control where your machine image is stored\ngeographically by specifying a `storageLocation` during the creation of your\nmachine image. Machine images can be stored in a\n[Cloud Storage multi-region](/storage/docs/locations#location-mr),\nsuch as `asia` or a\n[Cloud Storage region](/storage/docs/locations#location-r),\nsuch as `asia-south1`.\n\nBy default, when creating a machine image from an instance, the machine image is\nstored in either the Cloud Storage multi-region bucket that contains the\nsource instance, or the geographically closest Cloud Storage multi-region\nbucket to the source instance.\n\nFor example, if your source instance is stored in `us-central1` your machine\nimage is stored in the `us` multi-region by default. However, a default location\nlike `australia-southeast1` is outside of a multi-region. The closest\nmulti-region is `asia`.\n\nRegardless of where the machine image is stored, you can still access the machine\nimage globally by setting the proper permissions.\n\nPricing\n\nThe cost of using a machine image depends on the size of the machine image,\nand the location where it is stored.\n\nTo determine the cost of your machine image, complete the following steps:\n\n1. Use the [`gcloud compute machine-images describe` command](/sdk/gcloud/reference/compute/machine-images/describe)\n to find the storage size in bytes. When an image is created, its storage size\n in bytes is based on the set of blocks that have been written on the source\n disks that are used for the image, regardless of the contents of the blocks.\n\n ```\n gcloud compute machine-images describe MACHINE_IMAGE_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eMACHINE_IMAGE_NAME\u003c/var\u003e\n with the name of the machine image.\n2. Scroll to the end of the output, review the value stored in the\n `totalStorageBytes` field. This value is in bytes, convert this value to\n JEDEC binary gigabytes (GB), or IEC gibibytes (GiB), where 1 GiB is\n 2^30^ bytes.\n\n ```\n .......\n storageLocations:\n - us\n totalStorageBytes: '58688064'\n ```\n3. Use the pricing tables on the\n [Disk pricing](/compute/disks-image-pricing#section-2) page to find the\n cost per GB for your disk type and region.\n\n Alternatively, you can use the\n [Google Cloud Pricing Calculator](/products/calculator) to estimate the\n monthly cost.\n\nWhat's next\n\n- Learn how to [create machine images](/compute/docs/machine-images/create-machine-images)\n- Learn how to [create archive and standard disk snapshots](/compute/docs/disks/create-snapshots)"]]