az lab vm
Manage VMs in an Azure DevTest Lab.
Commands
az lab vm apply-artifacts |
Apply artifacts to a virtual machine in Azure DevTest Lab. |
az lab vm claim |
Claim a virtual machine from the Lab. |
az lab vm create |
Create a VM in a lab. |
az lab vm delete |
Delete virtual machine. |
az lab vm list |
List the VMs in an Azure DevTest Lab. |
az lab vm show |
Get virtual machine. |
az lab vm start |
Start a virtual machine. |
az lab vm stop |
Stop a virtual machine This operation can take a while to complete. |
az lab vm apply-artifacts
Apply artifacts to a virtual machine in Azure DevTest Lab.
az lab vm apply-artifacts --lab-name
--name
--resource-group
[--artifacts]
Examples
Apply artifacts to a virtual machine in Azure DevTest Lab. (autogenerated)
az lab vm apply-artifacts --artifacts '@artifacts.json' --lab-name MyLab --name MyVirtualMachine --resource-group MyResourceGroup
Required Parameters
Name of the Lab.
Name of the virtual machine.
Name of lab's resource group.
Optional Parameters
JSON encoded array of artifacts to be applied. Use '@{file}' to load from a file.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az lab vm claim
Claim a virtual machine from the Lab.
az lab vm claim [--ids]
[--lab-name]
[--name]
[--resource-group]
[--subscription]
Examples
Claim any available virtual machine in the lab.
az lab vm claim -g {ResourceGroup} --lab-name {LabName}
Claim a specific virtual machine in the lab.
az lab vm claim -g {ResourceGroup} --lab-name {LabName} --name {VMName}
Claim multiple virtual machines in the lab by IDs.
az lab vm claim --ids \
/subscriptions/{SubID}/resourcegroups/{ResourceGroup}/providers/microsoft.devtestlab/labs/{LabName}/virtualmachines/{VMName1} \
/subscriptions/{SubID}/resourcegroups/{ResourceGroup}/providers/microsoft.devtestlab/labs/{LabName}/virtualmachines/{VMName2}
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the lab.
Name of the virtual machine to claim.
Name of lab's resource group.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az lab vm create
Create a VM in a lab.
az lab vm create --lab-name
--name
--resource-group
[--admin-password]
[--admin-username]
[--allow-claim]
[--artifacts]
[--authentication-type]
[--disk-type]
[--expiration-date]
[--formula]
[--generate-ssh-keys]
[--image]
[--image-type]
[--ip-configuration]
[--notes]
[--saved-secret]
[--size]
[--ssh-key]
[--subnet]
[--tags]
[--vnet-name]
Examples
Create a VM in the lab from a gallery image.
az lab vm create --lab-name {LabName} -g {ResourceGroup} --name {VMName} --image "Ubuntu Server 16.04 LTS" --image-type gallery --size Standard_DS1_v2
Create a VM in the lab from a gallery image with SSH authentication.
az lab vm create --lab-name {LabName} -g {ResourceGroup} --name {VMName} --image "Ubuntu Server 16.04 LTS" --image-type gallery --size Standard_DS1_v2 --authentication-type ssh
Create a claimable VM in the lab from a gallery image with password authentication.
az lab vm create --lab-name {LabName} -g {ResourceGroup} --name {VMName} --image "Ubuntu Server 16.04 LTS" --image-type gallery --size Standard_DS1_v2 --allow-claim
Create a windows VM in the lab from a gallery image with password authentication.
az lab vm create --lab-name {LabName} -g {ResourceGroup} --name {VMName} --image "Windows Server 2008 R2 SP1" --image-type gallery --size Standard_DS1_v2
Create a VM in the lab from a custom image.
az lab vm create --lab-name {LabName} -g {ResourceGroup} --name {VMName} --image "jenkins_custom" --image-type custom --size Standard_DS1_v2
Create a VM in the lab with a public IP.
az lab vm create --lab-name {LabName} -g {ResourceGroup} --name {VMName} --image "Ubuntu Server 16.04 LTS" --image-type gallery --size Standard_DS1_v2 --ip-configuration public
Create a VM from a formula.
az lab vm create --lab-name {LabName} -g {ResourceGroup} --name {VMName} --formula MyFormula --artifacts '@artifacts.json'
Required Parameters
Name of the lab.
Name of the virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Password for the VM admin.
Username for the VM admin.
Flag indicating if the VM should be created as claimable.
JSON encoded array of artifacts to be applied. Use '@{file}' to load from a file.
Type of authentication allowed for the VM. Allowed values are: password, ssh.
Storage type to use for virtual machine. Allowed values are: Premium, Standard, StandardSSD.
The expiration date in UTC(yyyy-MM-ddTHH:mm:ss) for the VM.
Name of the formula. Use az lab formula list
for available formulas.
Generate SSH public and private key files if missing.
The name of the operating system image (gallery image name or custom image name/ID).
Type of the image. Allowed values are: gallery, custom.
Type of IP configuration to use for the VM. Allowed values are: shared, public, private.
Notes for the virtual machine.
Name of the saved secret to be used for authentication.
The size of the VM to be created. See https://azure.microsoft.com/pricing/details/virtual-machines/ for size info.
The SSH public key or public key file path. Use --generate-ssh-keys
to generate SSH keys.
Name of the subnet to add the VM to.
Space-separated tags in key[=value]
format.
Name of the virtual network to add the VM to.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az lab vm delete
Delete virtual machine.
This operation can take a while to complete.
az lab vm delete --lab-name
--name
--resource-group
Required Parameters
The name of the lab.
The name of the virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az lab vm list
List the VMs in an Azure DevTest Lab.
az lab vm list --lab-name
--resource-group
[--all]
[--claimable]
[--environment]
[--expand]
[--filters]
[--object-id]
[--order-by]
[--top]
Examples
List the VMs in an Azure DevTest Lab. (autogenerated)
az lab vm list --lab-name MyLab --resource-group MyResourceGroup
Required Parameters
Name of the lab.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
List all virtual machines in the lab. Cannot be used with --filters
.
List only claimable virtual machines in the lab. Cannot be used with --filters
.
Name or ID of the environment to list virtual machines in. Cannot be used with --filters
.
The expand query.
The filter to apply.
Object ID of the owner to list VMs for.
The ordering expression for the results using OData notation.
The maximum number of resources to return.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az lab vm show
Get virtual machine.
az lab vm show --lab-name
--name
--resource-group
[--expand]
Required Parameters
The name of the lab.
The name of the virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az lab vm start
Start a virtual machine.
This operation can take a while to complete.
az lab vm start --lab-name
--name
--resource-group
Required Parameters
The name of the lab.
The name of the virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az lab vm stop
Stop a virtual machine This operation can take a while to complete.
az lab vm stop --lab-name
--name
--resource-group
Required Parameters
The name of the lab.
The name of the virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Feedback
Submit and view feedback for