diff --git a/.changelog/6860.txt b/.changelog/6860.txt new file mode 100644 index 0000000000..63c77a1a00 --- /dev/null +++ b/.changelog/6860.txt @@ -0,0 +1,3 @@ +```release-note:bug +compute: fixed a crash with `google_compute_instance_template` on a newly released field when `advanced_machine_features` was set +``` diff --git a/google/resource_compute_instance_template.go b/google/resource_compute_instance_template.go index cf6bf6825e..1f591b075a 100644 --- a/google/resource_compute_instance_template.go +++ b/google/resource_compute_instance_template.go @@ -642,6 +642,12 @@ func resourceComputeInstanceTemplate() *schema.Resource { ForceNew: true, Description: `The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed.`, }, + "visible_core_count": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: `The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance\'s nominal CPU count and the underlying platform\'s SMT width.`, + }, }, }, }, diff --git a/google/resource_compute_instance_template_test.go b/google/resource_compute_instance_template_test.go index 4701da9f15..e8ad7261d6 100644 --- a/google/resource_compute_instance_template_test.go +++ b/google/resource_compute_instance_template_test.go @@ -2507,6 +2507,7 @@ resource "google_compute_instance_template" "foobar" { advanced_machine_features { threads_per_core = 1 enable_nested_virtualization = true + visible_core_count = 1 } scheduling {