Search code examples
azureazure-vm-scale-set

Azure Virtual Machine Scale Set Scaling Provisions two Instances


So I am trying to provision a scaleset and have it join a domain using the JsonADDomainExtension. Everything works, however when scaling in any way (auto scale or manual) two instances instead of one gets provisioned, however when the provisioning is done one instance disappears, after running DSC, extensions etc. leaving the two provisioned inside of the domain but in the end only one VM running. I've tried both using FirstLogonCommands, extension and DSC - they both act the same way. I assume this is by design, though I haven't been able to find any information about it.

Is there anyway to only trigger the extensions for the machine that's provisioned and running in the end?


Solution

  • You're seeing the effects of the overprovisioning feature, which is on by default. This temporarily provisions additional VMs beyond your specified capacity when creating or scaling up your VMSS to improve provisioning success rates.

    You can turn off overprovisioning by setting the 'overprovision' field to false in the API.