As most of you know, one of the billing methods for Azure is pay-as-you-go. The more the resources are used up, the more you pay. So, it’s suggested to control costs as much as you can. One of the simple ways to reduce the costs is to deallocate the resource as soon as you are done with your job. Of course, you might run into a few issues if you deallocate the resources in a few of the cases. For example, IP Address of your Virtual Machine would change.
DevTest Labs allows you to control the costs by configuring Lab Policies. As of this writing, we can configure the following policies.
- Allowed Virtual Machine Sizes
- Virtual Machines Per User
- Virtual Machines per lab
- 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 mistakes of creating an expensive Virtual Machine or something which wastes money.
Let’s discuss each of the above policies in detail.
Allowed Virtual Machine Size
Lab owner (who created the lab) can select a set of VM Sizes from the default list and a set of policy where the DevTest users of that Lab can only create the VMs within those Sizes. Let’s see how to configure this “Allowed Virtual Machine Sizes” policy.
Navigate to DevTest Lab settings and select “Allowed Virtual Machine Sizes” policy as shown below.
Clicking on the “Allowed Virtual Machines Sizes” link will open the following blade.
By default, this policy is turned off. Turn it on by clicking on the Enabled = “On” and then select the VM sizes that you would like to allow DevTest Lab users to create. (We will have a separate article to see how this works) and click on “Save”.
Note
If you remember, we selected “Storage = Standard” while creating the DevTestLabs. So, you can only create Standard Storage VMs.
Click on “Save” button. That’s it you created the “Allowed Virtual Machines Sizes” policy to create only Standard_A0 and Standard_A1 VMs for this lab.
Virtual Machines Per Lab
This setting allows the administrator to configure the total number of VMs that all the DevTestLabs users (including the DevTest Lab Administrator) to create. Configure this by clicking on the “Virtual Machines per lab” link as shown below.
By default, this policy is disabled. Enable it by switching the “Enabled” button “On” and provide a value “1” in the “Maximum Virtual Machines allowed in this lab” and click on “Save”.
That’s it, we created the “Virtual Machines per lab” policy successfully.
To test this, let’s try to create a Virtual Machine. Please note that we already have a VM in our previous lab as shown below.
Let’s try to create a new VM in this lab and see what happens.
AS soon as I tried to create a new VM by clicking on the “Virtual Machine” link in the above screen capture, it asked me to select an Image. I selected the very first image and it gave me an error as shown below.
Let’s have a look at the rest of the Policies in the next article. I appreciate your feedback and suggestions.