title: Azure service fabric node type instance count doubled on creating cluster using ARM
body: <p>I'm experimenting on creating a new service fabric cluster using ARM template and modify the template to add certificates, etc. The cluster and all resources are successfully created, but I noticed that initially the number of node instances are 2x, plus 1 than what I set to. For example, if I set "vmInstanceCount" to 3, I see 7 instances are currently creating.</p>
  
  <p><a href="https://i.stack.imgur.com/wZlhY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wZlhY.png" alt="enter image description here"></a></p>
  
  <p>But if I just wait and let them finish, then 4 instances were deleted and it will keep the three instances. One problem here is that it randomly select what to keep, thus, the names to keep can be node_1, node_4, node_6 which is messy.</p>
  
  <p>Here's my snippet of nodeType:</p>
  
  <pre><code>"nodeTypes": [
    {
      "name": "[variables('vmNodeType0Name')]",
      "applicationPorts": {
        "endPort": 30000,
        "startPort": 20000
      },
      "clientConnectionEndpointPort": "[variables('fabricTcpGatewayPort')]",
      "ephemeralPorts": {
        "endPort": 65534,
        "startPort": 49152
      },
      "httpGatewayEndpointPort": "[variables('fabricHttpGatewayPort')]",
      "isPrimary": true,
      "vmInstanceCount": "[variables('vmInstanceCount')]",
      "reverseProxyEndpointPort": "[variables('reverseProxyEndpointPort')]",
      "durabilityLevel": "Bronze"
    }
  ]
  </code></pre>
  
  <p>...</p>
  
  <pre><code>  "sku": {
      "name": "[variables('vmssSkuName')]",
      "capacity": "[variables('vmssSkuCapacity')]",
      "tier": "Standard"
    }
  </code></pre>