Forum Discussion

Eric Lacroix's avatar
Eric Lacroix
Copper Contributor
Jun 12, 2018

Adding Alerts to shutdown an Azure Virtual Machine

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.   

 

 

4 Replies

  • thomboe's avatar
    thomboe
    Copper Contributor

    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

    • Eric Lacroix's avatar
      Eric Lacroix
      Copper Contributor

      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! :) 

Resources