重新啟動永久性資源

您可以重新啟動處於 RUNNINGERROR 狀態的任何持續性資源。 重新啟動永久資源可解決永久資源無法自行解決的錯誤。您也可以重新啟動持續性資源,手動取得最新叢集。本頁面說明如何使用 Google Cloud 控制台和 REST API 重新啟動持續性資源。

必要的角色

如要取得重新啟動永久資源所需的權限,請要求管理員授予您專案的 Vertex AI 管理員 (roles/aiplatform.admin) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。

這個預先定義的角色具備 aiplatform.persistentResources.update 權限,這是重新啟動永久資源的必要權限。

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

重新啟動永久資源

選取下列任一分頁標籤,即可查看如何重新啟動持續性資源。確認永久資源上沒有執行中的訓練工作。

控制台

如要在 Google Cloud 控制台中重新啟動持續性資源,請按照下列步驟操作:

  1. 前往 Google Cloud 控制台的「Persistent resources」(永久資源) 頁面。

    前往「永久資源」

  2. 找出要重新啟動的持續性資源,然後按一下名稱旁邊的垂直橢圓 ()。

  3. 按一下「重新啟動」

  4. 按一下「確認」

gcloud

使用下方的任何指令資料之前,請先替換以下項目:

  • PROJECT_ID:您要重新啟動的持續性資源專案 ID。
  • LOCATION:要重新啟動的永久資源所在區域。
  • PERSISTENT_RESOURCE_ID:您要重新啟動的永久資源 ID。

執行下列指令:

Linux、macOS 或 Cloud Shell

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

Windows (PowerShell)

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

Windows (cmd.exe)

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

您應該會收到類似以下的回應:

Using endpoint [https://us-central1-aiplatform.googleapis.com/]
Request to reboot the PersistentResource [projects/sample-project/locations/us-central1/persistentResources/test-persistent-resource] has been sent.

You may view the status of your persistent resource with the command

  $ gcloud ai persistent-resources describe projects/sample-project/locations/us-central1/persistentResources/test-persistent-resource

REST

使用任何要求資料之前,請先替換以下項目:

  • PROJECT_ID:您要重新啟動的持續性資源專案 ID。
  • LOCATION:要重新啟動的永久資源所在區域。
  • PERSISTENT_RESOURCE_ID:您要重新啟動的永久資源 ID。

HTTP 方法和網址:

POST https://us-central1-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/persistentResources/PERSISTENT_RESOURCE_ID:reboot

如要傳送要求,請展開以下其中一個選項:

您應該會收到如下的 JSON 回應:

response: 
  {
    "name": "projects/123456789012/locations/us-central1/persistentResources/test-persistent-resource/operations/1234567890123456789",
    "metadata": {
      "@type": "type.googleapis.com/google.cloud.aiplatform.v1.RebootPersistentResourceOperationMetadata",
      "genericMetadata": {
        "createTime": "2024-03-18T17:31:54.955004Z",
        "updateTime": "2024-03-18T17:31:55.204817Z",
        "state": "RUNNING",
        "worksOn": [
          "projects/123456789012/locations/us-central1/persistentResources/test-persistent-resource"
        ]
      },
      "progressMessage": "Waiting for persistent resource shut down."
    }
  }

重新啟動永久資源是長時間執行的作業,在作業期間無法刪除永久資源。如果發生錯誤,作業會包含 progressMessage 欄位,並填入錯誤狀態。作業顯示 "done: true" 後,請檢查持續性資源的狀態。如果持續性資源處於 RUNNING 狀態,表示重新啟動成功,可以執行訓練作業。

限制

重新啟動永久資源時,會受到下列限制:

  • 在某些情況下,重新啟動持續性資源時,可能會失去稀少資源的容量。我們無法保證完整保留資源。
  • Ray on Vertex AI 不支援重新啟動。
  • 如果永久資源包含自動調度的工作站集區,系統會以最少的副本數重新啟動。

後續步驟