Classic WVD autoscale modification

%3CLINGO-SUB%20id%3D%22lingo-sub-1818615%22%20slang%3D%22en-US%22%3EClassic%20WVD%20autoscale%20modification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1818615%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3CBR%20%2F%3EI%20have%20a%20WVD%20classic%20environment%20and%20I%20need%20to%20implement%20the%20autoscaling%20feature%20for%20it.%3CBR%20%2F%3EI've%20checked%20MS%20documentation%20and%20found%20the%20Autoscale%20automation%20which%20implements%20Automation%20Accounts%20and%20Logic%20apps%20to%20run%20during%20peak%20hours%2C%20check%20the%20amount%20of%20sessions%20and%20spin%20more%20VMs%20if%20necessary.%20Then%2C%20during%20off%20hours%2C%20it%20shut%20downs%20VMs%20to%20a%20minimum.%3CBR%20%2F%3EThis%20is%20good...but%20not%20what%20I%20need.%3CBR%20%2F%3EI%20need%20the%20automation%20to%20add%20more%20VMs%20when%20needed%2C%20but%20also%20to%20shut%20down%20VMs%20when%20not%2C%20during%20a%2024x7%20schedule.%20I%20don't%20want%20it%20to%20shutdown%20VMs%20only%20outside%20working%20hours.%3C%2FP%3E%3CP%3EI%20tried%20to%20check%20how%20to%20add%20this%20functionality%20but%20I%20can't%20seem%20to%20find%20a%20way%20of%20doing%20it%20and%20I%20can't%20find%20the%20source%20code%20that%20does%20it%20to%20modify%20it.%3C%2FP%3E%3CP%3EHas%20anyone%20have%20a%20similar%20problem%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1818615%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Automation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELogic%20Apps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWVD%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1820954%22%20slang%3D%22en-US%22%3ERe%3A%20Classic%20WVD%20autoscale%20modification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1820954%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F104993%22%20target%3D%22_blank%22%3E%40Dante%20Nahuel%20Ciai%3C%2FA%3E%2C%26nbsp%3Bno%20problems%20there%20at%20all%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Fsmile_40x40.gif%22%20alt%3D%22%3Asmile%3A%22%20title%3D%22%3Asmile%3A%22%20%2F%3E%3C%2FP%3E%3CP%3EIt%20sounds%20like%20you%20need%20a%20virtual%20machine%20scale%20set%20(an%20overview%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Foverview%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%3C%2FA%3E).%20The%20trick%20is%2C%20just%20like%20the%20App%20Services%2C%20you%20can%20scale-out%20and%20scale-in%20the%20VMs%20in%20the%20scale%20sets%20basing%20on%20the%20scalability%20rules%2Fmetrics.%20For%20that%2C%20you%20need%20to%20create%20a%20scale%20set%20and%20%3CU%3Eenable%20autoscale%3C%2FU%3E%20for%20it.%20Then%2C%20using%20some%20Azure%20CLI%20%2B%20Templates%20you%20can%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machine-scale-sets%2Ftutorial-autoscale-template%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edefine%20the%20rules%3C%2FA%3E.%20And%20finally%2C%20creating%20the%20rule%20following%20the%20guidelines%2C%20do%20not%20forget%20to%20create%20the%20same%20for%20scaling%20the%20set%20back%20in%20(it%20doesn't%20happen%20automatically).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1822838%22%20slang%3D%22en-US%22%3ERe%3A%20Classic%20WVD%20autoscale%20modification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1822838%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F744749%22%20target%3D%22_blank%22%3E%40Command0r%3C%2FA%3E%26nbsp%3BThank%20you%20for%20your%20answer.%3CBR%20%2F%3EThe%20thing%20is%2C%20I%20can't%20seem%20to%20find%20any%20way%20of%20using%20Scale%20sets%20with%20Classic%20WVD...%20is%20this%20possible%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1822858%22%20slang%3D%22en-US%22%3ERe%3A%20Classic%20WVD%20autoscale%20modification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1822858%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F104993%22%20target%3D%22_blank%22%3E%40Dante%20Nahuel%20Ciai%3C%2FA%3E%26nbsp%3BI%20wrote%20a%20script%20a%20while%20ago%20that%20got%20some%20good%20feedback.%26nbsp%3B%20I%20have%20a%20version%20for%20WVD%20classic%20and%20another%20version%20for%20WVD%20ARM.%26nbsp%3B%20You%20can%20find%20it%20here.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.ciraltos.com%2Fautomatically-start-and-stop-wvd-vms-with-azure-automation%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.ciraltos.com%2Fautomatically-start-and-stop-wvd-vms-with-azure-automation%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1827374%22%20slang%3D%22en-US%22%3ERe%3A%20Classic%20WVD%20autoscale%20modification%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1827374%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F78468%22%20target%3D%22_blank%22%3E%40Travis%20Roberts%3C%2FA%3E%26nbsp%3BThank%20you%20very%20much!%20I%20intended%20to%20find%20out%20if%20possible%20and%20then%20try%20to%20code%20it%20myself.%20I%20never%20expected%20to%20be%20already%20out%20there.%3CBR%20%2F%3EThank%20you%20very%20much.%3CBR%20%2F%3EOne%20last%20question%3CBR%20%2F%3EI%20read%20in%20the%20comments%20that%20two%20new%20%22versions%22%20of%20yours%20but%20modified%20were%20created.%3CBR%20%2F%3EDo%20you%20have%20any%20comments%20on%20those%3F%20The%20one%20made%20by%20Kandice%20and%20the%20one%20made%20by%20Donald%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20in%20advance!!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hi,
I have a WVD classic environment and I need to implement the autoscaling feature for it.
I've checked MS documentation and found the Autoscale automation which implements Automation Accounts and Logic apps to run during peak hours, check the amount of sessions and spin more VMs if necessary. Then, during off hours, it shut downs VMs to a minimum.
This is good...but not what I need.
I need the automation to add more VMs when needed, but also to shut down VMs when not, during a 24x7 schedule. I don't want it to shutdown VMs only outside working hours.

I tried to check how to add this functionality but I can't seem to find a way of doing it and I can't find the source code that does it to modify it.

Has anyone have a similar problem?

4 Replies

@Dante Nahuel Ciai, no problems there at all :smile:

It sounds like you need a virtual machine scale set (an overview here). The trick is, just like the App Services, you can scale-out and scale-in the VMs in the scale sets basing on the scalability rules/metrics. For that, you need to create a scale set and enable autoscale for it. Then, using some Azure CLI + Templates you can define the rules. And finally, creating the rule following the guidelines, do not forget to create the same for scaling the set back in (it doesn't happen automatically).

@Command0r Thank you for your answer.
The thing is, I can't seem to find any way of using Scale sets with Classic WVD... is this possible?

@Dante Nahuel Ciai I wrote a script a while ago that got some good feedback.  I have a version for WVD classic and another version for WVD ARM.  You can find it here.

https://www.ciraltos.com/automatically-start-and-stop-wvd-vms-with-azure-automation/

@Travis Roberts Thank you very much! I intended to find out if possible and then try to code it myself. I never expected to be already out there.
Thank you very much.
One last question
I read in the comments that two new "versions" of yours but modified were created.
Do you have any comments on those? The one made by Kandice and the one made by Donald

Thank you in advance!!