@@ -922,15 +922,17 @@ func resourceNutanixVirtualMachineRead(d *schema.ResourceData, meta interface{})
922922 b := make ([]string , 0 )
923923
924924 if resp .Status .Resources .BootConfig != nil {
925- if resp .Status .Resources .BootConfig .BootDevice .DiskAddress != nil {
926- i := strconv .Itoa (int (utils .Int64Value (resp .Status .Resources .BootConfig .BootDevice .DiskAddress .DeviceIndex )))
927- diskAddress ["device_index" ] = i
928- diskAddress ["adapter_type" ] = utils .StringValue (resp .Status .Resources .BootConfig .BootDevice .DiskAddress .AdapterType )
925+ if resp .Status .Resources .BootConfig .BootDevice != nil {
926+ if resp .Status .Resources .BootConfig .BootDevice .DiskAddress != nil {
927+ i := strconv .Itoa (int (utils .Int64Value (resp .Status .Resources .BootConfig .BootDevice .DiskAddress .DeviceIndex )))
928+ diskAddress ["device_index" ] = i
929+ diskAddress ["adapter_type" ] = utils .StringValue (resp .Status .Resources .BootConfig .BootDevice .DiskAddress .AdapterType )
930+ }
931+ mac = utils .StringValue (resp .Status .Resources .BootConfig .BootDevice .MacAddress )
929932 }
930933 if resp .Status .Resources .BootConfig .BootDeviceOrderList != nil {
931934 b = utils .StringValueSlice (resp .Status .Resources .BootConfig .BootDeviceOrderList )
932935 }
933- mac = utils .StringValue (resp .Status .Resources .BootConfig .BootDevice .MacAddress )
934936 }
935937
936938 d .Set ("boot_device_order_list" , b )
@@ -1090,7 +1092,7 @@ func resourceNutanixVirtualMachineUpdate(d *schema.ResourceData, meta interface{
10901092 if d .HasChange ("num_vcpus_per_socket" ) {
10911093 o , n := d .GetChange ("num_vcpus_per_socket" )
10921094 res .NumVcpusPerSocket = utils .Int64Ptr (int64 (n .(int )))
1093- if n .(int ) < o .(int ) {
1095+ if n .(int ) < o .(int ) || n .( int ) > o .( int ) {
10941096 hotPlugChange = false
10951097 }
10961098 }
0 commit comments