Merge branch 'ckarlsen84-master'
This commit is contained in:
commit
c3c1d7366a
|
@ -197,9 +197,9 @@ func resourceArmVirtualMachine() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_size_gb": {
|
"disk_size_gb": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Optional: true,
|
||||||
ValidateFunc: validateDiskSizeGB,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"lun": {
|
"lun": {
|
||||||
|
@ -849,7 +849,9 @@ func flattenAzureRmVirtualMachineDataDisk(disks *[]compute.DataDisk) interface{}
|
||||||
l["name"] = *disk.Name
|
l["name"] = *disk.Name
|
||||||
l["vhd_uri"] = *disk.Vhd.URI
|
l["vhd_uri"] = *disk.Vhd.URI
|
||||||
l["create_option"] = disk.CreateOption
|
l["create_option"] = disk.CreateOption
|
||||||
l["disk_size_gb"] = *disk.DiskSizeGB
|
if disk.DiskSizeGB != nil {
|
||||||
|
l["disk_size_gb"] = *disk.DiskSizeGB
|
||||||
|
}
|
||||||
l["lun"] = *disk.Lun
|
l["lun"] = *disk.Lun
|
||||||
|
|
||||||
result[i] = l
|
result[i] = l
|
||||||
|
@ -1170,7 +1172,6 @@ func expandAzureRmVirtualMachineDataDisk(d *schema.ResourceData) ([]compute.Data
|
||||||
vhd := config["vhd_uri"].(string)
|
vhd := config["vhd_uri"].(string)
|
||||||
createOption := config["create_option"].(string)
|
createOption := config["create_option"].(string)
|
||||||
lun := int32(config["lun"].(int))
|
lun := int32(config["lun"].(int))
|
||||||
disk_size := int32(config["disk_size_gb"].(int))
|
|
||||||
|
|
||||||
data_disk := compute.DataDisk{
|
data_disk := compute.DataDisk{
|
||||||
Name: &name,
|
Name: &name,
|
||||||
|
@ -1178,10 +1179,14 @@ func expandAzureRmVirtualMachineDataDisk(d *schema.ResourceData) ([]compute.Data
|
||||||
URI: &vhd,
|
URI: &vhd,
|
||||||
},
|
},
|
||||||
Lun: &lun,
|
Lun: &lun,
|
||||||
DiskSizeGB: &disk_size,
|
|
||||||
CreateOption: compute.DiskCreateOptionTypes(createOption),
|
CreateOption: compute.DiskCreateOptionTypes(createOption),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v := config["disk_size_gb"]; v != nil {
|
||||||
|
diskSize := int32(config["disk_size_gb"].(int))
|
||||||
|
data_disk.DiskSizeGB = &diskSize
|
||||||
|
}
|
||||||
|
|
||||||
data_disks = append(data_disks, data_disk)
|
data_disks = append(data_disks, data_disk)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue