Azure / LabServices

Azure Lab Services scripts and samples
MIT License
16 stars 6 forks source link

Script to check Labs quotas across all regions #12

Closed petehauge closed 2 years ago

petehauge commented 2 years ago

New script to check quotas across all regions! Can also pass a parameter to output the quotas (including for Labs & Lab Plans) out to a CSV file.

lucabol commented 2 years ago

@petehauge I am a bit confused about the output of the script. In the output below, do I have 200 cores or 100 total?

I think the right answer is 100, but it is not clear. Wouldn't it be better to remove the groups and instead have a single table that contains both as I show at the end of the comment? If the line gets too long for comfort, we can use the initials and have a legend at the bottom.

Lab Sizes:  Medium (Nested Virtualization), Large (Nested Virtualization)
RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 25 Medium (Nested Virtualization) | 12 Large (Nested Virtualization)
....

Lab Sizes:  Small, Medium, Large
RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 50 Small | 25 Medium | 12 Large
...

Instead, I suggest:

RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 25 Medium (Nested Virtualization) | 12 Large (Nested Virtualization) | 50 Small | 25 Medium | 12 Large
...

Or, using initials:

RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 25 MNV | 12 LNV | 50 S| 25 M| 12 L
...

Legend: MNV: Medium Nested Virtualization, LNV: Large Nested Virtualization, S: Small, M: Medium, L: Large.
petehauge commented 2 years ago

Thanks for checking this out @lucabol ! The problem is that we have different 'types' of cores. Looking at your output, you have 100 GPU cores, and 100 non-GPU cores. So technically 200 total cores, but they are not interchangeable. Does that make sense?

If you want a more complete output - then you can use the "-PassThru" flag to get the data and export it to a CSV file. Do you think that's sufficient? I'm hesitant to use the keywords & legend... but either way - I cannot combine the cores as you suggest because they are different types.

lucabol commented 2 years ago

@petehauge : got it. To avoid people misunderstanding the output (as I did), can we change it to make it clear what you stated in the comment.

From:

Lab Sizes:  Medium (Nested Virtualization), Large (Nested Virtualization)
RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 25 Medium (Nested Virtualization) | 12 Large (Nested Virtualization)
....

Lab Sizes:  Small, Medium, Large
RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 50 Small | 25 Medium | 12 Large
...

To:

GPU CORES
RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 25 Medium (Nested Virtualization) | 12 Large (Nested Virtualization)
....

NON-GPU CORES
RegionName           UsedCores TotalCores PercentUsed AvailableVMs
----------           --------- ---------- ----------- ------------
Australia East               0        100           0 50 Small | 25 Medium | 12 Large
...
petehauge commented 2 years ago

@lucabol - yes, sure, I can change the names! We actually have 4 categories, so I'll use names like this: CPU CPU - Virtualization GPU - Compute GPU - Visualization

If you have any other suggestions for better names just let me know. :-)

lucabol commented 2 years ago

If these 4 categories are described in a URL, it would be nice to have the program print out that URL (i.e., 'see http://.....') either at the start or end of the output (or on the '--help' option). Maybe going overboard here, but I expect heavy usage of this script and our customer base might need the additional help.

petehauge commented 2 years ago

Hi @lucabol - here's the new output! Let me know if you have any other suggestions. The best URL that has info on sizes is the Lab Services Admin Guide, so I provided a link to that at the bottom.

Type of Cores:  CPU Virtualization Cores (Dsv4)

RegionName           UsedCores TotalCores PercentUsed AvailableVMs                                                        
----------           --------- ---------- ----------- ------------                                                        
Australia East               0        100           0 25 Medium (Nested Virtualization) | 12 Large (Nested Virtualization)
..
West US                      0         82           0 20 Medium (Nested Virtualization) | 10 Large (Nested Virtualization)

Type of Cores:  CPU Cores (Fsv2)

RegionName           UsedCores TotalCores PercentUsed AvailableVMs                   
----------           --------- ---------- ----------- ------------                   
Australia East               0        100           0 50 Small | 25 Medium | 12 Large
..
West US                     38        100          38 31 Small | 15 Medium | 7 Large 

More information about sizes can be found here:
https://docs.microsoft.com/en-us/azure/lab-services/administrator-guide
lucabol commented 2 years ago

Looks great. Thanks Peter.