Skip to content

Azure dual-pool autoscale defaults are omitted #658

Description

@adamrtalbot

Summary

With Tower CLI 0.36.0, Azure Batch Forge dual-pool autoscaling is not explicitly enabled when the autoscale-disable flags are omitted. This can create fixed-size head and worker pools that remain at their configured VM counts instead of scaling down when idle.

The CLI help presents these as disable flags:

--head-no-auto-scale    Disable autoscaling for the head pool
--worker-no-auto-scale  Disable autoscaling for the worker pool

That implies autoscaling is enabled by default when they are absent. However, the current implementation appears to serialize each pool's autoScale field only when the corresponding nullable negative option is explicitly assigned. Otherwise it sends null/omits the field.

Reproduction

Create an Azure Batch Forge dual-pool compute environment without either disable flag:

tw compute-envs add azure-batch forge \
  --name example \
  --location eastus \
  --work-dir az://example \
  --dual-pool \
  --head-vm-count 8 \
  --worker-vm-count 32

Observe that the resulting pools can remain fixed at 8 head nodes and 32 worker nodes rather than treating those values as autoscaling maximums and scaling down when idle.

Current workaround

Explicit Boolean assignment enables autoscaling:

--head-no-auto-scale=false \
--worker-no-auto-scale=false

This works, but the double negative is confusing, is not shown in --help, and is awkward for configuration wrappers that model Boolean flags by presence.

Expected behavior

One or both of the following would make the behavior clear and reliable:

  • When the dual-pool disable flags are omitted, explicitly serialize headPool.autoScale=true and workerPool.autoScale=true, matching the documented default.
  • Expose positive negatable options such as --[no-]head-auto-scale and --[no-]worker-auto-scale, while retaining the existing negative flags as backward-compatible aliases.

Please also add request-payload tests covering:

  • Default dual-pool creation serializes autoScale: true for both pools.
  • Explicitly disabling head or worker autoscaling serializes autoScale: false for that pool.

Version

Tower CLI version 0.36.0 (build b8e8b32)

The same nullable dual-pool mapping is also present in the current master implementation at the time of filing.

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