Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Azure: VM auto start/shutdown

Is there any way in which I can automate stopping my VM on a Friday and starting this back up again on the Sunday evening at specified times?

I’m aware this is possible via the VM blade and DevTest labs but their only option is daily, whereas I want this only shut down in the weekends.

Any input will be greatly appreciated. Thanks

like image 620
user9118621 Avatar asked Dec 19 '17 14:12

user9118621


2 Answers

Given that you need more precise control over scheduling than is possible in the Azure VM Auto-Shutdown blade or Azure Dev-Test Labs, you can accomplish startup / shutdown on specific days via RunBooks in an Azure Automation Resource.

  1. Create (or choose an existing) Azure Automation Account resource
  2. In the new Automation resource, go to the Runbooks blade
  3. Click "Browse Gallery"
  4. Search for and import "Stop Azure V2 VMs" and "Start Azure V2 VMs" runbooks
  5. Schedule the new runbooks to run as needed

This walkthrough shows how to setup your runbooks with a specific schedule and parameters to target your virtual machine(s).

like image 154
Dean Goodman Avatar answered Oct 07 '22 08:10

Dean Goodman


I would recomment to you, to read this:

http://azurecorner.com/start-stop-windows-azure-vms-according-time-schedule/

like image 44
Matzy Avatar answered Oct 07 '22 09:10

Matzy