简体   繁体   中英

Create an azure VM from an image using availability zones and templates

I am currently deploying some new azure VMs using a template. This template contains a link to a VHD image and uses availability sets.

After having a look at the azure docs, I cannot seem to tell or find out if it's possible to use my current procedure to deploy the VM in a specific zone.

I changed my template to use zones rather than sets but when I use it in Azure CLI I have this error message returned:

"Virtual Machines deployed to an Availability Zone must use managed disks."

I then tried to add the managed disk section to the template without success.

Below there is the pseudocode of the template related to the storage of the VM:

"storageProfile": {
          "osDisk": {
             "managedDisk": {
              "storageAccountType": "StandardSSD_LRS"
            },
            "osType": "Linux",
            "name": "myName.vhd",
            "createOption": "FromImage",    
            "image": {
              "uri": "myUri.vhd"
            },
            "vhd": {
              "uri": "myVhdImageUri.vhd"
            },              
            "caching": "ReadWrite"
          }
        }

You have to convert disk to managed disk first. Then you will be able to use it in your template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM