Azure DevTest Labs: Policies To Control Costs - Part Two

In our previous article,  Azure DevTest Labs: Policies To Control Costs - Part One, we have learned the following policies that a DevTest Lab Owner can configure.

  • Allowed Virtual Machine Sizes
  • Virtual Machines per lab

In this article, we will learn the following policies,

  • Virtual Machines Per User
  • Auto-shutdown
  • Auto-Start

Before discussing the above policies, please note that these DevTest Labs are meant to be used by the Developers and Testers working on your organization. Administrator or the Subscription owners can configure these policies so that normal DevTest Lab Users (one of your developers or Testers) don’t make the mistake of creating an expensive Virtual Machine or something which wastes money.

Let’s discuss each of the above three policies in detail.

Virtual Machine Per user

Lab owner (who created the lab) can use this setting to allow the number of Virtual Machines that the Users of the Lab can create by clicking on the “Virtual Machine per user” setting.

Enable the setting by clicking “On” of the “Enabled” toggle button and provide an integer value in the “Maximum allowed virtual machines per user”. As per the below screen capture, let’s provide “1” and save the changes by clicking on “Save” button.



Please note that the above settings also apply to the Lab Owner / administrator as well. Let’s now try to add a new VM in this lab.



You will receive an error as shown in the above screen capture.

Please note that both the following policies apply to all the users (of all roles – we will have a separate discussion on different Role and Groups) including the Administrators / Subscription owners and normal DevTest Lab User.

  • Virtual Machines per lab (which was discussed in our previous article, Azure DevTest Labs: Policies To Control Costs - Part One.)
  • Virtual machines per user

Auto-shutdown

If you remember, while creating the DevTest lab, there was an option to choose “Auto-shutdown” and select the time (along with the Time Zone) on when the VMs to be shutdown automatically.


This policy is a DevTest Lab level policy which will be applied to all the VMs that are created in the lab. However, different DevTest Lab Users can opt-out of this policy if they don’t want to continue with the policy.

Let’s say, in the above screen capture, when the administrator has configured “7:00 P.M”, all the VM would shut down automatically. However, if a given user wants to run some long-running jobs which might run up to late at night, then he/she would opt-out from this policy. We will discuss how to do this in one of the future articles.

In Summary, this policy is really useful to reduce the cost by shutting down the VMs automatically.

Auto-Start – The last policy is to start the VMs automatically. We cannot configure this while creating the DevTest Lab. However, we can configure this one the DevTest Lab is being provisioned. As shown below you can configure the Auto-Start settings by providing the following details.

  • Schedule Start Time – When to start the VM automatically.
  • Time Zone – Time zone of the Schedule Start Time.
  • Day of the Week – You can select the days of the week on when the VMs to be restarted automatically.



Please note that “Auto-Shutdown” policy applies to all the VMs in the DevTest Lab automatically. However, the “Auto-Start” policy doesn’t apply to any of the VMs. The owner of the VM has to apply it manually by going into the settings. Probably this is something which could be discussed in a future article.

Hope you enjoyed all the cool-features of DevTest Labs. Please share your feedback.


Similar Articles