2017-06-05 116 views
0

我正在使用此模板从现有磁盘创建Azure虚拟机。VMSizeDoesntSupportPremiumStorage Azure从VHD创建虚拟机

我正在使用与创建现有磁盘的EXACT相同的VM大小“Standard_D11_v2”,但是我不断收到下面列出的错误。

任何帮助将非常感谢,我似乎无法通过这个,我很困惑,为什么我最初可以运行Standard_D11_V2虚拟机运行此确切的磁盘,但现在我不能。

错误响应

{ 
    "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." 
     } 
    ] 
    } 
} 

这里是我的脚本:

{ 
    "$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'))]" 
      ] 
     } 
    ] 
} 

这里就是我发现上面的脚本:

https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-specialized-vhd

回答

2

您正在尝试为VHD使用高级存储帐户,但是不支持高级存储的VM大小。您有几个选择来解决问题:

  1. 将VHD移动到标准存储帐户并在ARM模板中使用该存储帐户。
  2. 使用支持高级存储的DS大小VM之一(例如Standard_DS11_v2)。

你可以在https://docs.microsoft.com/en-us/azure/storage/storage-premium-storage了解更多。

+0

感谢 - 我的愚蠢的错误,试图使用“Standard_D11_v2”,而不是“Standard_DS11_v2” – 99823