Associate Cloud Engineer ยท Operating VMs and developer environments
Custom images vs snapshots
Creating an image from a VM disk or snapshot, image families, sharing across projects, deprecating and deleting images, images vs snapshots.
Key points
- A custom image is a reusable boot template made from a disk, snapshot, or another image, used to create many new VMs.
- A snapshot is mainly a backup of one disk.
- Group image versions in an image family so the newest non-deprecated one is used by default.
- Share images by granting the Compute Image User role; retire them with gcloud compute images deprecate.
Source: https://docs.cloud.google.com/compute/docs/images/create-custom
Practice questions
What is the main purpose of an image family?
- Resolve to the newest non-deprecated image in the group
- Replicate an image to every region
- Encrypt images with a shared key
- Limit an image to one project
Show answer
Answer: A. Resolve to the newest non-deprecated image in the group
A family points to the latest non-deprecated image in it, so templates can reference the family instead of a specific version. It does not replicate images across regions or encrypt them.
Which sources can you create a custom image from?
- A persistent disk
- A snapshot
- The RAM contents of a running VM
- A VPC firewall policy
- A Cloud Logging sink
Show answer
Answer: A. A persistent disk, B. A snapshot
Images can be built from a disk, a snapshot, or another image. A running VM's memory and a Cloud Storage bucket of logs are not image sources in this sense.
True or false: deprecating an image deletes it immediately.
Show answer
Answer: False
False. Deprecation only marks a lifecycle state such as DEPRECATED; deletion is a separate step.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
