1

我正在尝试使用 VHD 创建自动缩放,这是我的模板:

...
{
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "sku": {
    "name": "[parameters('vmSize')]",
    "tier": "Standard",
    "capacity": "[parameters('instanceCount')]"
  },
  "name": "[variables('namingInfix')]",
  "apiVersion": "2016-03-30",
  "location": "[variables('location')]",
  "tags": {
    "displayName": "VMScaleSet"
  },
  "properties": {
    "overprovision": "true",
    "upgradePolicy": {
      "mode": "Manual"
    },
    "virtualMachineProfile": {
      "storageProfile": {
        "osDisk": {
          "name": "vmname",
          "osType": "Linux",
          "caching": "ReadWrite",
          "vhd": {
            "uri": "https://myvhd.vhd"
          },
          "createOption": "Attach"
        }
      },
      "osProfile": {
        "computerNamePrefix": "[parameters('vmSSName')]",
        "adminUsername": "[parameters('adminUsername')]",
        "adminPassword": "[parameters('adminPassword')]"
      },
      "networkProfile": {
      }
    }
  }
}
...

不幸的是,当我通过时收到此错误osProfile

Parameter 'osProfile' is not allowed. (Code: InvalidParameter)

但是,如果我删除osProfile我收到此错误:

Required parameter 'osProfile' is missing (null). (Code: InvalidParameter)
4

1 回答 1

0

看起来这里的问题是“createOption”:“附加”您需要直接从您的映像为规模集创建 VM。即“createOption”:“fromImage”。

于 2016-07-07T22:24:21.397 回答