שתף באמצעות


az lab vm

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage VMs in an azure devtest lab.

Commands

Name Description Type Status
az lab vm apply-artifacts

Apply artifacts to virtual machine. This operation can take a while to complete.

Core Preview
az lab vm claim

Command to claim a VM in the Azure DevTest Lab.

Core Preview
az lab vm create

Create a VM in a lab.

Core Preview
az lab vm delete

Delete virtual machine. This operation can take a while to complete.

Core Preview
az lab vm list

List virtual machines in a given lab.

Core Preview
az lab vm show

Show virtual machine.

Core Preview
az lab vm start

Start a virtual machine. This operation can take a while to complete.

Core Preview
az lab vm stop

Stop a virtual machine This operation can take a while to complete.

Core Preview
az lab vm wait

Place the CLI in a waiting state until a condition is met.

Core Preview

az lab vm apply-artifacts

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Apply artifacts to virtual machine. This operation can take a while to complete.

az lab vm apply-artifacts --lab-name
                          --name
                          --resource-group
                          [--artifacts]
                          [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]

Examples

Apply artifacts to a virtual machine in Azure DevTest Lab.

az lab vm apply-artifacts --artifacts artifacts.json --lab-name MyLab --name MyVirtualMachine --resource-group MyResourceGroup

Required Parameters

--lab-name

The name of the lab.

--name -n

The name of the virtual machine.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--artifacts

Path to the JSON encoded array of artifacts to be applied. JSON encoded list of parameters.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm claim

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Command to claim a VM in the Azure DevTest Lab.

az lab vm claim [--ids]
                [--lab-name]
                [--name]
                [--resource-group]
                [--subscription]

Optional Parameters

--ids

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.

--lab-name

Name of the lab.

--name -n

Name of the virtual machine to claim.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm create

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a VM in a lab.

az lab vm create --lab-name
                 --name
                 --resource-group
                 [--admin-password]
                 [--admin-username]
                 [--allow-claim {0, 1, f, false, n, no, t, true, y, yes}]
                 [--artifacts]
                 [--authentication-type {password, ssh}]
                 [--disk-type {Premium, Standard, StandardSSD}]
                 [--expiration-date]
                 [--formula]
                 [--generate-ssh-keys {0, 1, f, false, n, no, t, true, y, yes}]
                 [--image]
                 [--image-type {custom, gallery}]
                 [--ip-configuration {private, public, shared}]
                 [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                 [--notes]
                 [--saved-secret]
                 [--size]
                 [--ssh-key]
                 [--subnet]
                 [--tags]
                 [--vnet-name]

Required Parameters

--lab-name

The name of the lab.

--name -n

The name of the virtual machine or environment.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--admin-password

Password for the VM admin.

--admin-username

Username for the VM admin.

Default value: your_system_user_login_name
--allow-claim

Flag indicating if the VM should be created as claimable.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Default value: False
--artifacts

Path to the JSON encoded array of artifacts to be applied. JSON encoded list of parameters.

--authentication-type

Type of authentication allowed for the VM.

Accepted values: password, ssh
Default value: password
--disk-type

Storage type to use for virtual machine.

Accepted values: Premium, Standard, StandardSSD
--expiration-date

The expiration date for VM.

--formula

Name of the formula. Use az lab formula list for available formulas. Use az lab formula with the --export-artifacts flag to export and update artifacts, then pass the results via the --artifacts argument.

--generate-ssh-keys

Generate SSH public and private key files if missing.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--image

The name of the operating system image (gallery image name or custom image name/ID). Use az lab gallery-image list for available gallery images or az lab custom-image list for available custom images.

--image-type

Type of the image.

Accepted values: custom, gallery
--ip-configuration

Type of IP configuration to use for the VM.

Accepted values: private, public, shared
--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--notes

The notes of the virtual machine.

--saved-secret

Name of the saved secret to be used for authentication. When this value is provided, it is used in the place of other authentication methods.

--size

The size of the VM to be created. See https://azure.microsoft.com/pricing/details/virtual-machines/ for size info.

--ssh-key

The SSH public key or public key file path. Use --generate-ssh-keys to generate SSH keys.

--subnet

Name of the subnet to add the VM to.

--tags

The tags of the resource. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--vnet-name

Name of the virtual network to add the VM to.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm delete

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete virtual machine. This operation can take a while to complete.

az lab vm delete --lab-name
                 --name
                 --resource-group
                 [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                 [--yes]

Required Parameters

--lab-name

The name of the lab.

--name

The name of the virtual machine.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm list

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List virtual machines in a given lab.

az lab vm list --lab-name
               --resource-group
               [--all {0, 1, f, false, n, no, t, true, y, yes}]
               [--claimable {0, 1, f, false, n, no, t, true, y, yes}]
               [--environment]
               [--expand]
               [--filters]
               [--max-items]
               [--next-token]
               [--object-id]
               [--order-by]
               [--top]

Examples

List the VMs in an Azure DevTest Lab.

az lab vm list --lab-name MyLab --resource-group MyResourceGroup

Required Parameters

--lab-name

The name of the lab.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--all

List all virtual machines in the lab. Cannot be used with --filters.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--claimable

List only claimable virtual machines in the lab. Cannot be used with --filters.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--environment

Name or ID of the environment to list virtual machines in. Cannot be used with --filters.

--expand

Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'.

--filters

The filter to apply to the operation. Example: '$filter=contains(name,'myName').

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

--object-id

Object ID of the owner to list VMs for.

--order-by

The ordering expression for the results, using OData notation. Example: '$orderby=name desc'.

--top

The maximum number of resources to return from the operation. Example: '$top=10'.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm show

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show virtual machine.

az lab vm show --lab-name
               --name
               --resource-group
               [--expand]

Required Parameters

--lab-name

The name of the lab.

--name

The name of the virtual machine.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--expand

Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm start

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Start a virtual machine. This operation can take a while to complete.

az lab vm start --lab-name
                --name
                --resource-group
                [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]

Required Parameters

--lab-name

The name of the lab.

--name

The name of the virtual machine.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm stop

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Stop a virtual machine This operation can take a while to complete.

az lab vm stop --lab-name
               --name
               --resource-group
               [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]

Required Parameters

--lab-name

The name of the lab.

--name

The name of the virtual machine.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az lab vm wait

Preview

Command group 'lab' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Place the CLI in a waiting state until a condition is met.

az lab vm wait [--created]
               [--custom]
               [--deleted]
               [--exists]
               [--expand]
               [--ids]
               [--interval]
               [--lab-name]
               [--name]
               [--resource-group]
               [--subscription]
               [--timeout]
               [--updated]

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--expand

Specify the $expand query. Example: 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'.

--ids

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.

--interval

Polling interval in seconds.

Default value: 30
--lab-name

The name of the lab.

--name

The name of the virtual machine.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.