Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address permadiff in vm-instance module #542

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/compute/vm-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ No modules.
| <a name="input_disk_size_gb"></a> [disk\_size\_gb](#input\_disk\_size\_gb) | Size of disk for instances. | `number` | `200` | no |
| <a name="input_disk_type"></a> [disk\_type](#input\_disk\_type) | Disk type for instances. | `string` | `"pd-standard"` | no |
| <a name="input_enable_oslogin"></a> [enable\_oslogin](#input\_enable\_oslogin) | Enable or Disable OS Login with "ENABLE" or "DISABLE". Set to "INHERIT" to inherit project OS Login setting. | `string` | `"ENABLE"` | no |
| <a name="input_guest_accelerator"></a> [guest\_accelerator](#input\_guest\_accelerator) | List of the type and count of accelerator cards attached to the instance. | <pre>list(object({<br> type = string,<br> count = number<br> }))</pre> | `[]` | no |
| <a name="input_guest_accelerator"></a> [guest\_accelerator](#input\_guest\_accelerator) | List of the type and count of accelerator cards attached to the instance. | <pre>list(object({<br> type = string,<br> count = number<br> }))</pre> | `null` | no |
| <a name="input_instance_count"></a> [instance\_count](#input\_instance\_count) | Number of instances | `number` | `1` | no |
| <a name="input_instance_image"></a> [instance\_image](#input\_instance\_image) | Instance Image | <pre>object({<br> family = string,<br> project = string<br> })</pre> | <pre>{<br> "family": "hpc-centos-7",<br> "project": "cloud-hpc-image-public"<br>}</pre> | no |
| <a name="input_labels"></a> [labels](#input\_labels) | Labels to add to the instances. List key, value pairs. | `any` | n/a | yes |
Expand Down
2 changes: 1 addition & 1 deletion modules/compute/vm-instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ locals {
# compact_placement : true when placement policy is provided and collocation set; false if unset
compact_placement = try(var.placement_policy.collocation, null) != null

gpu_attached = contains(["a2"], local.machine_family) || length(var.guest_accelerator) > 0
gpu_attached = contains(["a2"], local.machine_family) || var.guest_accelerator != null

# both of these must be false if either compact placement or preemptible/spot instances are used
# automatic restart is tolerant of GPUs while on host maintenance is not
Expand Down
2 changes: 1 addition & 1 deletion modules/compute/vm-instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ variable "guest_accelerator" {
type = string,
count = number
}))
default = []
default = null
}

variable "on_host_maintenance" {
Expand Down