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 Oct 20, 2020
1 parent 4e0a469 commit df0472e
Show file tree
Hide file tree
Showing 3 changed files with 1,379 additions and 1 deletion.
2 changes: 2 additions & 0 deletions nutanix/resource_nutanix_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,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
5 changes: 4 additions & 1 deletion nutanix/resource_nutanix_virtual_machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ func testAccNutanixVMConfig(r int) string {
resource "nutanix_virtual_machine" "vm1" {
name = "test-dou-%d"
cluster_uuid = "${local.cluster1}"
boot_device_order_list = ["DISK", "CDROM"]
num_vcpus_per_socket = 1
num_sockets = 1
memory_size_mib = 186
Expand Down Expand Up @@ -611,6 +612,8 @@ func testAccNutanixVMConfigUpdate(r int) string {
num_sockets = 2
memory_size_mib = 186
boot_device_order_list = ["DISK", "CDROM"]
categories {
name = "Environment"
value = "Production"
Expand Down
Loading

0 comments on commit df0472e

Please sign in to comment.