Merge branch 'ckarlsen84-master'

This commit is contained in:
stack72 2016-12-05 15:07:07 +00:00
commit c3c1d7366a
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16
1 changed files with 11 additions and 6 deletions

View File

@ -198,8 +198,8 @@ func resourceArmVirtualMachine() *schema.Resource {
"disk_size_gb": {
Type: schema.TypeInt,
Required: true,
ValidateFunc: validateDiskSizeGB,
Optional: true,
Computed: true,
},
"lun": {
@ -849,7 +849,9 @@ func flattenAzureRmVirtualMachineDataDisk(disks *[]compute.DataDisk) interface{}
l["name"] = *disk.Name
l["vhd_uri"] = *disk.Vhd.URI
l["create_option"] = disk.CreateOption
if disk.DiskSizeGB != nil {
l["disk_size_gb"] = *disk.DiskSizeGB
}
l["lun"] = *disk.Lun
result[i] = l
@ -1170,7 +1172,6 @@ func expandAzureRmVirtualMachineDataDisk(d *schema.ResourceData) ([]compute.Data
vhd := config["vhd_uri"].(string)
createOption := config["create_option"].(string)
lun := int32(config["lun"].(int))
disk_size := int32(config["disk_size_gb"].(int))
data_disk := compute.DataDisk{
Name: &name,
@ -1178,10 +1179,14 @@ func expandAzureRmVirtualMachineDataDisk(d *schema.ResourceData) ([]compute.Data
URI: &vhd,
},
Lun: &lun,
DiskSizeGB: &disk_size,
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)
}