Skip to content

How to update VMSS resource, and preserve the current instance count? (in ARM template)Β #70

@johnib

Description

@johnib

Hello,

The context is ongoing VMSS provisioning/updating using ARM templates.
We use ARM template to manage all our ARM resources, in an Infra-as-Code manner (IoC).

When running in IoC, there are frequent ARM deployments, with incremental changes to our resource definitions.
In practice, I might have several ARM deployments a day, that usually do not change anything in the VMSS definition, but change other resources.

Additional information, is that on top of my VMSS clusters, I have configured auto-scale rules, that add/remove instances on an ongoing basis.

The scenario below, becomes problematic:

  1. VMSS is provisioned with 5 instances by default, i.e. in the ARM template the sku.capacity is 5 by default.
  2. After several days, this VMSS gets bigger due to auto-scale engine adding more and more instances, as the VMSS are under some load.
  3. The next release that initiates an ARM template deployment, changes back the instance count to 5, as the sku.capacity is not being updated in the code every time the auto-scale changes the instance count (of course.. right? :) )
  4. I have added a logic in my ARM template that after the initial provisioning of a specific VMSS cluster, to set sku.capacity to null instead of the default value 5. However, is not accepted by ARM due to:

Required parameter 'sku.capacity' is missing (null).

I'm looking for a way to indicate VMSS RP, to ignore the sku.capacity and preserve the existing instance count, without knowing it beforehand

Please advise, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions