From 96a6517c07ae0af090043ce1fb9d486b106ee984 Mon Sep 17 00:00:00 2001 From: Carson Dunbar Date: Tue, 19 Nov 2024 18:34:36 +0000 Subject: [PATCH] Promoting nic type experimental changes to master --- .../modules/_instance_template/README_TF.md | 10 +++++----- .../slurm_cluster/modules/_instance_template/main.tf | 1 + .../modules/_instance_template/variables.tf | 1 + .../modules/_instance_template/versions.tf | 4 ++-- .../modules/slurm_instance_template/README_TF.md | 2 +- .../modules/slurm_instance_template/variables.tf | 1 + 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/terraform/slurm_cluster/modules/_instance_template/README_TF.md b/terraform/slurm_cluster/modules/_instance_template/README_TF.md index 8c90591a..9d969318 100644 --- a/terraform/slurm_cluster/modules/_instance_template/README_TF.md +++ b/terraform/slurm_cluster/modules/_instance_template/README_TF.md @@ -27,13 +27,13 @@ limitations under the License. | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >=0.13.0 | -| [google](#requirement\_google) | >= 3.88 | +| [google](#requirement\_google) | >= 6.13.0 | ## Providers | Name | Version | |------|---------| -| [google](#provider\_google) | >= 3.88 | +| [google](#provider\_google) | >= 6.13.0 | ## Modules @@ -43,8 +43,8 @@ No modules. | Name | Type | |------|------| -| [google_compute_instance_template.tpl](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance_template) | resource | -| [google_project.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/project) | data source | +| [google_compute_instance_template.tpl](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/compute_instance_template) | resource | +| [google_project.this](https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/data-sources/project) | data source | ## Inputs @@ -52,7 +52,7 @@ No modules. |------|-------------|------|---------|:--------:| | [access\_config](#input\_access\_config) | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. |
list(object({
nat_ip = string
network_tier = string
}))
| `[]` | no | | [additional\_disks](#input\_additional\_disks) | List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template#disk_name |
list(object({
disk_name = string
device_name = string
auto_delete = bool
boot = bool
disk_size_gb = number
disk_type = string
disk_labels = map(string)
}))
| `[]` | no | -| [additional\_networks](#input\_additional\_networks) | Additional network interface details for GCE, if any. |
list(object({
network = string
subnetwork = string
subnetwork_project = string
network_ip = string
access_config = list(object({
nat_ip = string
network_tier = string
}))
ipv6_access_config = list(object({
network_tier = string
}))
}))
| `[]` | no | +| [additional\_networks](#input\_additional\_networks) | Additional network interface details for GCE, if any. |
list(object({
network = string
subnetwork = string
subnetwork_project = string
network_ip = string
nic_type = string
access_config = list(object({
nat_ip = string
network_tier = string
}))
ipv6_access_config = list(object({
network_tier = string
}))
}))
| `[]` | no | | [alias\_ip\_range](#input\_alias\_ip\_range) | An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
ip\_cidr\_range: The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. At the time of writing only a netmask (e.g. /24) may be supplied, with a CIDR format resulting in an API error.
subnetwork\_range\_name: The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used. |
object({
ip_cidr_range = string
subnetwork_range_name = string
})
| `null` | no | | [auto\_delete](#input\_auto\_delete) | Whether or not the boot disk should be auto-deleted | `string` | `"true"` | no | | [automatic\_restart](#input\_automatic\_restart) | (Optional) Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). | `bool` | `true` | no | diff --git a/terraform/slurm_cluster/modules/_instance_template/main.tf b/terraform/slurm_cluster/modules/_instance_template/main.tf index 5d7842ba..68daa577 100644 --- a/terraform/slurm_cluster/modules/_instance_template/main.tf +++ b/terraform/slurm_cluster/modules/_instance_template/main.tf @@ -145,6 +145,7 @@ resource "google_compute_instance_template" "tpl" { subnetwork = network_interface.value.subnetwork subnetwork_project = network_interface.value.subnetwork_project network_ip = try(coalesce(network_interface.value.network_ip), null) + nic_type = try(coalesce(network_interface.value.nic_type), null) dynamic "access_config" { for_each = network_interface.value.access_config content { diff --git a/terraform/slurm_cluster/modules/_instance_template/variables.tf b/terraform/slurm_cluster/modules/_instance_template/variables.tf index 128305f7..2ae31e8f 100644 --- a/terraform/slurm_cluster/modules/_instance_template/variables.tf +++ b/terraform/slurm_cluster/modules/_instance_template/variables.tf @@ -223,6 +223,7 @@ variable "additional_networks" { subnetwork = string subnetwork_project = string network_ip = string + nic_type = string access_config = list(object({ nat_ip = string network_tier = string diff --git a/terraform/slurm_cluster/modules/_instance_template/versions.tf b/terraform/slurm_cluster/modules/_instance_template/versions.tf index c0e0f29a..97232e57 100644 --- a/terraform/slurm_cluster/modules/_instance_template/versions.tf +++ b/terraform/slurm_cluster/modules/_instance_template/versions.tf @@ -19,8 +19,8 @@ terraform { required_version = ">=0.13.0" required_providers { google = { - source = "hashicorp/google" - version = ">= 3.88" + source = "hashicorp/google-beta" + version = ">= 6.13.0" } } provider_meta "google" { diff --git a/terraform/slurm_cluster/modules/slurm_instance_template/README_TF.md b/terraform/slurm_cluster/modules/slurm_instance_template/README_TF.md index 9fef06d3..b91fd281 100644 --- a/terraform/slurm_cluster/modules/slurm_instance_template/README_TF.md +++ b/terraform/slurm_cluster/modules/slurm_instance_template/README_TF.md @@ -47,7 +47,7 @@ limitations under the License. |------|-------------|------|---------|:--------:| | [access\_config](#input\_access\_config) | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. |
list(object({
nat_ip = string
network_tier = string
}))
| `[]` | no | | [additional\_disks](#input\_additional\_disks) | List of maps of disks. |
list(object({
disk_name = string
device_name = string
disk_type = string
disk_size_gb = number
disk_labels = map(string)
auto_delete = bool
boot = bool
}))
| `[]` | no | -| [additional\_networks](#input\_additional\_networks) | Additional network interface details for GCE, if any. |
list(object({
network = string
subnetwork = string
subnetwork_project = string
network_ip = string
access_config = list(object({
nat_ip = string
network_tier = string
}))
ipv6_access_config = list(object({
network_tier = string
}))
}))
| `[]` | no | +| [additional\_networks](#input\_additional\_networks) | Additional network interface details for GCE, if any. |
list(object({
network = string
subnetwork = string
subnetwork_project = string
network_ip = string
nic_type = string
access_config = list(object({
nat_ip = string
network_tier = string
}))
ipv6_access_config = list(object({
network_tier = string
}))
}))
| `[]` | no | | [bandwidth\_tier](#input\_bandwidth\_tier) | Tier 1 bandwidth increases the maximum egress bandwidth for VMs.
Using the `virtio_enabled` setting will only enable VirtioNet and will not enable TIER\_1.
Using the `tier_1_enabled` setting will enable both gVNIC and TIER\_1 higher bandwidth networking.
Using the `gvnic_enabled` setting will only enable gVNIC and will not enable TIER\_1.
Note that TIER\_1 only works with specific machine families & shapes and must be using an image that supports gVNIC. See [official docs](https://cloud.google.com/compute/docs/networking/configure-vm-with-high-bandwidth-configuration) for more details. | `string` | `"platform_default"` | no | | [can\_ip\_forward](#input\_can\_ip\_forward) | Enable IP forwarding, for NAT instances for example. | `bool` | `false` | no | | [disable\_smt](#input\_disable\_smt) | Disables Simultaneous Multi-Threading (SMT) on instance. | `bool` | `false` | no | diff --git a/terraform/slurm_cluster/modules/slurm_instance_template/variables.tf b/terraform/slurm_cluster/modules/slurm_instance_template/variables.tf index da1a42ba..2a0cc810 100644 --- a/terraform/slurm_cluster/modules/slurm_instance_template/variables.tf +++ b/terraform/slurm_cluster/modules/slurm_instance_template/variables.tf @@ -129,6 +129,7 @@ variable "additional_networks" { subnetwork = string subnetwork_project = string network_ip = string + nic_type = string access_config = list(object({ nat_ip = string network_tier = string