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

Modify tests and example to use is_vcpu_hard_pinned for nutanix_virtual_machine #338

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
3 changes: 3 additions & 0 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions nutanix/data_source_nutanix_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
},
},
Expand Down Expand Up @@ -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" {
Expand Down
4 changes: 4 additions & 0 deletions nutanix/resource_nutanix_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
},
Expand All @@ -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"),
),
},
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"
Expand Down