Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Create autoscale resources for scaleset #1661

Merged

Conversation

tevoinea
Copy link
Member

Summary of the Pull Request

What is this about?
This PR creates an auto scale resource for scalesets that uses the pool work queue as the tirgger metric.

Info on Pull Request

What does this include?

  • These changes only affect new scalesets, existing scalesets will not be modified
  • Scalesets that already have an auto scale resource associated with them will not be modified
  • The autoscaling resource is disabled meaning scaleset behavior won't change
  • In the interest of keeping this reviewable, hooking up scaling event diagnostics will be a follow up PR

Validation Steps Performed

How does someone test & validate?

  1. Create a new scaleset
  2. Find your new scaleset n azure portal
  3. Under "Scaling", select the "JSON" tab
  4. Verify there is 1 object under .properties.profiles
  5. Verify .properties.enabled == false

@@ -1,29 +1,9 @@
#!/usr/bin/env python
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original file was moved to log_analytics.py

retry_on_auth_failure,
)

# TODO: Look into deleting auto scale resource when deleting scaleset
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally using onefuzz scalesets shutdown. Azure automatically deletes the auto scale resource so we don't need to add any additional logic for that case.

@@ -0,0 +1,29 @@
#!/usr/bin/env python
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tevoinea tevoinea marked this pull request as ready for review February 18, 2022 15:23
params: Dict[str, Any] = {
"location": location,
"profiles": [profile],
"target_resource_uri": scaleset_uri,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When it comes time to enable autoscale by default, we just need to add:

"enabled": True,

@tevoinea tevoinea linked an issue Feb 22, 2022 that may be closed by this pull request
@tevoinea tevoinea enabled auto-merge (squash) February 28, 2022 16:27
@tevoinea tevoinea merged commit 16166e1 into microsoft:main Feb 28, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create and associate auto scale resource when creating VMSS
3 participants