Home

Adding Alerts to shutdown an Azure Virtual Machine

%3CLINGO-SUB%20id%3D%22lingo-sub-203353%22%20slang%3D%22en-US%22%3EAdding%20Alerts%20to%20shutdown%20an%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-203353%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20running%20a%20lab%20in%20Azure%20for%20training%20purposes.%20Now%20using%20a%20DevTest%20Lab%20I%20could%20schedule%20a%20shutdown%20period%20to%20turn%20off%20a%20VM%20during%20off%20hours%20but%20I%20would%20like%20to%20be%20more%20granular%20and%20have%20the%20VM%20shutdown%20after%20one%20hour%20of%20inactivity%20for%20example.%20Or%20having%20the%20server%20turned%20off%20automatically%20after%202%20hours%20of%20operation%20no%20matter%20what.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20configured%20an%20alert%20based%20on%20%22System%5CSystem%20Up%20Time%22%20metric%20but%20no%20results.%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-203353%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAlerts%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECompute%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDevTest%20Labs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Emetrics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-389575%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20Alerts%20to%20shutdown%20an%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-389575%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F125035%22%20target%3D%22_blank%22%3E%40Eric%20Lacroix%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20about%20creating%20a%20scheduled%20task%20in%20the%20VM%20to%20initiate%20a%20shutdown%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-211672%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20Alerts%20to%20shutdown%20an%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211672%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Thomas%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETrue%2C%20I%20don't%20want%20to%20wait%20for%20auto%20shutdown%20if%20I'm%20not%20using%20the%20VM..%20Auto%20shutdown%20is%20a%20great%20feature%20but%20I%20still%20feel%20I'm%20wasting%20money%20on%20VM%20time%20not%20being%20used.%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20reply%20and%20link.%20This%20is%20exactly%20what%20I%20was%20looking%20for!%20%3A)%3C%2Fimg%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-211586%22%20slang%3D%22en-US%22%3ERe%3A%20Adding%20Alerts%20to%20shutdown%20an%20Azure%20Virtual%20Machine%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211586%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Eric%2C%3C%2FP%3E%3CP%3E.%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20i%20understand%20you%20don't%20want%20to%20use%20all%20your%20cred's%20for%20waiting%20for%20the%20auto%20shutdown.%3C%2FP%3E%3CP%3EWith%20Azure%20Automation%20it's%20possible%20to%20do%20what%20you%20want.%20If%20i%20understand%20you%20correct.%3CBR%20%2F%3EIt's%20in%20preview%20now%20and%20her%20you%20got%20a%20link%20for%20it.%20So%20if%20you%20create%20rules%20based%20on%20CPU%2C%20Memory%2C%20Disk%20or%20so%20on.%20You%20can%20possible%20create%20some%20Automation%20on%20what%20you%20want%20to%20do.%3CBR%20%2F%3EI%20will%20look%20in%20to%20it%20my%20self%20as%20well.%3CBR%20%2F%3EHere%20you%20got%20a%20link%20for%20preview%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fautomation%2Fautomation-solution-vm-management%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fautomation%2Fautomation-solution-vm-management%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Eric Lacroix
Occasional Contributor

Hi all, 

 

I'm running a lab in Azure for training purposes. Now using a DevTest Lab I could schedule a shutdown period to turn off a VM during off hours but I would like to be more granular and have the VM shutdown after one hour of inactivity for example. Or having the server turned off automatically after 2 hours of operation no matter what. 

 

I configured an alert based on "System\System Up Time" metric but no results.   

 

 

3 Replies

Hi Eric,

As i understand you don't want to use all your cred's for waiting for the auto shutdown.

With Azure Automation it's possible to do what you want. If i understand you correct.
It's in preview now and her you got a link for it. So if you create rules based on CPU, Memory, Disk or so on. You can possible create some Automation on what you want to do.
I will look in to it my self as well.
Here you got a link for preview
https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management

Hi Thomas, 

 

True, I don't want to wait for auto shutdown if I'm not using the VM.. Auto shutdown is a great feature but I still feel I'm wasting money on VM time not being used.  

 

Thank you for your reply and link. This is exactly what I was looking for! :) 

@Eric Lacroix 

 

How about creating a scheduled task in the VM to initiate a shutdown?

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies