View the source image of a VM

Linux Windows

You create a virtual machine (VM) instance from either anOSimage or a disk image. This documentshows you how to determine the source OS image or source disk image of a VM.

Before you begin

View the source OS image or source disk image of a VM

To view the source OS image or source disk image of a VM, use theGoogle Cloud console, Google Cloud CLI, or Compute Engine API.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instances.get on the instance

Console

  1. In the Google Cloud console, go to theVM instances page.

    Go to VM instances

  2. Click theName of the VM.

  3. The name of the source OS image or source disk image is inStorage > Bootdisk > Image.

gcloud

  1. View the disks attached to a VM by using the followinggcloud computeinstances describecommand:

    gcloud compute instances describeVM_NAME

    ReplaceVM_NAME with the name of the VM.

  2. View the source OS image or source disk image of the disk by using thefollowinggcloud compute disks describecommand:

    gcloud compute disks describeDISK_NAME \   --zone=ZONE \   --format="get(SOURCE)"

    Replace the following:

    • DISK_NAME: the name of the disk to view thesource of.

    • ZONE: the zone that the disk is located in.

    • SOURCE: a value that specifies whether toreturn the source OS image or the source disk image. Set tosourceDiskor tosourceImage. No value is returned when specifyingsourceDiskorsourceImage unless there is a corresponding source OS image or asource disk image. If no value is returned, specify the other value andrun the command again.

REST

  1. View the disks attached to a VM by using the followinginstances.getmethod:

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME

    Replace the following:

    • PROJECT_ID: the project ID
    • ZONE: the zone containing the VM
    • VM_NAME: the name of the VM
  2. View the source OS image or source disk image of the disk by using thedisks.get method.

    For a VM that has a source OS image, this method returns the source imagethat was used to create the disk in thesourceImage field. For a VMthat has a source disk image, this method instead returns the sourceimage in thesourceDisk field.

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME

    Replace the following:

    • PROJECT_ID: the project ID
    • ZONE: the zone containing the disk
    • DISK_NAME: the name of the disk

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 2026-02-19 UTC.