title | description | ms.topic | ms.author | author | ms.date |
---|---|---|---|---|---|
Create and add a virtual machine to a lab |
Learn how to use the Azure portal to add a virtual machine (VM) to a lab in Azure DevTest Labs. Configure basic settings, artifacts, and advanced settings. |
how-to |
rosemalcolm |
RoseHJM |
03/03/2022 |
This article describes how to create Azure virtual machines (VMs) in Azure DevTest Labs by using the Azure portal.
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.
-
In the Azure portal, go to the Overview page for the lab.
-
On the lab Overview page, select Add.
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-add-vm.png" alt-text="Lab overview page showing add button.":::
-
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.
-
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.
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-vm-basic-settings.png" alt-text="Virtual machine basic settings page.":::
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:
-
On the Basic Settings tab of the Create lab resource screen, select Add or Remove Artifacts.
-
On the Add artifacts page, select the arrow next to each artifact you want to add to the VM.
-
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.
:::image type="content" source="./media/devtest-lab-add-vm/portal-add-artifact-during.png" alt-text="Add artifact to virtual machine.":::
-
When you're done adding artifacts, select OK on the Add artifacts page.
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.
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-vm-advanced-settings.png" alt-text="Virtual machine advanced settings page.":::
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.
:::image type="content" source="./media/devtest-lab-add-vm/portal-lab-vm-creation-status.png" alt-text="Lab VM creation status page.":::
- Add artifacts to VMs after creation.
- Create DevTest Labs VMs by using PowerShell, Azure CLI, an ARM template, or from a shared image gallery.
- Explore the DevTest Labs public repositories of artifacts, environments, and QuickStart ARM templates.