|
|
|
|
@ -118,6 +118,11 @@ func resourceArmVirtualMachine() *schema.Resource {
|
|
|
|
|
Required: true,
|
|
|
|
|
Elem: &schema.Resource{
|
|
|
|
|
Schema: map[string]*schema.Schema{
|
|
|
|
|
"os_type": &schema.Schema{
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
Optional: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"name": &schema.Schema{
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
Required: true,
|
|
|
|
|
@ -128,6 +133,11 @@ func resourceArmVirtualMachine() *schema.Resource {
|
|
|
|
|
Required: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"image_uri": &schema.Schema{
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
Optional: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"caching": &schema.Schema{
|
|
|
|
|
Type: schema.TypeString,
|
|
|
|
|
Optional: true,
|
|
|
|
|
@ -1082,6 +1092,7 @@ func expandAzureRmVirtualMachineOsDisk(d *schema.ResourceData) (*compute.OSDisk,
|
|
|
|
|
|
|
|
|
|
name := disk["name"].(string)
|
|
|
|
|
vhdURI := disk["vhd_uri"].(string)
|
|
|
|
|
imageURI := disk["image_uri"].(string)
|
|
|
|
|
createOption := disk["create_option"].(string)
|
|
|
|
|
|
|
|
|
|
osDisk := &compute.OSDisk{
|
|
|
|
|
@ -1092,6 +1103,22 @@ func expandAzureRmVirtualMachineOsDisk(d *schema.ResourceData) (*compute.OSDisk,
|
|
|
|
|
CreateOption: compute.DiskCreateOptionTypes(createOption),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if v := disk["image_uri"].(string); v != "" {
|
|
|
|
|
osDisk.Image = &compute.VirtualHardDisk{
|
|
|
|
|
URI: &imageURI,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if v := disk["os_type"].(string); v != "" {
|
|
|
|
|
if v == "linux" {
|
|
|
|
|
osDisk.OsType = compute.Linux
|
|
|
|
|
} else if v == "windows" {
|
|
|
|
|
osDisk.OsType = compute.Windows
|
|
|
|
|
} else {
|
|
|
|
|
return nil, fmt.Errorf("[ERROR] os_type must be 'linux' or 'windows'")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if v := disk["caching"].(string); v != "" {
|
|
|
|
|
osDisk.Caching = compute.CachingTypes(v)
|
|
|
|
|
}
|
|
|
|
|
|