已加入队列的资源用户指南

加入队列的资源使您能够以排队的方式请求 Cloud TPU 资源。 当您对已加入队列的资源发出请求时,系统会将该请求添加到由 Cloud TPU 服务。当请求的资源可用时 分配给您的 Google Cloud 项目,供您立即独占使用。它将保持不变 (除非您将其删除或被抢占)。仅限 TPU Spot 虚拟机和抢占式 TPU 符合抢占条件。

您可以指定可选的 start and end time - 在队列中 资源请求。开始时间用于指定最早要填完的时段 请求。如果指定的结束时间仍未填充请求,则 请求过期。请求过期后,仍会保留在队列中。

加入队列的资源请求可处于以下状态之一:

WAITING_FOR_RESOURCES
该请求已通过初始验证并已添加到队列中。 它会一直保持这种状态,直到有足够的可用资源开始 预配请求或分配间隔 。当需求较高时,并非所有请求都能立即 配置。如果您需要更可靠的 TPU 可用性,请考虑 以及购买预订的方式 <ph type="x-smartling-placeholder">
PROVISIONING
已从队列中选择请求,并且目前正在分配其资源。
ACTIVE
请求已分配。当已排队的资源请求出现在 ACTIVE 状态,您可以按照 管理 TPU
FAILED
无法完成请求,因为 请求的资源在分配间隔内不可用。 请求将保留在队列中,直到被明确删除。
SUSPENDING
目前正在删除与该请求关联的资源。
SUSPENDED
请求中指定的资源已被删除。收到请求后 处于SUSPENDED状态,因此无法再 分配。

前提条件

在运行本指南中的命令之前,请确保:

请求按需加入队列的资源

您可以使用 gcloud compute tpus queued-resources create 命令请求按需加入队列的资源。如需详细了解 请参阅配额类型

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project \
--zone us-central2-b \
--accelerator-type v4-8 \
--runtime-version tpu-vm-tf-2.17.0-pjrt

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-8',
      'runtime_version': 'tpu-vm-tf-2.17.0-pjrt',
    }
  }
}
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-id
已加入队列的资源请求的 ID,由用户指定。
node-id
由用户指定的 TPU ID,在加入队列时创建 分配的资源请求数量
project
您的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本

按需排队的资源的默认切片大小

使用按需配额时,您申请的切片大小必须小于 适用于您使用的加速器类型的默认上限。超出 默认限额。

下表显示了 TPU 类型及其关联的 默认限额。

加速器类型 默认限制(以 TensorCore 数量为单位)
v2 128
v3 128
v4 384
v5 32

如果您需要更大的切片大小,请联系 Cloud TPU 获取更多信息。

使用预留请求已加入队列的资源

您可以通过指定 在 gcloud 命令中使用 --reserved 标志,或在guaranteed.reserved=true curl 请求。如需进行预订,请与您的 Google Cloud 客户支持团队联系。

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project \
--zone us-central2-b \
--accelerator-type v4-8 \
--runtime-version tpu-vm-tf-2.17.0-pjrt \
--reserved

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-8',
      'runtime_version': 'tpu-vm-tf-2.17.0-pjrt',
    }
  }
},
'guaranteed': {
  'reserved': true,
}
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-id
已加入队列的资源请求的 ID,由用户指定。
node-id
由用户指定的 TPU ID,在加入队列时创建 分配的资源请求数量
project
您的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
reserved
在请求作为 Cloud TPU 一部分的排队资源时,请使用此标志 预留。

请求 TPU Spot 虚拟机已加入队列的资源

Spot 虚拟机是可以被抢占的资源 并随时分配给其他工作负载Spot 虚拟机资源 而且与公有云平台相比 非 Spot 虚拟机请求。详细了解 TPU Spot 虚拟机,请参阅管理 TPU Spot 虚拟机

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project-id \
--zone us-central2-b \
--accelerator-type v4-8 \
--runtime-version tpu-vm-tf-2.17.0-pjrt \
--spot

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-8',
      'runtime_version': 'tpu-vm-tf-2.17.0-pjrt'
    }
  }
},
'spot': {}
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
node-id
为响应请求而创建的 TPU 的用户定义的 ID。
project
向其分配已加入队列的资源的项目的 ID。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
spot
一个布尔标志,用于指定已加入队列的资源是 Spot 虚拟机。

请求在指定时间之前或之后分配已加入队列的资源

您可以视需要指定开始时间结束时间 timestart 时长结束 时长。通过 start time 或 startDuration 指定填充 请求。如果未在指定的结束时间之前或在 指定持续时间,请求就会过期。请求过期后 保留在队列中,但不再符合分配条件。

您还可以通过指定分配间隔来 指定开始时间或时长以及结束时间或时长。

请参阅 Datetime, 支持的时间戳和时长格式列表。

在指定时长后请求已加入队列的资源

您可以使用 --valid-after-duration 标志。以下示例请求 系统就会在 6 个小时后分配

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project-id \
--zone us-central2-b \
--accelerator-type v4-32 \
--runtime-version tpu-vm-tf-2.17.0-pod-pjrt \
--valid-after-duration 6h

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-32',
      'runtime_version': 'tpu-vm-tf-2.17.0-pod-pjrt',
    }
  }
},
'queueing_policy': {
  'valid_after_duration': {
    'seconds': 21600
  }
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
node-id
为响应请求而创建的 TPU 的用户定义的 ID。
project
分配已加入队列的资源的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
valid-after-duration
表示 TPU 是在哪个时长之前不得预配的。如需详细了解时长格式,请参阅 Google Cloud CLI 主题日期时间

请求在指定时长后到期的已加入队列的资源

您可以使用 --valid-until-duration 标志。以下示例请求一个 v4-32, 则会在六小时内过期。

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project-id \
--zone us-central2-b \
--accelerator-type v4-32 \
--runtime-version tpu-vm-tf-2.17.0-pod-pjrt \
--valid-until-duration 6h

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-32',
      'runtime_version': 'tpu-vm-tf-2.17.0-pod-pjrt',
    }
  }
},
'queueing_policy': {
  'valid_until_duration': {
    'seconds': 21600
  }
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
node-id
为响应请求而创建的 TPU 的用户定义的 ID。
project
分配已加入队列的资源的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
valid-until-duration
请求有效的时长。如需详细了解时长格式,请参阅 Google Cloud CLI 主题日期时间

在指定时间后请求已加入队列的资源

您可以使用 --valid-after-time 标志。

以下命令会请求具有 运行时版本 tpu-vm-tf-2.17.0-pjrt 在 2022 年 12 月 14 日上午 9 点之后分配。

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project-id \
--zone us-central2-b \
--accelerator-type v4-4096 \
--runtime-version tpu-vm-tf-2.17.0-pod-pjrt \
--valid-after-time 2022-12-14T09:00:00Z

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-4096',
      'runtime_version': 'tpu-vm-tf-2.17.0-pod-pjrt',
    }
  }
},
'queueing_policy': {
  'valid_after_time': {
    'seconds': 2022-12-14T09:00:00Z
  }
}
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
node-id
为响应请求而创建的 TPU 的用户定义的 ID。
project
分配已加入队列的资源的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
valid-after-time
资源分配时间,超过此时间后,如需详细了解时长格式,请参阅 Google Cloud CLI 主题日期时间

在指定时间之前请求加入队列的资源

您可以使用 --valid-until-time 标志。

以下命令会请求具有 运行时版本 tpu-vm-tf-2.10.0-pod 不晚于 2022 年 12 月 14 日上午 9:00 创建。

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project-id \
--zone us-central2-b \
--accelerator-type v4-4096 \
--runtime-version tpu-vm-tf-2.17.0-pod-pjrt \
--valid-until-time 2022-12-14T09:00:00Z

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-4096',
      'runtime_version': 'tpu-vm-tf-2.17.0-pod-pjrt',
    }
  }
},
'queueing_policy': {
  'valid_until_time': {
    'seconds': 1655197200
  }
}
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
node-id
为响应请求而创建的 TPU 的用户定义的 ID。
project
向其分配已加入队列的资源的项目的 ID。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
valid-until-time
请求被取消的时间。如需详细了解时长格式,请参阅 Google Cloud CLI 主题日期时间

请求在指定时间间隔内分配已加入队列的资源

您可以使用 --valid-after-time--valid-after-duration--valid-until-duration--valid-until-time 标志, 提供的一个标志用于指定分配间隔的起始时间, other 用于指定分配间隔的结束时间。

以下命令在 5 小时 30 分钟内从 创建时间不晚于 2022 年 12 月 14 日上午 9:00。

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project-id \
--zone us-central2-b \
--accelerator-type v4-32 \
--runtime-version tpu-vm-tf-2.17.0-pod-pjrt \
--valid-after-duration 5h30m \
--valid-until-time 2022-12-14T09:00:00Z

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-32',
      'runtime_version': 'tpu-vm-tf-2.17.0-pod-pjrt',
    }
  }
},
'queueing_policy': {
  'validInterval': {
    'startTime': '2022-12-10T14:30:00Z',
    'endTime': '2022-12-14T09:00:00Z'
  }
},
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令标志说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
node-id
为响应请求而创建的 TPU 的用户定义的 ID。
project
向其分配已加入队列的资源的项目的 ID。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
valid-until-timw
请求被取消的时间。如需详细了解时长格式,请参阅 Google Cloud CLI 主题日期时间
valid-until-duration
请求有效的时长。如需详细了解时长格式,请参阅 Google Cloud CLI 主题日期时间

使用启动脚本请求已加入队列的资源

您可以指定在某个脚本运行后,对已加入队列的资源运行的脚本 配置。使用 gcloud 命令时,您可以使用 --metadata--metadata-from-file 标志,用于指定脚本命令或 分别是脚本代码。使用 curl 时,必须包含脚本 代码。以下示例将创建已加入队列的资源 请求,该请求将运行 startup-script.sh 中包含的脚本。curl 示例显示了 JSON 正文中的内嵌脚本。

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project \
--zone us-central2-b \
--accelerator-type v4-8 \
--runtime-version tpu-vm-tf-2.12.0 \
--reserved \
--metadata-from-file='startup-script=startup-script.sh'

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
tpu: {
    node_spec: {
      parent: 'projects/your-project-number/locations/us-central2-b',
      node_id: 'your-node-id',
      node: {
          accelerator_type: 'v2-8',
          runtime_version: 'tpu-vm-tf-2.17.0-pjrt',
          metadata: {
              "startup-script": "#! /bin/bash\npwd > /tmp/out.txt\nwhoami >> /tmp/out.txt"
          }
      }
    }
},
'queueing_policy': {
  'validInterval': {
    'startTime': '2022-12-10T14:30:00Z',
    'endTime': '2022-12-14T09:00:00Z'
  }
},
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令标志说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
node-id
为响应请求而创建的 TPU 的用户定义的 ID。
project
向其分配已加入队列的资源的项目的 ID。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
validInterval
表示请求有效的时间,在此时间过后,请求将 已取消。有关时长格式的详情,请参见 Google Cloud CLI 主题日期时间
metadata-from-file
指定包含元数据的文件。如果您没有指定完整 元数据文件的限定路径,则该命令假定它位于 当前目录中。在本示例中,该文件包含一个启动脚本 在已排队的资源预配完成后运行。
metadata
指定请求的元数据。在此示例中,元数据为 在预配排队的资源时运行启动脚本命令。

使用指定的网络和子网请求已加入队列的资源

您可以请求已加入队列的资源, 您要将 TPU 连接到哪个节点。

gcloud

gcloud alpha compute tpus queued-resources create your-queued-resource-id \
--node-id your-node-id \
--project your-project \
--zone us-central2-b \
--accelerator-type v4-8 \
--runtime-version tpu-vm-tf-2.17.0-pjrt \
--network network-name \
--subnetwork subnetwork-name

curl

curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d "{
'tpu': {
  'node_spec': {
    'parent': 'projects/your-project-number/locations/us-central2-b',
    'node_id': 'your-node-id',
    'node': {
      'accelerator_type': 'v4-8',
      'runtime_version': 'tpu-vm-tf-2.17.0-pjrt',
       'network_config': {
        'network': 'network-name',
        'subnetwork': 'subnetwork-name',
        'enable_external_ips': true
    }
  }
},
'guaranteed': {
  'reserved': true,
}
}" \
https://tpu.googleapis.com/v2alpha1/projects/your-project-id/locations/us-central2-b/queuedResources?queued_resource_id=your-queued-resource-id

命令参数说明

queued-resource-id
已加入队列的资源请求的 ID,由用户指定。
node-id
由用户指定的 TPU ID,在加入队列时创建 分配的资源请求数量
project
您的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区
accelerator-type
加速器类型指定要创建的 Cloud TPU 的版本和大小。 如需详细了解每个 TPU 版本支持的加速器类型,请参阅 TPU 版本
runtime-version
Cloud TPU 软件的版本
reserved
在请求作为 Cloud TPU 一部分的排队资源时,请使用此标志 预留。
network
已加入队列的资源所属的网络。
subnetwork
已加入队列的资源所属的子网。

删除已加入队列的资源请求

您可以删除已加入队列的资源请求以及该请求创建的 TPU 虚拟机 方法是将 --force 标志传递给 queued-resource delete 命令。否则 您必须先删除 TPU 虚拟机,然后才能删除排队的资源请求。当您 删除 TPU 虚拟机,排队的资源请求将转换为 SUSPENDED 状态,之后队列中的资源请求可能会 已删除。

以下命令将删除名为 “my-queued-resource”在“my-project”中项目位于可用区“us-central2-b”中。它 使用 --force 标志删除 TPU 虚拟机和已加入队列的资源 请求。

gcloud

gcloud compute tpus queued-resources delete my-queued-resource \
--project my-project \
--zone us-central2-b \
--force \
--async

curl

curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://tpu.googleapis.com/v2/projects/my-project/locations/us-central2-b/queuedResources/my-queued-resource?force=true

命令标志说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
project
分配已加入队列的资源的 Google Cloud 项目。
zone
要删除的 Cloud TPU 的区域
force
删除 TPU 虚拟机和已排队的资源请求。

以下命令将删除名为“my-queued-resource”且已加入队列的资源请求 在“my-project”中项目位于可用区“us-central2-b”中。

gcloud

gcloud compute tpus queued-resources delete your-queued-resource-id \
--project your-project-id \
--zone us-central2-b

curl

curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://tpu.googleapis.com/v2/projects/your-project-id/locations/us-central2-b/queuedResources/your-queued-resource-id

命令标志说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
project
分配已加入队列的资源的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区

检索已排队的资源请求的状态和诊断信息

检索已排队的资源请求的状态和诊断信息:

gcloud

gcloud compute tpus queued-resources describe queued-resource-request-id \
--project your-project-id \
--zone us-central2-b

curl

curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://tpu.googleapis.com/v2/projects/your-project-id/locations/us-central2-b/queuedResources/your-queued-resource-id

命令标志说明

queued-resource-request-id
已加入队列的资源请求的 ID,由用户指定。
project
向其分配已加入队列的资源的项目的 ID。
zone
拟在其中创建 Cloud TPU 的可用区

如果请求失败,响应中将包含错误信息。对于请求 正在等待资源的请求,则输出将类似于以下内容:

name: projects/your-project-id/locations/us-central2-b/queuedResources/your-queued-resource-id
state:
  state: WAITING_FOR_RESOURCES
tpu:
  nodeSpec:
  - node:
      acceleratorType: v4-8
      bootDisk: {}
      networkConfig:
        enableExternalIps: true
      queuedResource: projects/your-project-number/locations/us-central2-b/queuedResources/your-queued-resource-id
      runtimeVersion: tpu-vm-tf-2.10.0
      schedulingConfig: {}
      serviceAccount: {}
      shieldedInstanceConfig: {}
      useTpuVm: true
    nodeId: your-node-id
    parent: projects/your-project-number/locations/us-central2-b

列出项目中已加入队列的资源请求

以下命令用于列出项目“your-project-id”中已加入队列的资源请求:

gcloud

gcloud compute tpus queued-resources list --project your-project-id \
--zone us-central2-b

curl

curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://tpu.googleapis.com/v2/projects/your-project-id/locations/us-central2-b/queuedResources

命令标志说明

project
分配已加入队列的资源的 Google Cloud 项目。
zone
拟在其中创建 Cloud TPU 的可用区