If you’re getting the following error:
Multiple Placement Group Value of NodeType does not match with the value of VMSS
while attempting to deploy a VMSS for a Service Fabric cluster to enable multi-AZ (availability zones) in a region that doesn’t support that (for instance, West Central US; here’s a list of regions that do) then here’s the change you need to make in your template:
{
"parameters": {
"azCount": { // usually is either 0 or 3
"type": "int"
}
},
"variables": {
"azVar": { // produces [ "1", "2", "3" ]
"copy": [
{
"name": "azCopy",
"count": "[parameters('azCount')]",
"input": "[string(copyIndex('azCopy', 1))]"
}
]
},
"azEnabled": "[greater(length(variables('azVar').azCopy), 0)]"
},
"resources": [
{
"name": "myNode",
"type": "Microsoft.Compute/virtualMachineScaleSets",
"apiVersion": "2021-07-01",
"location": "westcentralus",
"zones": "[if(variables('azEnabled'), variables('azVar').azCopy, json('null'))]",
"properties": {
"singlePlacementGroup": "[if(variables('azEnabled'), variables('azEnabled'), json('null'))]",
"zoneBalance": "[if(variables('azEnabled'), variables('azEnabled'), json('null'))]",
}
]
}
Means that neither of the properties can be set to false spite the ARM schema for the latest (as of the time of writing) API version mentions only for zoneBalance and not for singlePlacementGroup.
Unfortunately neither of these docs mention that, yet:
- https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cross-availability-zones
- https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-use-availability-zones
Happy deployment, folks!