查看可用的地區和區域


本頁面說明如何查看可用地區和區域清單,以及如何取得有關特定地區的資訊。

如要進一步瞭解地區和區域,請參閱「地區和區域」說明文件。

如要進一步瞭解全球、區域和區域 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

    1. 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.

    2. Set a default region and zone.

    REST

    To use the REST API samples on this page in a local development environment, you use the credentials you provide to the 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.

    For more information, see Authenticate for using REST in the Google Cloud authentication documentation.

必要的角色

如要取得查看可用區域和區域所需的權限,請要求管理員為您授予專案的 Compute Viewer (roles/compute.viewer) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。

您或許還可透過自訂角色或其他預先定義的角色取得必要權限。

查看可用區域清單

主控台

在 Google Cloud 控制台的「Zones」(區域) 頁面中查看區域清單。

前往「Zones」(區域)

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 類型搜尋,請使用 gcloud compute accelerator-types list 指令搭配 --filter 標記,找出可用的區域。

舉例來說,如要找出所有配備 H100 80GB GPU 的區域,請執行下列指令:

gcloud compute accelerator-types list --filter="nvidia-h100-80gb"

輸出內容會傳回可用 GPU 清單,並依區域分類。接著,您可以使用 gcloud compute accelerator-types describe 指令,取得每個傳回的 GPU 型號說明。

依機器類型搜尋

A3、A2 或 G2 加速器最佳化機型會自動將 GPU 連接至 VM。對於這些機器類型,您可以使用 gcloud compute machine-types list 指令搭配 --filter 標記,找出可用的區域。舉例來說,如要找出所有設有 A3 High 機器類型的區域,請執行下列指令:

gcloud compute machine-types list --filter="name=a3-highgpu-8g"

REST

依 GPU 類型搜尋

如要查看特定 GPU 型號的可用區域,請使用 --filter 參數,向 acceleratorTypes.aggregatedList 方法傳送 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 連接至 VM。針對這類機器類型,您可以使用 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 控制台的「Zones」(區域) 頁面中查看地區清單。

前往「Zones」(區域)

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 控制台的「Zones」(區域) 頁面上查看有關地區的資訊。

前往「Zones」(區域)

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

後續步驟