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

Changing the way scalesets are named #2189

Closed
mgreisen opened this issue Jul 25, 2022 · 0 comments · Fixed by #3045
Closed

Changing the way scalesets are named #2189

mgreisen opened this issue Jul 25, 2022 · 0 comments · Fixed by #3045
Assignees
Labels

Comments

@mgreisen
Copy link
Contributor

mgreisen commented Jul 25, 2022

Currently when scaleset resources are created they are named using a guid - which is converted into a string. This makes managing the scalesets in the azure portal difficult because we typically want to find the scalesets that are related to a pool.

It would be helpful if the scaleset name could include some portion of the pool name.
Azure resource names need to adhere to certain rules. https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#:~:text=virtualmachinescalesets

The total number of characters allowed for a virtual machine scaleset resource name is 64 characters.
The length of a guid including dashes is 36 characters.
If the first 28 characters of the pool name were prepended to the exiting way we name a scaleset now, that would make identifying the scalesets much easier and it would also group multiple scalesets in the same pool together when sorted by name.

AB#36023

@mgreisen mgreisen added the enhancement New feature or request label Jul 25, 2022
@ghost ghost added the Needs: triage label Jul 25, 2022
@Porges Porges self-assigned this Sep 7, 2022
Porges added a commit that referenced this issue Sep 11, 2022
In the Python code there were more validated string types that haven't been properly ported for use in the C# code (such as Region). Add that type back in and improve some others:

- Use `Region` type to represent regions (implicitly convertible to/from the `AzureLocation` SDK type)
- Improve validation of `Container` type to match Azure specs and use it in more places
- Restore/fix validation of `PoolName` type which was previously removed (#2080) due to being too strict: now allows 1-64 ASCII alphanumeric/hyphen/dash
  - We want to restrict pool names so that we can use them as disambiguating prefixes for scaleset names (see #2189). Note that underscore is not actually permitted in scaleset names so we will probably end up mapping it to hyphen.

Note that once C#7 lands we will be able to simplify the usage of `ValidatedString` a lot (using static abstract methods).

----

Open questions:

For deserializing from "known-good" places such as table storage or from Azure SDK APIs, should we have an `T.UnsafeAssumeValid(string input)` method which does no validation, to protect us from breakage?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants