diff --git a/examples/main.tf b/examples/main.tf index 57df92995..59de83973 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -195,6 +195,9 @@ resource "nutanix_virtual_machine" "demo-01-web" { num_sockets = 1 memory_size_mib = 4096 + #enable vcpu hard pinning (optional) + #is_vcpu_hard_pinned = true + # What cluster will this VLAN live on? cluster_uuid = local.cluster1 diff --git a/nutanix/data_source_nutanix_virtual_machine_test.go b/nutanix/data_source_nutanix_virtual_machine_test.go index d1954b343..7f487939f 100644 --- a/nutanix/data_source_nutanix_virtual_machine_test.go +++ b/nutanix/data_source_nutanix_virtual_machine_test.go @@ -21,6 +21,8 @@ func TestAccNutanixVirtualMachineDataSource_basic(t *testing.T) { "data.nutanix_virtual_machine.nutanix_virtual_machine", "num_vcpus_per_socket", "1"), resource.TestCheckResourceAttr( "data.nutanix_virtual_machine.nutanix_virtual_machine", "num_sockets", "1"), + resource.TestCheckResourceAttr( + "data.nutanix_virtual_machine.nutanix_virtual_machine", "is_vcpu_hard_pinned", "true"), ), }, }, @@ -127,6 +129,7 @@ resource "nutanix_virtual_machine" "vm1" { num_vcpus_per_socket = 1 num_sockets = 1 memory_size_mib = 186 + is_vcpu_hard_pinned = true } data "nutanix_virtual_machine" "nutanix_virtual_machine" { diff --git a/nutanix/resource_nutanix_virtual_machine_test.go b/nutanix/resource_nutanix_virtual_machine_test.go index 901ab4aba..a6db89155 100644 --- a/nutanix/resource_nutanix_virtual_machine_test.go +++ b/nutanix/resource_nutanix_virtual_machine_test.go @@ -156,6 +156,7 @@ func TestAccNutanixVirtualMachine_updateFields(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "memory_size_mib", "186"), resource.TestCheckResourceAttr(resourceName, "num_sockets", "1"), resource.TestCheckResourceAttr(resourceName, "num_vcpus_per_socket", "1"), + resource.TestCheckResourceAttr(resourceName, "is_vcpu_hard_pinned", "true"), resource.TestCheckResourceAttr(resourceName, "categories.#", "1"), ), }, @@ -169,6 +170,7 @@ func TestAccNutanixVirtualMachine_updateFields(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "memory_size_mib", "256"), resource.TestCheckResourceAttr(resourceName, "num_sockets", "2"), resource.TestCheckResourceAttr(resourceName, "num_vcpus_per_socket", "2"), + resource.TestCheckResourceAttr(resourceName, "is_vcpu_hard_pinned", "false"), resource.TestCheckResourceAttr(resourceName, "categories.#", "1"), ), }, @@ -737,6 +739,7 @@ func testAccNutanixVMConfigUpdatedFields(r int) string { num_vcpus_per_socket = 1 num_sockets = 1 memory_size_mib = 186 + is_vcpu_hard_pinned = true categories { @@ -764,6 +767,7 @@ func testAccNutanixVMConfigUpdatedFieldsUpdated(r int) string { num_vcpus_per_socket = 2 num_sockets = 2 memory_size_mib = 256 + is_vcpu_hard_pinned = false categories { name = "Environment"