建立機密運算執行個體
本文說明如何建立啟用機密運算的 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.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine and Notebooks APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine and Notebooks APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. 前往 Google Cloud 控制台的「Instances」(執行個體) 頁面。
按一下 「建立新標籤」。
在「New instance」對話方塊中,按一下「Advanced options」。
在「建立執行個體」對話方塊的「機器類型」部分,選取 N2D 機器類型。僅支援 N2D 機器類型。
在「機密 VM 服務」下方,選取「啟用機密運算」。
在「Enable Confidential Computing」(啟用機密運算) 對話方塊中,按一下「Enable」(啟用)。
點選「建立」。
Vertex AI Workbench 會建立執行個體並自動啟動。執行個體可供使用時,Vertex AI Workbench 會啟用「Open JupyterLab」(開啟 JupyterLab) 連結。
-
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」(執行個體) 頁面。
在「執行個體名稱」欄中,按一下要檢查的執行個體名稱。
「執行個體詳細資料」頁面隨即開啟。
在「VM details」(VM 詳細資料) 旁,按一下「View in Compute Engine」(在 Compute Engine 中查看)。
在 Compute Engine 詳細資料頁面中,「機密 VM 服務」的值會顯示
Enabled或Disabled。僅支援 N2D 機器類型。請參閱 N2D 機器類型。
僅支援 AMD SEV 機密運算技術。詳情請參閱「AMD SEV」。
建立 Vertex AI Workbench 執行個體後,就無法啟用或停用機密運算。
Vertex AI Workbench 執行個體用量。請參閱「Vertex AI 定價」。
機密運算用量。請參閱機密 VM 定價。
- 如要使用筆記本,協助您開始使用 Vertex AI 和其他 Google Cloud 服務,請參閱 Vertex AI 筆記本教學課程。
- 如要檢查 Vertex AI Workbench 執行個體的健康狀態,請參閱「監控健康狀態」。
必要的角色
如要取得建立 Vertex AI Workbench 執行個體所需的權限,請要求管理員授予您專案的「Notebooks Runner」 (roles/notebooks.runner) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
建立執行個體
您可以使用 Google Cloud 控制台、gcloud CLI 或 REST API 建立啟用機密運算的執行個體:
控制台
如要建立啟用機密運算的 Vertex AI Workbench 執行個體,請按照下列步驟操作:
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」(開啟 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」(開啟 JupyterLab) 連結。
確認執行個體是否已啟用機密運算功能
如要確認 Vertex AI Workbench 執行個體是否已啟用機密運算功能,請按照下列步驟操作:
限制
建立或使用啟用機密運算的 Vertex AI Workbench 執行個體時,適用下列限制:
帳單
使用具備機密運算的 Vertex AI Workbench 執行個體時,您必須支付下列項目的費用: