Tips and Tricks – Work smart and save money in Azure

Table of Contents

  1. Purpose of document
  2. Scenarios
  3. Automation (VM Auto Shutdown)
  4. VM’s status
  5. Setup VM Auto Shutdown
  6. Setup email notification for VM Auto-shutdown
  7. Email notification Action
  8. Action result
  9. Conclusion
  10. End of Document

Tips and Tricks – Work smart and save money in Azure

1. Purpose of document

Purpose of this document is to save cost on your Azure resources (VM’s) at off hours.

2. Scenarios

Scenario A: In case your business runs between specific time and no utilization of the resources after business hours (May be between 9:00 AM to 6:00 PM only) you can save money on Azure. Like Auto start and shutdown of VM’s at certain time.

Scenario B: Another scenario, like you require 20 VM’s for training purpose for certain days (may be for one week). If you forgot to delete the VM’s after one week, it will keep charging you and later you will receive a huge bill for the resources which are not in use.

3. Automation (VM Auto Shutdown)

For above use cases you need to create Runbooks in Azure and need to schedule them. How to create Runbook and how to automate will explain you in different post.

This post is to explain how to setup VM Auto-shutdown. This option is readily available in Azure and save lots of money for the VM’s of high specification.

Azure does not change for Virtual machine compute (CPU & Memory), if VM is in stopped (deallocated) status. In deallocated state only storage/disk will be charged for that VM.

4. VM’s status

  • Running
  • Stopped (Deallocated)

Press “Stop” button from Azure portal to manually stop & deallocate resources.

VM resources deallocated.

  • Stopped

Shut down VM from OS.

VM resources are not deallocated.

Note:

  • If you stop the VM from OS. VM status will show as “Stopped” and the resources (CPU and Memory) will not be deallocated. Azure will keep charging for the resources.
  • Resources will be “Stopped (deallocated)” only, if you will stop VM from Azure portal manually or VM shutdown is initiated by Auto-Shutdown.

5. Setup VM Auto Shutdown

  • Login to Azure portal https://portal.azure.com
  • Select VM => Operations => Auto shutdown => Enable (On)
  • Set Schedule shutdown time, time-zone for Auto-shutdown and “Save

6. Setup email notification for VM Auto-shutdown

You can also setup email notification, which will send you an email half an hour prior to scheduled auto-shutdown.

7. Email notification Action

You will receive an email half an hour prior to schedule Auto-shutdown with below 3 options. If you don’t take any action it will shut down the VM at schedule time.

  • Postpone: 1 hour
  • Postpone: 2 hour
  • Skip this instance

8. Action result

Good thing about these options are, that you don’t have to login to Azure. Simply click on URL and it will work.

  • Postpone: 1 hour
  • Postpone: 2 hour
  • Skip this instance

9. Conclusion

  • Auto-shutdown features on Azure VM will save your money.
  • In any case if you want to postpone or skip shutdown, you can do it with a single click.

10. End of Document

Facebook Comments