Azure DevTest Lab is a service for easily creating, using, and managing infrastructure-as-a-service (IaaS) virtual machines (VMs) and platform-as-a-service (PaaS) environments in labs. Labs offer preconfigured bases and artifacts for creating VMs, and Azure Resource Manager (ARM) templates for creating environments like Azure Web Apps or SharePoint farms.
As per the above description of the service, DevTest lab provides better management capabilities w.r.t the workloads. You can create Artifacts and configure your virtual machines for developers with the required set of tools. Developer machines do not need to be up all the time.
When a developer finishes its testing on the machine it can be shutdown. For example: your company hired a few developers to develop an application. Developers work every day and their working hours start from 9 AM – 5 PM. Outside the office hours, developers do not need their VMs. The VMs can be shutdown to save on computing costs.
Auto start and Auto shutdown feature is provided out of the box to you when you set up Azure DevTest Lab service. You can configure the start time of the VMs and also configure the days when the VMs should be started. For example: If no one would be using the developer virtual machines on Saturday and Sunday then you can configure an auto-start schedule to not start the VMs over the weekend.
Steps to configure auto-start of Azure Virtual Machine
- Log in to the Microsoft Azure portal.
- Search for Azure Devtest labs, If you have already created an Azure DevTest Lab service then you go to Configuration Settings and configure Auto Start and Auto Shutdown schedules.
- You will first have to Configure auto-start at the DevTest Lab Service Level and then you can enable it for each individual virtual machine.
- The auto-start schedule can only be configured at DevTest Lab Service level which will apply to all the virtual machines. At the VM level, you just need to enable Auto-Start. Let’s see the steps to configure it.
- Click on Devtest Lab Service in Azure and then Select Configuration and Policies under settings.
- Auto-start enables you to automatically initiate virtual machines in a lab at a predetermined time every day. To allow auto-start for VMs, you need to configure the following settings:
- Configure auto-start to enable and set up a schedule.
- Enable auto-start for each individual VM at the VM level.
- Allow auto-start: Yes
- Scheduled start: Provide a specific time at which you want the VMs to automatically power up every day. This allows you to schedule when the VMs should start.
- Time zone: Set the time zone.
- Day of the Week: Select the days on which you apply this schedule.
- Click on Save to save the auto-start schedule.
After configuring the auto-start schedule in the devtest lab configuration and service, you’ll also need to enable auto-start at the virtual machine level. To apply the auto-start schedule to a virtual machine, follow these steps:
- Click on DevTest Lab service
- Click on Virtual Machines and Select your Virtual Machine.
- On the left-hand side of the page, Find Auto-start under Operations.
- Select Yes to Enable Virtual machine automatic restart as per the schedule configured.
This setting will enable auto-start on this VM and the auto-start schedule which we have configured earlier from Configuration and service under DevTest lab service will be applicable. For example. In this case. This Virtual Machine will start every day at 7:00 AM. This schedule will apply only from Monday to Friday.
Once you’ve configured and enabled the auto-start feature for an Azure Virtual Machine, you also have the option to enable auto-shutdown. By using both auto-start and auto-shutdown settings, you can specify when you want the VMs to power up and power down at specific times. These settings are powerful tools for cost-saving on virtual machine computing expenses.
To configure the auto-shutdown settings of an Azure Virtual Machine in a DevTest Lab, you can search for a virtual machine under your DevTest Lab service and then locate the “Auto-shutdown” option under “Operations.” I won’t go into the details of auto-shutdown settings in this blog post, as it’s similar to the auto-start settings of any virtual machine in Azure we configured in the previous sections.
It is highly recommended to configure auto-start and auto-shutdown settings for developer machines or any virtual machines that are not in continuous use. Configure these settings at the DevTest Lab service level and enable auto-start for each VM individually.
Combining auto-start with auto-shutdown settings ensures that your machines power up at a scheduled time every day and shut down at a set time. This approach helps save on VM computing costs and reduces your monthly bill.