View VM OS images for Batch

This page describes how to view the operating system (OS) images available for the virtual machine (VM) instances that run Batch jobs.

Specifically, this page describes how to view a list and details of VM OS images from Batch. To learn more about VM OS images and which VM OS images you can use with Batch, see VM OS environment overview. If you want to view other VM OS images, such as public images from Compute Engine or custom images, see the Compute Engine images documentation instead.

Before you begin

  1. If you haven't used Batch before, review Get started with Batch and enable Batch by completing the prerequisites for projects and users.

View a list of VM OS images from Batch

You can view a list of all the VM OS images from Batch using the gcloud CLI or Batch API.

gcloud

To list all supported VM OS images from Batch, use the following gcloud compute images list command:

gcloud compute images list \
    --project=batch-custom-image \
    --no-standard-images
  • The --project=batch-custom-image flag is required to list images from Batch.
  • The --no-standard-images flag omits the standard images from Compute Engine.
  • Optional: if you need to see deprecated Batch images, also include the --show-deprecated flag.

The output for each VM OS image is similar to the following:

NAME: IMAGE_NAME
PROJECT: IMAGE_PROJECT_ID
FAMILY: IMAGE_FAMILY
...

This output includes the following values:

  • IMAGE_NAME: the name of the image. An image name represents a specific version of a VM OS image. For example, the image name batch-debian-11-official-20230802-00-p00 represents image version -20230802-00-p00 (the version from August 2, 2023) for the image family batch-debian-11-official.
  • IMAGE_PROJECT_ID: the project ID of the project that contains the image. For example, all images from Batch images are in the batch-custom-image project.
  • IMAGE_FAMILY: the family of the image. An image family includes one or more specific images and represents the type and major version of the OS. For example, the batch-debian-11-official image family contains Batch images based on OS version 11 of Debian from Compute Engine.

API

To list all supported VM OS images from Batch, make the following request to the images.list method:

GET https://compute.googleapis.com/compute/v1/projects/batch-custom-image/global/images?filter=(-deprecated%3A*)%20OR%20(deprecated.state%3D%22ACTIVE%22)
  • The batch-custom-image project is required to list images from Batch.
  • The ?filter=(-deprecated%3A*)%20OR%20(deprecated.state%3D%22ACTIVE%22) query parameter omits deprecated images by using URL-encoding to set the filter field to (-deprecated:*) OR (deprecated.state="ACTIVE").
    • Optional: if you need to see deprecated Batch images, remove the ?filter=(-deprecated%3A*)%20OR%20(deprecated.state%20%3D%20%22ACTIVE%22) query parameter.

The output for each VM OS image is similar to the following:

{
  ...
  "name": "IMAGE_NAME",
  ...
  "family": "IMAGE_FAMILY",
  "selfLink": "https://www.googleapis.com/compute/v1/projects/IMAGE_PROJECT_ID/global/images/IMAGE_NAME",
  ...
}

This output includes the following values:

  • IMAGE_NAME: the name of the image. An image name represents a specific version of a VM OS image. For example, the image name batch-debian-11-official-20230802-00-p00 represents image version -20230802-00-p00 (the version from August 2, 2023) for the image family batch-debian-11-official.
  • IMAGE_PROJECT_ID: the project ID of the project that contains the image. For example, all images from Batch images are in the batch-custom-image project.
  • IMAGE_FAMILY: the family of the image. An image family includes one or more specific images and represents the type and major version of the OS. For example, the batch-debian-11-official image family contains Batch images based on OS version 11 of Debian from Compute Engine.

View details of a VM OS image from Batch

You can view all the details of a VM OS image using the gcloud CLI or Batch API.

gcloud

To view the details of a VM OS image from Batch, use the gcloud compute images describe command and specify batch-custom-image as the image project:

gcloud compute images describe IMAGE_NAME --project=batch-custom-image

Replace IMAGE_NAME with the name of the VM OS image from Batch that you want to describe.

API

To view the details of a VM OS image from Batch, make a request to the images.get method and specify batch-custom-image as the image project:

GET https://compute.googleapis.com/compute/v1/projects/batch-custom-image/global/images/IMAGE_NAME

Replace IMAGE_NAME with the name of the VM OS image from Batch that you want to describe.

What's next