Skip to content

feat: make auto-allocate-host and auto-release-host configurable#197

Open
cchristous wants to merge 2 commits intorenderedtext:masterfrom
cchristous:configurable-auto-release-host
Open

feat: make auto-allocate-host and auto-release-host configurable#197
cchristous wants to merge 2 commits intorenderedtext:masterfrom
cchristous:configurable-auto-release-host

Conversation

@cchristous
Copy link
Contributor

Summary

  • Adds SEMAPHORE_AGENT_AUTO_ALLOCATE_HOST and SEMAPHORE_AGENT_AUTO_RELEASE_HOST environment variables to control the host resource group's License Manager behavior
  • Both default to "true" for backward compatibility

Problem

The auto-release-host setting on the host resource group is hardcoded to "true". This means License Manager releases dedicated hosts when all instances on them terminate. For pools with pre-allocated static hosts (where min == max and hosts are manually managed), this causes the hosts to be released during instance replacements (e.g., AMI updates), losing the capacity reservation.

Fix

Make both settings configurable via environment variables. Pools that use pre-allocated hosts can set SEMAPHORE_AGENT_AUTO_RELEASE_HOST=false in their deploy configuration to prevent License Manager from releasing their hosts.

Why this is safe

  • Defaults to current behavior ("true" / "true") — no change for existing pools
  • Only affects pools that explicitly set the new environment variables

Add SEMAPHORE_AGENT_AUTO_ALLOCATE_HOST and SEMAPHORE_AGENT_AUTO_RELEASE_HOST
environment variables to control the host resource group's auto-allocate
and auto-release behavior. Both default to "true" for backward compatibility.

Setting auto-release-host to "false" prevents License Manager from
releasing dedicated hosts when instances terminate, which is necessary
for pools with pre-allocated static hosts where min == max.
@cchristous cchristous marked this pull request as ready for review March 26, 2026 21:41
…isting host resource group tests

Add a test verifying that SEMAPHORE_AGENT_AUTO_ALLOCATE_HOST and
SEMAPHORE_AGENT_AUTO_RELEASE_HOST flow through to the CloudFormation
template. Also fix the two existing host resource group tests that were
missing the auto-host-recovery parameter added in d1f68f2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant