Skip to content

Commit

Permalink
wip: initialize BootConfig struct before the child attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
marinsalinas committed Apr 4, 2019
1 parent e847ddf commit 44c03e3
Show file tree
Hide file tree
Showing 3 changed files with 1,382 additions and 3 deletions.
4 changes: 3 additions & 1 deletion nutanix/resource_nutanix_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/terraform-providers/terraform-provider-nutanix/client/v3"
v3 "github.com/terraform-providers/terraform-provider-nutanix/client/v3"
"github.com/terraform-providers/terraform-provider-nutanix/utils"

"github.com/hashicorp/terraform/helper/resource"
Expand Down Expand Up @@ -1378,6 +1378,8 @@ func getVMResources(d *schema.ResourceData, vm *v3.VMResources) error {
vm.MemorySizeMib = utils.Int64Ptr(int64(v.(int)))
}

vm.BootConfig = &v3.VMBootConfig{}

if v, ok := d.GetOk("boot_device_order_list"); ok {
vm.BootConfig.BootDeviceOrderList = expandStringList(v.([]interface{}))
}
Expand Down
8 changes: 6 additions & 2 deletions nutanix/resource_nutanix_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ resource "nutanix_virtual_machine" "vm1" {
num_vcpus_per_socket = 1
num_sockets = 1
memory_size_mib = 186
memory_size_mib = 186
boot_device_order_list = ["DISK", "CDROM"]
categories {
Expand Down Expand Up @@ -324,7 +326,9 @@ resource "nutanix_virtual_machine" "vm1" {
cluster_uuid = "${local.cluster1}"
num_vcpus_per_socket = 1
num_sockets = 2
memory_size_mib = 186
memory_size_mib = 186
boot_device_order_list = ["DISK", "CDROM"]
categories {
Environment = "Production"
Expand Down
Loading

0 comments on commit 44c03e3

Please sign in to comment.