From d7eb3c96360e1f3658f8eda5368ad43d97ddfecc Mon Sep 17 00:00:00 2001 From: cdunbar13 <139253655+cdunbar13@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:49:36 -0500 Subject: [PATCH] Promoting nic type experimental changes to master (#233) --- .../slurm_cluster/modules/_instance_template/README_TF.md | 6 +++--- terraform/slurm_cluster/modules/_instance_template/main.tf | 1 + .../slurm_cluster/modules/_instance_template/variables.tf | 1 + .../slurm_cluster/modules/_instance_template/versions.tf | 2 +- .../modules/slurm_instance_template/README_TF.md | 2 +- .../modules/slurm_instance_template/variables.tf | 1 + 6 files changed, 8 insertions(+), 5 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..10d76d12 100644 --- a/terraform/slurm_cluster/modules/_instance_template/README_TF.md +++ b/terraform/slurm_cluster/modules/_instance_template/README_TF.md @@ -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..ff80c799 100644 --- a/terraform/slurm_cluster/modules/_instance_template/versions.tf +++ b/terraform/slurm_cluster/modules/_instance_template/versions.tf @@ -19,7 +19,7 @@ terraform { required_version = ">=0.13.0" required_providers { google = { - source = "hashicorp/google" + source = "hashicorp/google-beta" version = ">= 3.88" } } 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