本页面介绍如何查看可用区域和可用区的列表以及如何获取有关特定区域的信息。
如需详细了解区域和地区,请参阅区域和地区文档。
如需详细了解全球性、区域性和地区性的 Compute Engine 资源,请参阅全球性、区域性和地区性资源文档。
准备工作
-
如果您尚未设置身份验证,请进行设置。身份验证是通过其进行身份验证以访问 Google Cloud 服务和 API 的过程。如需从本地开发环境运行代码或示例,您可以通过选择以下选项之一向 Compute Engine 进行身份验证:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
-
After installing the Google Cloud CLI, initialize it by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
- Set a default region and zone.
- 详细了解区域和地区
- 了解如何更改默认区域或地区
- 详细了解全球、区域和地区性资源
REST
如需在本地开发环境中使用本页面上的 REST API 示例,请使用您提供给 gcloud CLI 的凭据。
After installing the Google Cloud CLI, initialize it by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
如需了解详情,请参阅 Google Cloud 身份验证文档中的使用 REST 时进行身份验证。
所需的角色
如需获得查看可用区域和可用区所需的权限,请让管理员向您授予项目的 Compute Viewer (
roles/compute.viewer
) IAM 角色。 如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限。查看可用区的列表
控制台
在 Google Cloud 控制台中的“可用区”页面上查看可用区列表。
gcloud
使用 Google Cloud CLI 运行
gcloud compute zones list
命令:gcloud compute zones list
REST
向
zones.list
方法发出GET
请求以获取项目的可用区列表。请将PROJECT_ID
替换为您的 PROJECT_ID。https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones
查看 GPU 可用区列表
如需查看支持 GPU 的可用区列表,您可以使用 gcloud CLI 或 REST。
gcloud
按 GPU 类型搜索
如需按 GPU 类型搜索,请使用带有
--filter
标志的gcloud compute accelerator-types list
命令查找可用的可用区。例如,如需查找具有 H100 80GB GPU 的所有可用区,请运行以下命令:
gcloud compute accelerator-types list --filter="nvidia-h100-80gb"
输出会返回按可用区整理的可用 GPU 列表。然后,您可以使用
gcloud compute accelerator-types describe
命令获取返回的每个 GPU 模型的说明。按机器类型搜索
A3、A2 或 G2 加速器优化机器类型会自动将 GPU 挂接到虚拟机。对于这些机器类型,您可以使用带有
--filter
标志的gcloud compute machine-types list
命令来查找可用的可用区。例如,如需查找具有 A3 High 机器类型的所有可用区,请运行以下命令:gcloud compute machine-types list --filter="name=a3-highgpu-8g"
REST
按 GPU 类型搜索
如需查看特定 GPU 型号可用的可用区,请向
acceleratorTypes.aggregatedList
方法发送包含--filter
参数的GET
请求。例如,如需查找具有 H100 80GB GPU 的所有可用区,请运行以下命令:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/aggregated/acceleratorTypes?filter=name=nvidia-h100-80gb
按机器类型搜索
A3、A2 或 G2 加速器优化机器类型会自动将 GPU 挂接到虚拟机。对于这些机器类型,您可以结合使用
machineTypes.aggregatedList
方法和--filter
参数来查找可用的可用区。例如,如需查找具有 A3 High 机器类型的所有可用区,请运行以下命令:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/aggregated/machineTypes?filter=name=a3-higgpu-8
将
PROJECT_ID
替换为您的项目 ID。输出会返回可用 GPU 的列表以及每个 GPU 模型的说明(按可用区整理)。
查看可用区域的列表
控制台
在 Google Cloud 控制台中的“可用区”页面上查看区域列表。
gcloud
使用 Google Cloud CLI 运行
gcloud compute regions list
命令:gcloud compute regions list
该命令列出所有可用区域,并提供配额和区域自身状态等信息。
例如:
gcloud compute regions list NAME CPUS DISKS_GB ADDRESSES RESERVED_ADDRESSES STATUS asia-east1 0/24 0/10240 0/23 0/7 UP asia-northeast1 0/24 0/10240 0/23 0/7 UP asia-southeast1 0/24 0/10240 0/23 0/7 UP europe-west1 0/24 0/10240 2/23 0/7 UP us-central1 0/24 0/10240 0/23 0/7 UP us-east1 0/24 0/10240 0/23 0/7 UP us-west1 0/24 0/10240 0/23 0/7 UP
REST
向
regions.list
方法发出GET
请求以获取区域列表。请将PROJECT_ID
替换为您的 PROJECT_ID。https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions
查看有关区域的信息
控制台
您可以在 Google Cloud 控制台中的“可用区”页面上查看有关区域的信息。
gcloud
如需获取有关单个区域的信息,请运行
gcloud compute regions describe
命令,其中REGION
是您要获取其详细信息的区域的名称:gcloud compute regions describe REGION
响应将如下所示:
creationTimestamp: '2013-09-06T17:54:12.193-07:00' description: us-central1 id: '5778272079688511892' kind: compute#region name: us-central1 quotas: - limit: 24.0 metric: CPUS usage: 5.0 - limit: 5120.0 metric: DISKS_TOTAL_GB usage: 650.0 - limit: 7.0 metric: STATIC_ADDRESSES usage: 4.0 - limit: 23.0 metric: IN_USE_ADDRESSES usage: 5.0 - limit: 1024.0 metric: SSD_TOTAL_GB usage: 0.0 selfLink: https://www.googleapis.com/compute/v1/projects/PROJECT_ID/regions/us-central1 status: UP zones: - https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/us-central1-a - https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/us-central1-b - https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/us-central1-c - https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/us-central1-f
REST
向
regions.get
方法发出GET
请求以获取区域的相关信息。请将PROJECT_ID
替换为您的 PROJECT_ID,将REGION
替换为您要获取其详细信息的区域。https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-06-24。
-