Azure模板:不允许参数“osProfile”,缺少必需参数“osProfile”

6gpjuf90  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(138)

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

  1. ...
  2. {
  3. "type": "Microsoft.Compute/virtualMachineScaleSets",
  4. "sku": {
  5. "name": "[parameters('vmSize')]",
  6. "tier": "Standard",
  7. "capacity": "[parameters('instanceCount')]"
  8. },
  9. "name": "[variables('namingInfix')]",
  10. "apiVersion": "2016-03-30",
  11. "location": "[variables('location')]",
  12. "tags": {
  13. "displayName": "VMScaleSet"
  14. },
  15. "properties": {
  16. "overprovision": "true",
  17. "upgradePolicy": {
  18. "mode": "Manual"
  19. },
  20. "virtualMachineProfile": {
  21. "storageProfile": {
  22. "osDisk": {
  23. "name": "vmname",
  24. "osType": "Linux",
  25. "caching": "ReadWrite",
  26. "vhd": {
  27. "uri": "https://myvhd.vhd"
  28. },
  29. "createOption": "Attach"
  30. }
  31. },
  32. "osProfile": {
  33. "computerNamePrefix": "[parameters('vmSSName')]",
  34. "adminUsername": "[parameters('adminUsername')]",
  35. "adminPassword": "[parameters('adminPassword')]"
  36. },
  37. "networkProfile": {
  38. }
  39. }
  40. }
  41. }
  42. ...

字符串
不幸的是,当我传递osProfile时,我收到了这个错误:

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


但是如果我删除osProfile,我会收到以下错误:

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

b0zn9rqh

b0zn9rqh1#

看起来这里的问题是“扩展选项”:“附加”您需要直接从您的映像创建比例集的VM。即“扩展选项”:“fromImage”。

相关问题