azure - VMSizeDoesntSupportPremiumStorage Azure 从 VHD 创建 VM

标签 azure azure-storage azure-blob-storage

我正在使用此模板从现有磁盘创建 Azure VM。

我使用与创建现有磁盘完全相同的虚拟机大小“Standard_D11_v2”,但我不断收到下面列出的错误。

非常感谢任何帮助,我似乎无法克服这一点,而且我很困惑为什么我最初可以让 Standard_D11_V2 VM 运行这个确切的磁盘,但现在却不能。

错误响应

{
  "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

最佳答案

您正在尝试对 VHD 使用高级存储帐户,但 VM 大小不支持高级存储。您有多种选择来解决该问题:

  1. 将 VHD 移至标准存储帐户并在 ARM 模板中使用该存储帐户。
  2. 使用支持高级存储的 DS 大小虚拟机之一,例如 Standard_DS11_v2。

您可以在https://learn.microsoft.com/en-us/azure/storage/storage-premium-storage阅读更多相关信息。 。

关于azure - VMSizeDoesntSupportPremiumStorage Azure 从 VHD 创建 VM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44373065/

相关文章:

email - 发送邮件 - azure

c# - Azure Blob 存储 - 上传 Blob 后如何获取 Blob 存储 ID?

php - 使用php将csv上传到windows azure存储

c# - 如何在 Azure 中存储文件

node.js - 尝试通过 Node js将zip文件上传到azure存储

java - 服务总线主题触发的 Java Azure 函数是否支持 MessageReceiver?

asp.net-mvc - 托管 AngularJS 和图像的问题

azure - 我可以直接创建 1T 大小的 Windows Azure 驱动器吗

azure - 如何使用Azure数据工厂将数据从MySQL增量导入到Azure数据仓库?

image - Azure 存储 - 图像 url 变成二进制?