You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Every Compute Engine VM boots from an image that contains the operating system, pre-installed software, and configuration. Google Cloud provides a catalogue of public images maintained by Google and third-party vendors, and you can create your own custom images for standardised, repeatable deployments.
Public images are maintained by Google and trusted publishers. They are grouped into image families, where each family has a latest recommended version.
| Image Family | Project | Description |
|---|---|---|
| debian-12 | debian-cloud | Debian 12 (Bookworm) |
| ubuntu-2404-lts-amd64 | ubuntu-os-cloud | Ubuntu 24.04 LTS |
| rhel-9 | rhel-cloud | Red Hat Enterprise Linux 9 |
| rocky-linux-9 | rocky-linux-cloud | Rocky Linux 9 |
| sles-15 | suse-cloud | SUSE Linux Enterprise Server 15 |
| windows-2022 | windows-cloud | Windows Server 2022 |
| cos-113-lts | cos-cloud | Container-Optimized OS |
| sql-std-2022-win-2022 | windows-sql-cloud | Windows + SQL Server 2022 Standard |
# List all public images
gcloud compute images list
# List images in a specific project
gcloud compute images list --project=debian-cloud
# List image families
gcloud compute images list --project=ubuntu-os-cloud --filter="family:ubuntu-2404"
When you specify an image family (rather than a specific image), Compute Engine automatically uses the latest non-deprecated image in that family:
gcloud compute instances create web-server \
--zone=europe-west2-a \
--machine-type=e2-standard-2 \
--image-family=debian-12 \
--image-project=debian-cloud
This ensures new VMs always get the latest security patches without changing your scripts or templates.
Custom images are images you create from an existing disk, snapshot, another image, or an imported file. They let you standardise your VM configuration — pre-install software, apply security hardening, configure monitoring agents — so every new VM starts in a known-good state.
# Stop the source VM to ensure data consistency
gcloud compute instances stop source-vm --zone=europe-west2-a
# Create an image from the VM's boot disk
gcloud compute images create my-app-image-v1 \
--source-disk=source-vm \
--source-disk-zone=europe-west2-a \
--family=my-app \
--description="My App base image with Nginx, monitoring agent, and security hardening"
gcloud compute images create my-app-image-v2 \
--source-snapshot=my-disk-snapshot \
--family=my-app
You can import images from on-premises environments or other clouds:
gcloud compute images import my-imported-image \
--source-file=gs://my-bucket/my-image.vmdk \
--os=ubuntu-2204
Supported formats include VMDK, VHD, RAW, and qcow2.
Image families provide a pointer to the latest version of your custom image. When you create a new image in a family, it automatically becomes the latest:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.