Create and manage claimable VMs in Azure DevTest Labs

You add a claimable VM to a lab in a similar manner to how you add a standard VM – from a base that is either a custom image, formula, or Marketplace image. This tutorial walks you through using the Azure portal to add a claimable VM to a lab in DevTest Labs, and shows the processes a user follows to claim and unclaim the VM.

Steps to add a claimable VM to a lab in Azure DevTest Labs

  1. Sign in to the Azure portal.

  2. Select All Services and then in the DEVOPS section, select DevTest Labs. If you select * (star) next to DevTest Labs in the DEVOPS section. This action adds DevTest Labs to the left navigational menu so that you can access it easily the next time. Then, you can select DevTest Labs on the left navigational menu.

    Screenshot showing All services - select DevTest Labs.

  3. From the list of labs, select the lab in which you want to create the VM.

  4. On the lab's Overview page, select + Add.

    Screenshot showing the Add VM button.

  5. On the Choose a base page, select a marketplace image for the VM.

  6. On the Basic Settings tab of the Virtual machine page, do the following actions:

    1. Enter a name for the VM in the Virtual machine name text box. The text box is pre-filled for you with a unique autogenerated name. The name corresponds to the user name within your email address followed by a unique three-digit number. This feature saves you the time to think of a machine name and type it every time you create a machine. You can override this autofilled field with a name of your choice if you wish to. To override the autofilled name for the VM, enter a name in the Virtual machine name text box.

    2. Enter a User Name that is granted administrator privileges on the virtual machine. The user name for the machine is pre-filled with a unique autogenerated name. The name corresponds to the user name within your email address. This feature saves you the time to decide on a username every time you create a new machine. Again, you can override this autofilled field with a username of your choice if you wish to. To override the autofilled value for user name, enter a value in the User Name text box. This user is granted administrator privileges on the virtual machine.

    3. If you're creating first VM in the lab, enter a password for the user. To save this password as a default password in the Azure key vault associated with the lab, select Save as default password. The default password is saved in the key vault with the name: VmPassword. When you try to create subsequent VMs in the lab, VmPassword is automatically selected for the password. To override the value, clear the Use a saved secret check box, and enter a password.

      You can also save secrets in the key vault first and then use it while creating a VM in the lab. For more information, see Store secrets in a key vault. To use the password stored in the key vault, select Use a saved secret, and specify a key value that corresponds to your secret (password).

    4. In the More options section, select Change size. Select one of the predefined items that specify the processor cores, RAM size, and the hard drive size of the VM to create.

    5. Select the OS disk type.

      • Premium SSD disks offer high-performance, low-latency disk support for I/O-intensive applications and production workloads.
      • Standard SSD Disks are a cost effective storage option optimized for workloads that need consistent performance at lower IOPS levels.
      • Use Standard HDD disks for Dev/Test scenarios and less critical workloads at lowest cost.
    6. Select Add or Remove Artifacts. Select and configure the artifacts that you want to add to the base image.

    Note

    If you're new to DevTest Labs or configuring artifacts, refer to Add artifacts to DevTest Labs VMs, and then return here when finished.

  7. Switch to the Advanced Settings tab at the top, and do the following actions:

    1. To change the virtual network that the VM is in, select Change VNet.
    2. To change the subnet, select Change subnet.
    3. Specify whether the IP address of the VM is public, private, or shared.
    4. To automatically delete the VM, specify the expiration date and time.
    5. To make the VM claimable by a lab user, select Yes for Make this machine claimable option.
    6. Specify the number of the instances of VM that you want to make it available to your lab users.
  8. Select Create to add the specified VM to the lab.

    The lab page displays the status of the VM's creation - first as Creating, then as Running after the VM has been started.

Note

If you deploy lab VMs through Azure Resource Manager templates, you can create claimable VMs by setting the allowClaim property to true in the properties section.

Use a claimable VM

A user can claim any VM from the list of Claimable virtual machines by using one of these options:

Claim a specific VM

  1. On the lab's Overview page, on the left menu, select Claimable virtual machines.

  2. Right-click the VM you want to claim, and then select Claim machine.

    Screenshot showing requesting a specific claimable VM.

Claim any available VM

On the lab's Overview page, select Claim any. A random virtual machine is assigned from the list of claimable VMs.

Screenshot showing requesting any claimable VM.

After a user claims a VM, DevTest Labs will start the machine and move it up into lab user's list of My virtual machines. The lab user will now have owner privileges on this machine. The time required for this step may vary depending on startup times and any other custom actions being performed during the claim event. Once claimed, the machine is no longer available in the claimable pool.

Unclaim a VM

When a user is finished using a claimed VM and wants to make it available for someone else, they can return the claimed VM to the list of claimable virtual machines by using one of these options:

Unclaim a VM from a list of VMs

From the list of My virtual machines, right-click on one of the VMs in the list, or select its ellipsis ..., and choose Unclaim.

Screenshot showing unclaiming a VM on the list.

Unclaim a VM from its management pane

In the list of My virtual machines, select a VM to open its management pane, then select Unclaim from the top menu bar.

Screenshot showing unclaiming a VM on the VM's management pane.

When a user unclaims a VM, they no longer have owner permissions for that specific lab VM, and it's available to be claimed by any other lab user in the state that it was returned to the pool.

Transfer the data disk

If a claimable VM has a data disk attached to it and a user unclaims it, the data disk stays with the VM. When another user then claims that VM, that new user claims the data disk and the VM.

This action is called transferring the data disk. The data disk then becomes available in the new user's list of My data disks for them to manage.

Screenshot showing unclaiming data disks.

Next steps