terraform-google-modules/terraform-google-vm

Allow instance placement policies to be attached to a VM

wkharold opened this issue · 1 comments

TL;DR

An instance placement policies allows GCP users to control where VM instances are physically located relative to each other within a zone. Two placement policies are available, spread, and compact. The latter, compact, is particularly important for HPC workloads where minimizing inter-VM communication latencies is critical.

This feature will allow users to specify a placement policy to be attached to a VM instance

Terraform Resources

Resource policies are specified by the Terraform Resource: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_resource_policy

The [google_compute_instance](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance) resource supports specification of `resource_policies` (a max of 1 resource policy is currently supported). It's attributes are supported by the [google_compute_instance_from_template](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance_from_template) resource.

Detailed design

Add a new `resource_policies` variable. It should be a list of strings. Those strings represent either resource policy short names or self_links of resource policies to attach the the instance. Since only one resource policy per instance is currently supported by the provider, the length of the list will be checked and an error raised if it is > 1.

Additional information

No response

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days