How do we create a custom image ( deploy by clicked from for the ARM) which has managed disks? The link below discusses using “managed_disk_type” in order to provision managed disks in the azure VM from the azure market place. However I am unclear on how to write the parameters for “storage_os_disk” when using a “custom image”. By custom image is something that can be deployed using azure terraform.
I looked at the this link (
https://www.terraform.io/docs/providers/azurerm/r/virtual_machine.html ) however it is for unmanaged disks when using a image in a blob_uri?? Does the image have to be unmanaged or managed when terraform deploys from it? How do we point to a image in a azure Resource Group? Do we go to the resource group > properties> Resource ID then add the name of the image to the end of this resource ID? ,… image_uri = “/subscriptions/11eb90c3-a6ed-4569-a9d0-2234e3474c96/resourceGroups/TestRG/” ??
Can you please provide a detailed link or steps on this?
storage_os_disk {
name = “OsDisk”
caching = “ReadWrite”
create_option = “FromImage”
managed_disk_type = “Premium_LRS”
disk_size_gb = “150”
blob_uri = “{blob_uri}”
}
########################
I am not understanding “publisherName:offer:skus:version”? Need example in order to understand??
image_uri
- (Optional) Specifies the Image URI in the format publisherName:offer:skus:version
. This field can also specify the VHD uri of a custom VM image to clone. When cloning a Custom (Unmanaged) Disk Image the os_type
field must be set.
##################################
Why would we use unmanaged disks? I was alway told to use Managed disks,… why would we want to use unmanaged disks in an image. thinking as long as we used the create_option and managed_disk_type then the end results would be a VM with managed disks. Please confirm my understanding.
The following properties apply when using Unmanaged Disks:
-
vhd_uri
- (Optional) Specifies the URI of the VHD file backing this Unmanaged Data Disk. Changing this forces a new resource to be created.