Google cloud platform 在GCP中使用Terraform在唯一租户节点上创建计算实例
我需要帮助在使用Terraform的唯一租户节点上创建google compute实例。我能够在多租户节点上创建计算实例GCE,但找不到有关如何使用Terraform在唯一租户节点中创建实例的信息。您可以通过“node_type”参数创建唯一租户节点GCE实例 根据这个Terraform文档,它描述了这样的示例用法Google cloud platform 在GCP中使用Terraform在唯一租户节点上创建计算实例,google-cloud-platform,google-compute-engine,terraform-provider-gcp,Google Cloud Platform,Google Compute Engine,Terraform Provider Gcp,我需要帮助在使用Terraform的唯一租户节点上创建google compute实例。我能够在多租户节点上创建计算实例GCE,但找不到有关如何使用Terraform在唯一租户节点中创建实例的信息。您可以通过“node_type”参数创建唯一租户节点GCE实例 根据这个Terraform文档,它描述了这样的示例用法 resource "google_compute_node_template" "template" { provider
resource "google_compute_node_template" "template" {
provider = google-beta
name = "soletenant-with-licenses"
region = "us-central1"
node_type = "n1-node-96-624" # here is sole-tenant node type argument
}
这是Google文档中唯一的tenent节点类型列表
您可以通过节点类型参数值(如“m1-node-96-1433”、“n1-node-96-624”等)指定所需的唯一租户节点类型。我不确定您是否达到了相同的目标,但下面是实现方法。您将需要google_compute_实例资源中的节点关联参数
resource "google_compute_node_template" "template" {
...
scheduling {
automatic_restart = "true"
node_affinities {
key = "compute.googleapis.com/node-group-name"
operator = "IN"
values = ["${var.solenodegroup}"] #Replace it with the Sole Tenant Group Name.
}
on_host_maintenance = "MIGRATE"
preemptible = false
}
}
注意-您需要将计算机类型设置为与唯一租户组计算机类型匹配。您好,谢谢您的回复,实际上我已经使用相同的代码创建了唯一租户节点。但是我正在寻找TF代码,以便在唯一租户节点上创建计算实例(唯一租户上的GCE)您可以通过创建普通GCE实例方法在唯一租户节点上创建GCE实例。但您需要指定“node_config”参数。此处的示例代码:另外,请参阅本文档以在唯一租户节点上配置VM。