title: VMSizeDoesntSupportPremiumStorage Azure Creating VM From VHD
body: <p>I'm using this template to create an Azure VM from an existing disk. </p>
  
  <p>I'm using the EXACT same VM size "Standard_D11_v2" that the existing disk was created on, however I keep receiving the error listed below.</p>
  
  <p>Any help would be GREATLY appreciated, I can't seem to get past this and I'm confused why I could originally have Standard_D11_V2 VM running this exact disk, but now I cannot.</p>
  
  <p><strong>Error response</strong></p>
  
  <pre><code>{
    "status": "Failed",
    "error": {
      "code": "ResourceDeploymentFailure",
      "message": "The resource operation completed with terminal provisioning state 'Failed'.",
      "details": [
        {
          "code": "VMSizeDoesntSupportPremiumStorage",
          "message": "Storage account type Premium_LRS is not supported for VM size Standard_D11_v2."
        }
      ]
    }
  }
  </code></pre>
  
  <p><strong>Here is my script:</strong></p>
  
  <pre><code>{
      "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
          "osDiskVhdUri": {
              "type": "String",
              "metadata": {
                  "description": "Uri of the existing VHD"
              }
          },
          "osType": {
              "allowedValues": [
                  "Windows",
                  "Linux"
              ],
              "type": "String",
              "metadata": {
                  "description": "Type of OS on the existing vhd"
              }
          },
          "vmSize": {
              "defaultValue": "Standard_A2",
              "type": "String",
              "metadata": {
                  "description": "Size of the VM"
              }
          },
          "vmName": {
              "type": "String",
              "metadata": {
                  "description": "Name of the VM"
              }
          }
      },
      "variables": {
          "diagStorageAccountName": "[concat(uniquestring(resourceGroup().id), 'specvm')]",
          "api-version": "2015-06-15",
          "addressPrefix": "10.0.0.0/16",
          "subnetName": "Subnet",
          "subnetPrefix": "10.0.0.0/24",
          "publicIPAddressName": "specializedVMPublicIP",
          "publicIPAddressType": "Dynamic",
          "virtualNetworkName": "specializedVMVNET",
          "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
          "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
          "nicName": "specializedVMNic"
      },
      "resources": [
          {
              "type": "Microsoft.Storage/storageAccounts",
              "sku": {
                  "name": "Standard_GRS"
              },
              "kind": "Storage",
              "name": "[variables('diagStorageAccountName')]",
              "apiVersion": "2016-01-01",
              "location": "[resourceGroup().location]",
              "properties": {}
          },
          {
              "type": "Microsoft.Network/virtualNetworks",
              "name": "[variables('virtualNetworkName')]",
              "apiVersion": "[variables('api-version')]",
              "location": "[resourceGroup().location]",
              "properties": {
                  "addressSpace": {
                      "addressPrefixes": [
                          "[variables('addressPrefix')]"
                      ]
                  },
                  "subnets": [
                      {
                          "name": "[variables('subnetName')]",
                          "properties": {
                              "addressPrefix": "[variables('subnetPrefix')]"
                          }
                      }
                  ]
              }
          },
          {
              "type": "Microsoft.Network/networkInterfaces",
              "name": "[variables('nicName')]",
              "apiVersion": "[variables('api-version')]",
              "location": "[resourceGroup().location]",
              "properties": {
                  "ipConfigurations": [
                      {
                          "name": "ipconfig1",
                          "properties": {
                              "privateIPAllocationMethod": "Dynamic",
                              "publicIPAddress": {
                                  "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
                              },
                              "subnet": {
                                  "id": "[variables('subnetRef')]"
                              }
                          }
                      }
                  ]
              },
              "dependsOn": [
                  "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
                  "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
              ]
          },
          {
              "type": "Microsoft.Network/publicIPAddresses",
              "name": "[variables('publicIPAddressName')]",
              "apiVersion": "[variables('api-version')]",
              "location": "[resourceGroup().location]",
              "properties": {
                  "publicIPAllocationMethod": "[variables('publicIPAddressType')]"
              }
          },
          {
              "type": "Microsoft.Compute/virtualMachines",
              "name": "[parameters('vmName')]",
              "apiVersion": "[variables('api-version')]",
              "location": "[resourceGroup().location]",
              "properties": {
                  "hardwareProfile": {
                      "vmSize": "[parameters('vmSize')]"
                  },
                  "storageProfile": {
                      "osDisk": {
                          "name": "[concat(parameters('vmName'),'-osDisk')]",
                          "osType": "[parameters('osType')]",
                          "caching": "ReadWrite",
                          "vhd": {
                              "uri": "[parameters('osDiskVhdUri')]"
                          },
                          "createOption": "Attach"
                      }
                  },
                  "networkProfile": {
                      "networkInterfaces": [
                          {
                              "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
                          }
                      ]
                  },
                  "diagnosticsProfile": {
                      "bootDiagnostics": {
                          "enabled": "true",
                          "storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('diagStorageAccountName')), '2016-01-01').primaryEndpoints.blob)]"
                      }
                  }
              },
              "dependsOn": [
                  "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
              ]
          }
      ]
  }
  </code></pre>
  
  <p><strong>Here is where I found the above script:</strong></p>
  
  <p><a href="https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-specialized-vhd" rel="nofollow noreferrer">https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-specialized-vhd</a></p>