Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

Create lab VMs in Azure DevTest Labs

Feedback

In this article

This article describes how to create Azure virtual machines (VMs) in Azure DevTest Labs by using the Azure portal. You can also create DevTest Labs VMs by usingPowerShell,Azure CLI, anARM template, or from ashared image gallery.

Prerequisite

  • At leastuser access to a lab in DevTest Labs.

Configure basic settings

  1. In theAzure portal, go to theOverview page for your lab.

  2. On the labOverview page, selectAdd.

    Screenshot that shows the lab overview page with the Add button.

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

  4. On theBasic Settings tab of theCreate 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, underSecret, select the secret to use from the dropdown list. For more information, seeStore secrets in a key vault.
    • Password: If you don't 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 selectChange Size to select a different size. For more information about default VM sizes, seeDefault VM sizes.
    • Allow hibernation: Select this option to enable hibernation for the virtual machine.

      Note

      If you enable hibernation, you must also select eitherPublic IP orPrivate IP inAdvanced Settings. Hibernation forShared IPs isn't currently supported.

    • OS disk type: Keep the default value for the base, or select a different option from the dropdown list.
    • Security type: You can selectTrusted launch to enable trusted launch for Generation 2 VMs. If you selectTrusted launch, select theEnable secure boot,Enable vTPM, andIntegrity monitoring checkboxes as needed. For more information, seeTrusted Launch for Azure virtual machines.
    • Artifacts: Optionally, selectAdd or Remove Artifacts to select and configure artifacts to add to the VM. For instructions, seeAdd artifacts.

    Screenshot that shows the VM Basic Settings page.

Default VM sizes

The defaultVirtual machine size that appears inBasic Settings depends on the chosenImage Base architecture and the lab'sAllowed virtual machine sizes policy setting. For more information, seeSet allowed virtual machine sizes.

If the lab'sConfiguration and policies >Allowed virtual machine sizes policy allowsAll sizes:

  • For an image base with x64 architecture, the default size isD4s_v5.
  • For an image base with Arm64 architecture, the default size isD4pls_v5.

If the lab'sConfiguration and policies >Allowed virtual machine sizes policy allows only limitedSelected sizes:

  • IfD4s_v5 VM size is allowed, the default size isD4s_v5 for an image base with x64 architecture.
  • IfD4pls_v5 VM size is allowed, the default size isD4pls_v5 for an image base with Arm64 architecture.
  • IfD4s_v5 size isn't allowed for x64 architectures, orD4pls_v5 size isn't allowed for Arm64 architectures:
    • If a 4-core nonpremium CPU size is available, the first available 4-core nonpremium CPU size is selected.
    • If no 4-core nonpremium CPU size is available, the first available 4-core CPU size is selected.
    • If no 4-core CPU size is available, the first available CPU size is selected.

Add artifacts

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

You can add artifacts to VMs before or after VM creation. To add artifacts after VM creation, seeAdd artifacts to VMs after creation.

To add or configure artifacts during VM creation:

  1. At the bottom of theBasic Settings tab of theCreate lab resource screen, selectAdd or Remove Artifacts.

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

  3. On eachAdd artifact pane, enter any required and optional parameter values, and then selectOK. The artifact appears underSelected artifacts, and the number of configured artifacts updates.

    Screenshot that shows adding artifacts to a VM.

  4. When you're done adding artifacts, selectOK on theAdd artifacts page.

Configure other settings

After you configure basic settings and artifacts, you can optionally configure advanced settings and tags for your VM.

  1. Optionally, selectNext: Advanced Settings or theAdvanced Settings tab on theCreate lab resource screen, and change any of the following values:

    • Virtual network: Select a network from the dropdown list. For more information, seeAdd a virtual network.
    • Subnet Selector: If necessary, select a different subnet from the dropdown list.
    • IP address: Leave atShared, or selectPublic orPrivate. For more information, seeUnderstand shared IP addresses.
    • Expiration date: Leave atWill not expire, orset an expiration date and time for the VM.
    • Make this machine claimable: Leave atNo to keep yourself as the owner of the VM. SelectYes to make the VM claimable by any lab user after creation. For more information, seeCreate 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 this button to view and save the VM configuration as an Azure Resource Manager (ARM) template. You can use the ARM template todeploy new VMs.

    Screenshot that shows the VM Advanced Settings page.

  2. Optionally, selectNext: Tags or theTags tab to apply tags to the VM.

Complete VM deployment

After you configure all settings, selectCreate at the bottom of theCreate lab resource screen. During VM deployment, you can select theNotifications 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 underMy virtual machines on the labOverview page. To connect to the VM, select it from the list, and then selectConnect on the VM'sOverview page.

Or, if you choseMake this machine claimable during VM creation, selectClaimable virtual machines in the left navigation to see the VM listed on theClaimable virtual machines page. SelectRefresh if the VM doesn't appear. To take ownership of a VM in the claimable list, seeUse a claimable VM.

Screenshot that shows the lab VM creation status page.

When you create a VM in DevTest Labs, you automatically have permission to access that VM, and you can see the VM listed both on the labOverview page and theAll resources page.

DevTest Labs users in theOwner andContributor roles can see all lab VMs on the lab'sAll Resources page. Users in theDevTest Labs User role can't access other users' VM resources by default, so they don't automatically see those VMs on theAll resources page.

Copy existing Azure VMs into a lab

You can copy existing Azure VMs to DevTest Labs as follows:

  1. Use aPowerShell script to copy your existing VM's virtual hard disk (VHD) file to the lab.
  2. Use the VHD file tocreate a custom image in your lab.
  3. Create a lab VM from your custom image.

Related content


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?