This post was written by Sagar Chandra Reddy Lankala in collaboration with Ji Eun Kwon. Sagar and Ji Eun currently serve as the Program Managers for Azure Lab Services at Microsoft.
Azure Lab Services is a managed cloud service that enables educators and IT to easily roll out cost-efficient labs with customizable virtual machines, without having to master the complexities of setting up cloud infrastructure.
Azure Lab Services helps to quickly create virtual lab environments and enables IT admins to easily run a class, set up a training lab, or host a hackathon in the cloud so that users can access lab resources from anywhere, anytime.
Azure Lab Services provides the following key capabilities:
Simple User Experience –Provide immediate access to VMs for invited users. With one click users can connect and start working - no Azure subscription needed.
Flexibility – Use thousands of Azure Marketplace images or bring in your custom images to quickly provision lab VMs and use repeatedly across labs
Cost Optimization and Tracking – Manage your lab budget with usage control features. Schedule designated usage times or set up recurring auto-shutdowns and start times. Track individuals’ hourly usage or limit usage by setting up quotas.
Automatic Management and Scaling - Provisioning and scaling to hundreds of VMs with a single click, with the service managing all underlying infrastructure
Azure Lab Services has recently rolled out new cost control features that will proactively prevent waste of virtual machine usage hours inside the labs! The combination of these three automatic shutdown and disconnect features will now catch most of the cases where users accidentally leave their virtual machines running:
These settings can be configured at both the lab account level and the lab level. If the settings are enabled at the lab account level, they will be applied to all labs within the lab account. Any changes to the settings made at the lab level will override the lab account level configuration. For all new lab accounts, these settings will be turned on by default.
Let’s look at what each setting does in detail.
Automatically disconnect users from virtual machines that the OS deems idle (Windows-only)
This is a setting that is only available for Windows virtual machines. When the setting is turned on, any machines in the lab, including the template virtual machine, will automatically disconnect the user when the Windows OS deems the session to be idle. Windows OS’s definition of idle uses two criteria:
User absence – no keyboard or mouse input
Lack of resource consumption – all the processors and all the disks were idle for a certain % of time
Users will see a message like this inside the virtual machines before they are disconnected:
Please note that the virtual machine is still running when the user is disconnected. If the user reconnects to the virtual machine by signing in, windows or files that were open or unsaved work previous to the disconnect will still be there. In this state, because the virtual machine is running, it still counts as active and accrues cost.
To automatically shut down the idle Windows virtual machines that are disconnected, use the combination of “Disconnect users when virtual machines are idle” and “Shut down virtual machines when users disconnect” settings.
For example, if you configure the settings as follows:
Disconnect users when virtual machines are idle – 15 minutes after idle state is detected
Shut down virtual machines when users disconnect” – 5 minutes after user disconnects
The Windows virtual machines will automatically shutdown 20 minutes after the user stops using them.
Automatically shut down virtual machines when users disconnect (Windows & Linux)
This setting now supports both Windows and Linux virtual machines. When this setting is on, automatic shutdown will occur when:
For Windows, Remote Desktop (RDP) connection is disconnected