尝试创建 Vertex AI 托管笔记本失败并出现错误:无法插入 GCE VM

问题描述 投票:0回答:2

我正在尝试在 GCP 中创建许多顶点 AI 托管笔记本(注意,不是用户管理的笔记本,而是托管笔记本)。每个都失败并出现相同的错误:

2023-07-10T02:36:05.3813609Z e[31m│e[0m e[0me[1me[31mError: e[0me[0me[1mError waiting to create Runtime: Error waiting for Creating Runtime: Error code 3, message: operation “projects//locations/australia-southeast1/operations/create-d73db12f-8b7e-48eb-af84-7aadae580bd1” completed with error: %!w(*status.Status=&{{{}   } 3 Http(400) Bad Request; [ExecuteComputeApi] failed.; [VM][:vm-d73db12f-8b7e-48eb-af84-7aadae580bd1] ; Failed to insert a GCE VM   131})e[0m

2023-07-10T02:36:05.3814103Z e[31m│e[0m e[0m

2023-07-10T02:36:05.3814380Z e[31m│e[0m e[0me[0m with module.user2notebook.google_notebooks_runtime.runtime,

2023-07-10T02:36:05.3814746Z e[31m│e[0m e[0m on notebook_module/notebook_module.tf line 16, in resource “google_notebooks_runtime” “runtime”:

2023-07-10T02:36:05.3815095Z e[31m│e[0m e[0m 16: resource “google_notebooks_runtime” “runtime” e[4m{e[0me[0m

2023-07-10T02:36:05.3815319Z e[31m│e[0m e[0m
  • 我已经排除了权限,因为我们已经提升了服务帐户 用于管理部署一直到所有者 项目。

  • 所有必需的 API 都在 GCP 项目中运行,我们可以 通过 Vertex AI 中的控制台 UI 手动创建托管笔记本 没有问题(相同的设置)。

  • 我已经排除了与共享网络和子网的问题 该项目来自共享 VPC 项目(同样,因为手册 创作效果很好)。

Google 支持人员表示这是 Terraform 问题,所以我很遗憾。

这是我创建的用于支撑每个笔记本的模块:

variable “user_name” {
description = “Name of the user”
type = string
}

variable “user_email” {
description = “Email of the user”
type = string
}

variable “machine_type” {
description = “Machine type for the notebook instance”
type = string
}

resource “google_notebooks_runtime” “runtime” {
name = “${lower(replace(replace(var.user_email, “@”, “-”), “.”, “-”))}-notebook-instance”
location = “australia-southeast1”
access_config {
access_type = “SINGLE_USER”
runtime_owner = var.user_email
}
virtual_machine {
virtual_machine_config {
machine_type = var.machine_type
internal_ip_only = true
network = var.NETWORK
subnet = var.SUBNET
data_disk {
initialize_params {
disk_size_gb = “100”
disk_type = “PD_STANDARD”
}
}

  metadata = {
    app    = "inventory-mlops"
    bu     = var.BU
    owner  = var.OWNER
    costcentre = var.COSTCENTRE
    email  = var.user_email
  }
  labels = {
    app    = "inventory-mlops"
    bu     = var.BU
    owner  = var.OWNER
    costcentre = var.COSTCENTRE
    email  = var.user_email
  }
}
}
timeouts {
create = “30m”
delete = “30m”
}
}

并从 main.tf 调用它

module "user21notebook" {
  source = "./notebook_module"
  
  user_name = "James Matson"
  user_email = "[email protected]"
  machine_type = "n1-standard-1"
}

在我看来,根据此参考文献(我可以在网上找到的唯一可靠的 Vertex AI 托管笔记本)正确设置

https://github.com/terraform-google-modules/terraform-docs-samples/blob/main/vertex_ai/management_notebooks_runtime/main.tf

google-cloud-platform terraform terraform-provider-gcp google-cloud-vertex-ai
2个回答
2
投票

不管你信不信,这个问题是通过完全删除标签和元数据块来解决的,正如我所知 - 尽管 Hashicorp 中的文档将它们列为有效块 - 托管笔记本不支持它们。删除,重新运行,部署良好。


0
投票

我一开始就尝试过并遇到了上述相同的问题。然而,我似乎在代码中的 lebel 的 Lables 字段中使用了错误的值,一旦我修复了它,它就会像魅力一样运行。

你可以尝试类似的事情

labels = {
  owner = "aman"
}

为了方便大家,以下是一些有效的标签值示例:

字母数字字符: 键1:值123 环境:生产

连字符和下划线: 应用程序版本:v1-2-3 实例名称:我的实例

小写字母: 团队:工程 项目:我的项目

我希望这些指南对您有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.