แก้ไข

แชร์ผ่าน


Create lab virtual machines in Azure DevTest Labs

This article describes how to create Azure virtual machines (VMs) in Azure DevTest Labs by using the Azure portal.

Prerequisite

You need at least user access to a lab in DevTest Labs. For more information about creating labs, see Create a lab in the Azure portal.

Configure basic settings

  1. In the Azure portal, go to the Overview page for the lab.

  2. On the lab Overview page, select Add.

    Lab overview page showing add button.

  3. On the Choose a base page, select an image for the VM. You can choose Marketplace images, custom images, or formulas that the lab owner made available. The following instructions use Windows 11 Pro. Some bases might have different settings.

  4. On the Basics Settings tab of the Create lab resource screen, provide the following information:

    • Virtual machine name: Keep the autogenerated name, or enter another unique VM name.
    • User name: Keep the user name, or enter another user name to grant administrator privileges on the VM.
    • Use a saved secret: Select this checkbox to use a secret from Azure Key Vault instead of a password to access the VM. If you select this option, under Secret, select the secret to use from the dropdown list. For more information, see Store secrets in a key vault.
    • Password: If you don't choose to use a secret, enter a VM password between 8 and 123 characters long.
    • Save as default password: Select this checkbox to save the password in the Key Vault associated with the lab.
    • Virtual machine size: Keep the default value for the base, or select Change Size to select different sizes.
    • OS disk type: Keep the default value for the base, or select a different option from the dropdown list.
    • Artifacts: This field shows the number of artifacts already configured for this VM base. Optionally, select Add or Remove Artifacts to select and configure artifacts to add to the VM.

    Virtual machine basic settings page.

Add optional artifacts

Artifacts are tools, actions, or software you can add to lab VMs. You can add artifacts to VMs from the DevTest Labs public artifact repository, or from private artifact repositories connected to the lab. For more information, see Add artifacts to DevTest Labs VMs.

To add or modify artifacts during VM creation:

  1. On the Basic Settings tab of the Create lab resource screen, select Add or Remove Artifacts.

  2. On the Add artifacts page, select the arrow next to each artifact you want to add to the VM.

  3. On each Add artifact pane, enter any required and optional parameter values, and then select OK. The artifact appears under Selected artifacts, and the number of configured artifacts updates.

    Add artifact to virtual machine.

  4. When you're done adding artifacts, select OK on the Add artifacts page.

Configure optional advanced settings

Optionally, select the Advanced Settings tab on the Create lab resource screen, and change any of the following values:

  • Virtual network: Select a network from the dropdown list. For more information, see Add a virtual network.
  • Subnet: If necessary, select a different subnet from the dropdown list.
  • IP address: Leave at Shared, or select Public or Private. For more information, see Understand shared IP addresses.
  • Expiration date: Leave at Will not expire, or set an expiration date and time for the VM.
  • Make this machine claimable: Leave at No to keep yourself as the owner of the VM. Select Yes to make the VM claimable by any lab user after creation. For more information, see Create and manage claimable VMs.
  • Number of instances: To create more than one VM with this configuration, enter the number of VMs to create.
  • View ARM Template: Select to view and save the VM configuration as an Azure Resource Manager (ARM) template. You can use the ARM template to deploy new VMs with Azure PowerShell.

Virtual machine advanced settings page.

Complete the VM deployment

After you configure all settings, on the Basic Settings tab of the Create lab resource screen, select Create.

During VM deployment, you can select the Notifications icon at the top of the screen to see progress. Creating a VM takes a while.

When the deployment is complete, if you kept yourself as VM owner, the VM appears under My virtual machines on the lab Overview page. To connect to the VM, select it from the list, and then select Connect on the VM's Overview page.

Or, if you chose Make this machine claimable during VM creation, select Claimable virtual machines in the left navigation to see the VM listed on the Claimable virtual machines page. Select Refresh if your VM doesn't appear. To take ownership of a VM in the claimable list, see Use a claimable VM.

Lab VM creation status page.

When you create a VM in DevTest Labs, you're given permission to access that VM. You can view the VM both on the labs page and on the Virtual Machines page. Users assigned to the DevTest Labs Owner role can see all VMs that were created in the lab on the lab's All Virtual Machines page. However, users who have the DevTest Labs User role are not automatically granted read access to VM resources that other users have created. So, those VMs are not displayed on the Virtual Machines page.

Move existing Azure VMs into a DevTest Labs lab

To copy your existing VMs to DevTest Labs:

  1. Copy the VHD file of your existing VM by using a Windows PowerShell script.
  2. Create the custom image inside your DevTest Labs lab.
  3. Create a VM in the lab from your custom image.

Next steps