Hello @안 남기 ,
To answer your question,
Is the extension associated with the existing set of virtual machine scale set instances is automatically applied to the newly created VMSS instance?
VMSS model implies a property of the scale set which affects VMs, for example, the VM size, the OS version or an extension. The newly added instances are upgraded to the latest VMSS model depending on the Policy upgrade (automatic, manual) that you have selected.
If you look at the instances for a VMSS in Azure Portal as shown below, you can see that each instance has a field called Latest Model (Yes/No). If the upgrade policy for that VMSS is set to automatic, these VM instances are brought up-to-date with the latest scale set model (which includes the extensions as well) and Latest Model field will show as 'Yes'. Basically, yes, the extensions will apply to the newly added instances in this case.
If the upgrade policy is set to 'Manual', you will need to manually go in and upgrade newly added instances to the latest VMSS model. Once the upgrade to the latest VMSS model is completed, the extensions applied to the existing VMSS instances will apply to the newly added instances as well.
In short, the answer is, yes it is possible. It depends on the upgrade policy selected.
How do I add an extension to all VMs in my virtual machine scale set?
If update policy is set to automatic, redeploying the template with the new extension properties updates all VMs.
If update policy is set to manual, first update the extension, and then manually update all instances in your VMs.
If the extensions associated with an existing virtual machine scale set are updated, are existing VMs affected?
If the extension definition in the virtual machine scale set model is updated, and the upgradePolicy property is set to automatic, it updates the VMs. If the upgradePolicy property is set to manual, extensions are flagged as not matching the model.
By default the upgrade policy is set to manual. In this mode, when you update the scale set model, updates are not applied to existing VMs.
If you don't want manual intervention, you can use automatic upgrade policy.
How to bring VMs up-to-date with the latest scale set model?
Scale sets have an "upgrade policy" that determine how VMs are brought up-to-date with the latest scale set model. The three modes for the upgrade policy are:
Automatic - In this mode, the scale set makes no guarantees about the order of VMs being brought down. The scale set may take down all VMs at the same time.
Rolling - In this mode, the scale set rolls out the update in batches with an optional pause time between batches.
Manual - In this mode, when you update the scale set model, nothing happens to existing VMs.
How to enable 'automatic upgrade policy' for a VMSS?
You can do it via Azure Portal by going to Settings->Upgrade Policy as shown below:
You can also change the upgrade Policy setting by changing it in the template you used to deploy a scale set and then redeploy the template.
If this answers your query, do click “Accept the answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread.
And, if you have any further query do let me know in the comments.