Azure模板:不允许参数'osProfile',并且缺少必需参数'osProfile'

时间:2016-06-04 02:24:23

标签: azure azure-virtual-machine azure-deployment azure-autoscaling-block azure-vm-scale-set

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

    <DataTemplate DataType="{x:Type ViewModels:LoginViewModel}">
        <Views:LoginView />
    </DataTemplate>
    <DataTemplate DataType="{x:Type ViewModels:LoggedInViewModel}">
        <Views:LoggedInView />
    </DataTemplate>

不幸的是,当我通过... { "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

1 个答案:

答案 0 :(得分:0)

看起来这里的问题是&#34; createOption&#34;:&#34;附加&#34; 您需要直接从映像创建用于缩放集的VM。即&#34; createOption&#34;:&#34; fromImage&#34;。