This document defines the reference architecture for importing, preparing, and
registering custom enterprise Linux operating system images (Red Hat Enterprise
Linux 8.10 and 9.6, Ubuntu 24.04 LTS, Oracle Linux, SUSE Linux Enterprise
Server, and Debian) as reusable VirtualMachineImage resources in a
Google Distributed Cloud (GDC) air-gapped tenant project. By establishing a shared OS image
component, downstream application and infrastructure guides consume a verified
VirtualMachineImage contract
(components/custom-linux-os-images/<variant>/env.d/linux-vm-images.sh) instead
of duplicating raw disk upload and VirtualMachineImageImport procedures.
The following diagram illustrates the offline OS image customization, object
storage staging, VirtualMachineImageImport custom resource translation modes,
and deployed Linux guest VM architecture:

Assumptions and limitations
- This architecture requires GDC air-gapped 1.16.2-hf1
(
1.16.2-gdch.1353-1) or later and VM Manager enabled in the target zone. - GDC air-gapped 1.16.2 ships
ubuntu-2004,ubuntu-2204,ubuntu-2404, androcky-linux-8as out-of-the-box system VM images in thevm-systemnamespace. Enterprise workloads that require RHEL 8.10 or 9.6, hardened DISA STIG images, pre-baked package baselines (such as PostgreSQL 17 from PGDG), or vendor virtual appliances must import a customqcow2disk into the tenant project namespace. gdcloud compute images importdefaults toprepareImage: true, which boots a temporary preparation pod to install GDC guest agents and requires organization package repository access (http://pkg.org.internal). In disconnected zones without an in-enclave RHEL mirror, or when importing Ubuntu 24.04 images with pre-baked packages not carried bypkg.org.internal, custom images must be pre-configured offline withcloud-init,chrony, administrative credentials (and optionallyqemu-guest-agentorgdc-guest-agent) before upload and imported usingVirtualMachineImageImport(virtualmachine.gdc.goog/v1) withprepareImage: false. Standard Ubuntumainpackages (such asnfs-kernel-server) can also be installed at runtime frompkg.org.internalwhen the mirror is available and enabled.- RHEL 9 import rejection and
garden-linuxtranslation bypass: GDC air-gapped admission webhooks in releases 1.16 and 1.17 rejectoperatingSystem: rhel-9at import. Don't label an Enterprise Linux 9 (EL9) disk asrhel-8. Labeling an EL9 disk asrhel-8runs the platform RHEL 8 preparation job, which installs Enterprise Linux 8 (EL8) packages from the organization package mirror into the EL9 disk; the import fails where the mirror is unavailable and otherwise leaves a mismatched OS. Instead, import RHEL 9 images withoperatingSystem: garden-linux(manual mode) until native RHEL 9 support is available. Because the platform treats Garden Linux as an immutable system, this label acts as a manual mode switch that bypasses automated guest agent injection and package installation. cloud-initand platform startup scripts: Linux platformstartupScriptsrun only whencloud-initis installed and configured withdatasource_list: [NoCloud, None]in a file under/etc/cloud/cloud.cfg.d/. Platform startup scripts run on every boot, so write all startup scripts idempotently.- Guest agent support on unsupported distributions: Installing the
gdc-guest-agentRPM on distributions not natively supported by the platform (including RHEL 9) is best effort: in lab testing, the 1.16 RPM synchronized on RHEL 9.6 but failed to synchronize on RHEL 9.8. Plan user and SSH key provisioning throughcloud-init. VirtualMachineExternalAccessguidance: In release 1.16.2,VirtualMachineExternalAccess(VMEA) is no longer the preferred option, and configuring VMEA in the GDC console is deprecated (create an External Load Balancer for ingress and a Cloud NAT gateway for egress instead, or configure VMEA using the VMM API or gdcloud CLI). Protect administrative access with aProjectNetworkPolicycustom resource scoped strictly to the administrator or jump host CIDR block, and never0.0.0.0/0, enforcing key-only SSH.
Architecture
This section describes the offline customization pipeline, image import path, golden image generalization steps, and virtual disk sizing profiles.
Image staging and import pipeline
The custom Linux image pipeline operates entirely within the tenant project boundary on the management API server:
- Start from a vendor Kernel-based Virtual Machine (KVM) guest image:
Prefer vendor KVM guest images (such as
rhel-9.6-x86_64-kvm.qcow2orrhel-8.10-x86_64-kvm.qcow2) over ISO or Kickstart builds. These images already includevirtiodrivers,cloud-init, and serial console configuration. - Source file hygiene: Decompress
.gzor.xzarchives, flatten backing chains withqemu-img convert -O qcow2, and setminimumDiskSizein binary units (Gi) at least as large as the virtual disk size (at least 20% larger is recommended). Upload each import attempt under a unique object name because reusing an object name already consumed by an earlier import stalled the import in testing. - Offline customization and Security-Enhanced Linux (SELinux) relabeling:
When customizing an image offline (by using
virt-customizeorqemu-nbdchroot) to configure Network Time Protocol (NTP) time servers (/etc/chrony.conf),cloud-initdata source settings, or temporary credentials, runvirt-customize --selinux-relabelor create/.autorelabelon the image so files modified from chroot get correct SELinux labels on enforcing distributions. - Object storage scratch bucket (
vm-images-bucket): GDC VM Manager reads source disk objects from a project-scopedBucketcustom resource namedvm-images-bucket. Theproject-vm-image-adminrole gives read and write access tovm-images-bucket, and binding a bucket-access role (such asproject-bucket-object-adminorproject-vm-image-admin) triggers the object storage controller to provision your S3 credentials in theobject-storage-access-keysnamespace after aBucketcustom resource exists in the project. - Declarative Import and API Alternative (
VirtualMachineImageImport): Thegdcloud compute images importCLI doesn't exposeprepareImage. With the declarative Kubernetes Resource Model (KRM) API, create aVirtualMachineImageImportwithprepareImage: false(operatingSystem: garden-linuxfor RHEL 9 oroperatingSystem: ubuntu-2404for Ubuntu 24.04 LTS) to stream theqcow2object fromvm-images-bucketinto a persistentVirtualMachineImageresource (rhel-9-6-custom,rhel-8-10-custom, orubuntu-2404-custom). - Golden Image Capture Pipeline and Generalization: To capture a reusable
golden image from a prepared boot disk, use
VirtualMachineImageImportwithspec.source.diskRef.namereferencing the boot disk of a cleanly stopped preparation VM. Before shutdown, generalize the VM: remove personal accounts, temporary SSH keys, and the temporary root password, runcloud-init clean --logs --seed, empty/etc/machine-id, and delete/etc/ssh/ssh_host_*. Otherwise, every child VM created from the image shares the same machine ID, host keys, and access credentials. - Isolated Environment Contract
(
components/custom-linux-os-images/<variant>/env.d/linux-vm-images.sh): Once theVirtualMachineImageImportcustom resource reportsReady=Trueand creates theVirtualMachineImage, the selected reference implementation writes${HOME}/gdcag-solutions/components/custom-linux-os-images/rhel/env.d/linux-vm-images.sh(exportingGDCS_RHEL9_IMAGE_NAMEandGDCS_RHEL8_IMAGE_NAME) or${HOME}/gdcag-solutions/components/custom-linux-os-images/ubuntu/env.d/linux-vm-images.sh(exportingGDCS_UBUNTU2404_IMAGE_NAME) inside its own component directory.
Sizing and storage footprint
| Image Profile | Source Format | Virtual Size | Recommended minimumDiskSize |
Target operatingSystem Label |
Exported Contract Variable |
|---|---|---|---|---|---|
| RHEL 9.6 KVM Guest Image | qcow2 |
10 GiB | 20Gi |
garden-linux |
GDCS_RHEL9_IMAGE_NAME="rhel-9-6-custom" |
| RHEL 8.10 KVM Guest Image | qcow2 |
10 GiB | 20Gi |
rhel-8 |
GDCS_RHEL8_IMAGE_NAME="rhel-8-10-custom" |
| Ubuntu 24.04 LTS Cloud Image | qcow2 |
3.5 GiB to 6.5 GiB | 20Gi |
ubuntu-2404 |
GDCS_UBUNTU2404_IMAGE_NAME="ubuntu-2404-custom" |
| Vendor Appliance Image | qcow2 |
40 GiB to 250 GiB | Virtual size + 20% | ubuntu-2204, ubuntu-2404, or rhel-8 |
Workload-specific GDCS_*_IMAGE_NAME |
Security and identity boundaries
- Principle of least privilege: Importing custom VM images requires only
project-scoped roles (
project-vm-image-adminandproject-bucket-object-admin) on the management API server. No organization-wide privileges are required. - Post-import object cleanup: After the
VirtualMachineImageImportcustom resource reachesReady=Trueand creates theVirtualMachineImage, the rawqcow2object invm-images-bucketis no longer referenced and can be removed to reclaim object storage capacity. - Network firewall and administrative access: Initial administrative
access is available through the GDC serial console
or through a
ProjectNetworkPolicy(PNP) custom resource admitting port 22. In release 1.16.2,VirtualMachineExternalAccessis no longer the preferred option, and configuring it in the GDC console is deprecated. Scope theProjectNetworkPolicyingress rule strictly to the administrator or jump host CIDR range, never0.0.0.0/0, enforce key-only SSH, and remove the port 22 rule after the VM is configured.
What's next
For implementation steps and related VM documentation, see the following resources: