Get persistent resource information

This page shows you how to get a list of persistent resources and how to get information about a specific persistent resource by using the Vertex AI API or the Google Cloud CLI.

Required roles

To get the permissions that you need to get persistent resource information, ask your administrator to grant you the Vertex AI Viewer (roles/aiplatform.viewer) IAM role on your project. For more information about granting roles, see Manage access.

This predefined role contains the permissions required to get persistent resource information. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to get persistent resource information:

  • aiplatform.persistentResources.get
  • aiplatform.persistentResources.list

You might also be able to get these permissions with custom roles or other predefined roles.

Get a list of persistent resources

Select one of the following tabs for instructions on how to get a list of existing persistent resources.

gcloud

Before using any of the command data below, make the following replacements:

  • PROJECT_ID: The Project ID of the Google Cloud project that you want to get a list persistent resources for.
  • LOCATION: The region where you want to create the persistent resource. For a list of supported regions, see Feature availability.

Execute the following command:

Linux, macOS, or Cloud Shell

gcloud beta ai persistent-resources list \
    --project=PROJECT_ID \
    --region=LOCATION

Windows (PowerShell)

gcloud beta ai persistent-resources list `
    --project=PROJECT_ID `
    --region=LOCATION

Windows (cmd.exe)

gcloud beta ai persistent-resources list ^
    --project=PROJECT_ID ^
    --region=LOCATION

You should receive a response similar to the following:

Response

Using endpoint [https://us-central1-aiplatform.googleapis.com/]
---
createTime: '2023-09-12T20:45:33.220989Z'
displayName: test
name: projects/123456789012/locations/us-central1/persistentResources/test-persistent-resource
resourcePools:
- autoscalingSpec:
    maxReplicaCount: '4'
    minReplicaCount: '1'
  diskSpec:
    bootDiskSizeGb: 100
    bootDiskType: pd-standard
  id: n1-highmem-2-nvidia-tesla-k80-1
  machineSpec:
    acceleratorCount: 1
    acceleratorType: NVIDIA_TESLA_K80
    machineType: n1-highmem-2
  replicaCount: '1'
startTime: '2023-09-12T20:50:36.992739253Z'
state: RUNNING
updateTime: '2023-09-12T20:50:42.813723Z'
---
createTime: '2023-09-12T20:37:21.691977Z'
displayName: my-persistent-resource
name: projects/123456789012/locations/us-central1/persistentResources/my-persistent-resource
resourcePools:
- autoscalingSpec:
    maxReplicaCount: '12'
    minReplicaCount: '4'
  diskSpec:
    bootDiskSizeGb: 200
    bootDiskType: pd-standard
  id: n1-highmem-2-nvidia-tesla-k80-1
  machineSpec:
    acceleratorCount: 1
    acceleratorType: NVIDIA_TESLA_K80
    machineType: n1-highmem-2
  replicaCount: '4'
- diskSpec:
    bootDiskSizeGb: 100
    bootDiskType: pd-ssd
  id: n1-standard-4
  machineSpec:
    machineType: n1-standard-4
  replicaCount: '4'
startTime: '2023-09-12T20:42:46.495575169Z'
state: RUNNING
updateTime: '2023-09-12T20:42:51.519271Z'

REST

Before using any of the request data, make the following replacements:

  • PROJECT_ID: The Project ID of the Google Cloud project that you want to get a list persistent resources for.
  • LOCATION: The region where you want to create the persistent resource. For a list of supported regions, see Feature availability.

HTTP method and URL:

GET https://us-central1-aiplatform.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/persistentResources

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

Get information about a persistent resource

Select one of the following tabs for instructions on how to get information about a persistent resource, including its status, hardware configuration, and available replicas.

gcloud

Before using any of the command data below, make the following replacements:

  • PROJECT_ID: The Project ID of the persistent resource that you want to get information about.
  • LOCATION: The region of the persistent resource that you want to get information about.
  • PERSISTENT_RESOURCE_ID: The ID of the persistent resource that you want to get information about.

Execute the following command:

Linux, macOS, or Cloud Shell

gcloud beta ai persistent-resources describe PERSISTENT_RESOURCE_ID \
    --project=PROJECT_ID \
    --region=LOCATION

Windows (PowerShell)

gcloud beta ai persistent-resources describe PERSISTENT_RESOURCE_ID `
    --project=PROJECT_ID `
    --region=LOCATION

Windows (cmd.exe)

gcloud beta ai persistent-resources describe PERSISTENT_RESOURCE_ID ^
    --project=PROJECT_ID ^
    --region=LOCATION

You should receive a response similar to the following:

Response

Using endpoint [https://us-central1-aiplatform.googleapis.com/]
createTime: '2023-07-06T18:47:42.098296Z'
displayName: Test-Persistent-Resource
name: projects/123456789012/locations/us-central1/persistentResources/my-persistent-resource
resourcePools:
- diskSpec:
    bootDiskSizeGb: 100
    bootDiskType: pd-ssd
  machineSpec:
    machineType: n1-highmem-4
  replicaCount: '4'
- diskSpec:
    bootDiskSizeGb: 100
    bootDiskType: pd-ssd
  machineSpec:
    acceleratorCount: 1
    acceleratorType: NVIDIA_TESLA_P4
    machineType: n1-standard-4
  replicaCount: '4'
  usedReplicaCOunt: '2'
startTime: '2023-07-06T18:51:53.209127117Z'
state: RUNNING
updateTime: '2023-07-06T18:52:01.545109Z'

REST

Before using any of the request data, make the following replacements:

  • PROJECT_ID: The Project ID of the persistent resource that you want to get information about.
  • LOCATION: The region of the persistent resource that you want to get information about.
  • PERSISTENT_RESOURCE_ID: The ID of the persistent resource that you want to get information about.

HTTP method and URL:

GET https://us-central1-aiplatform.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/persistentResources/PERSISTENT_RESOURCE_ID

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

{
  "name": "projects/123456789012/locations/us-central1/persistentResources/test-persistent-resource",
  "displayName": "test",
  "resourcePools": [
    {
      "id": "n1-highmem-2-nvidia-tesla-k80-1",
      "machineSpec": {
        "machineType": "n1-highmem-2",
        "acceleratorType": "NVIDIA_TESLA_K80",
        "acceleratorCount": 1
      },
      "replicaCount": "1",
      "diskSpec": {
        "bootDiskType": "pd-standard",
        "bootDiskSizeGb": 100
      },
      "autoscalingSpec": {
        "minReplicaCount": "1",
        "maxReplicaCount": "4"
      }
    }
  ],
  "state": "RUNNING",
  "createTime": "2023-09-12T20:45:33.220989Z",
  "startTime": "2023-09-12T20:50:36.992739253Z",
  "updateTime": "2023-09-12T20:50:42.813723Z"
}

What's next