使用機密運算建立執行個體
本文說明如何建立啟用機密運算功能的 Vertex AI Workbench 執行個體。
總覽
機密運算可透過硬體式受信任的執行環境 (TEE) 保護使用中的資料。TEE 是安全且隔離的環境,可防止應用程式和資料在使用期間遭到未經授權的存取或修改。這項安全標準是由機密運算聯盟定義。
建立啟用機密運算的 Vertex AI Workbench 執行個體時,新的 Vertex AI Workbench 執行個體就是機密 VM 執行個體。如要進一步瞭解機密 VM 執行個體,請參閱機密 VM 簡介。
事前準備
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine and Notebooks APIs.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine and Notebooks APIs.
-
INSTANCE_NAME
:Vertex AI Workbench 執行個體的名稱;開頭須為英文字母,後面最多可接 62 個小寫英文字母、數字或連字號 (-),但結尾不得為連字號 PROJECT_ID
:您的專案 IDLOCATION
:您要將執行個體放置的位置-
MACHINE_TYPE
:執行個體 VM 的機器類型,例如:n2d-standard-2
PROJECT_ID
:您的專案 IDLOCATION
:您希望執行個體所在的區域-
MACHINE_TYPE
:執行個體 VM 的機器類型,例如:n2d-standard-2
前往 Google Cloud 控制台的「Instances」(執行個體) 頁面。
在「Instance name」(執行個體名稱) 欄中,按一下要檢查的執行個體名稱。
「Instance details」(執行個體詳細資料) 頁面隨即開啟。
在「VM 詳細資料」旁,點選「在 Compute Engine 中查看」。
在 Compute Engine 詳細資料頁面上,機密 VM 服務的值會顯示
Enabled
或Disabled
。僅支援 N2D 機器類型。請參閱「N2D 機器類型」。
建立 Vertex AI Workbench 執行個體後,您無法啟用或關閉機密運算。
- 如要使用筆記本開始使用 Vertex AI 和其他 Google Cloud 服務,請參閱 Vertex AI 筆記本教學課程。
- 如要查看 Vertex AI Workbench 執行個體的健康狀態,請參閱「監控健康狀態」。
必要的角色
如要取得建立 Vertex AI Workbench 執行個體所需的權限,請要求管理員為您授予專案的 Notebooks Runner (roles/notebooks.runner
) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。
建立執行個體
您可以使用 gcloud CLI 或 REST API,建立啟用機密運算的執行個體:
gcloud
如要建立啟用機密運算的 Vertex AI Workbench 執行個體,請使用 gcloud workbench
instances create
指令,並將 --confidential-compute-type
設為 SEV
。
使用下列任何指令資料之前,請先替換以下項目:
執行下列指令:
Linux、macOS 或 Cloud Shell
gcloud workbench instances create INSTANCE_NAME \ --project=PROJECT_ID \ --location=LOCATION \ --machine-type=MACHINE_TYPE \ --confidential-compute-type=SEV
Windows (PowerShell)
gcloud workbench instances create INSTANCE_NAME ` --project=PROJECT_ID ` --location=LOCATION ` --machine-type=MACHINE_TYPE ` --confidential-compute-type=SEV
Windows (cmd.exe)
gcloud workbench instances create INSTANCE_NAME ^ --project=PROJECT_ID ^ --location=LOCATION ^ --machine-type=MACHINE_TYPE ^ --confidential-compute-type=SEV
Vertex AI Workbench 會建立執行個體並自動啟動。執行個體可供使用時,Vertex AI Workbench 會在 Google Cloud 控制台中啟用「Open JupyterLab」連結。
REST
如要建立啟用機密運算的 Vertex AI Workbench 執行個體,請使用 projects.locations.instances.create
方法,並在 GceSetup
中加入 confidentialInstanceConfig
。
使用任何要求資料之前,請先替換以下項目:
HTTP 方法和網址:
POST https://notebooks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/instances
JSON 要求主體:
{ "gce_setup": { "machine_type": "MACHINE_TYPE", "confidentialInstanceConfig": { "confidentialInstanceType": SEV } } }
如要傳送要求,請選擇以下其中一個選項:
curl
將要求主體儲存在名為 request.json
的檔案中,然後執行下列指令:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://notebooks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/instances"
PowerShell
將要求主體儲存在名為 request.json
的檔案中,然後執行下列指令:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://notebooks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/instances" | Select-Object -Expand Content
Vertex AI Workbench 會建立執行個體並自動啟動。執行個體可供使用時,Vertex AI Workbench 會在 Google Cloud 控制台中啟用「Open JupyterLab」連結。
確認執行個體是否已啟用機密運算功能
如要確認 Vertex AI Workbench 執行個體是否已啟用機密運算功能,請按照下列步驟操作:
限制
建立或使用啟用機密運算功能的 Vertex AI Workbench 執行個體時,會受到下列限制:
帳單
雖然這項功能仍處於前測階段,但使用含有機密運算功能的 Vertex AI Workbench 執行個體,與使用不含機密運算功能的執行個體收費相同。請參閱定價。