Share via


az networkcloud virtualmachine

Note

This reference is part of the networkcloud extension for the Azure CLI (version 2.66.0 or higher). The extension will automatically install the first time you run an az networkcloud virtualmachine command. Learn more about extensions.

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

Manage virtual machine.

Commands

Name Description Type Status
az networkcloud virtualmachine console

Manage virtual machine's console.

Extension Preview
az networkcloud virtualmachine console create

Create a new virtual machine console or update the properties of the existing virtual machine console.

Extension Preview
az networkcloud virtualmachine console delete

Delete the provided virtual machine console.

Extension Preview
az networkcloud virtualmachine console list

List consoles of the virtual machine.

Extension Preview
az networkcloud virtualmachine console show

Get properties of the provided virtual machine console.

Extension Preview
az networkcloud virtualmachine console update

Update the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag updates can be done independently.

Extension Preview
az networkcloud virtualmachine console wait

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

Extension Preview
az networkcloud virtualmachine create

Create a new virtual machine or update the properties of the existing virtual machine.

Extension Preview
az networkcloud virtualmachine delete

Delete the provided virtual machine.

Extension Preview
az networkcloud virtualmachine list

List virtual machines in the provided resource group or subscription.

Extension Preview
az networkcloud virtualmachine power-off

Power off the provided virtual machine.

Extension Preview
az networkcloud virtualmachine reimage

Reimage the provided virtual machine.

Extension Preview
az networkcloud virtualmachine restart

Restart the provided virtual machine.

Extension Preview
az networkcloud virtualmachine show

Get properties of the provided virtual machine.

Extension Preview
az networkcloud virtualmachine start

Start the provided virtual machine.

Extension Preview
az networkcloud virtualmachine update

Update the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently.

Extension Preview
az networkcloud virtualmachine wait

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

Extension Preview

az networkcloud virtualmachine create

Preview

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

Create a new virtual machine or update the properties of the existing virtual machine.

az networkcloud virtualmachine create --admin-username
                                      --cloud-services-network-attachment
                                      --cpu-cores
                                      --extended-location
                                      --memory-size
                                      --name
                                      --resource-group
                                      --storage-profile
                                      --vm-image
                                      [--boot-method {BIOS, UEFI}]
                                      [--generate-ssh-keys {0, 1, f, false, n, no, t, true, y, yes}]
                                      [--location]
                                      [--na]
                                      [--nd]
                                      [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                      [--ph]
                                      [--ssh-dest-key-path]
                                      [--ssh-key-values]
                                      [--tags]
                                      [--ud]
                                      [--vm-device-model {T1, T2}]
                                      [--vm-image-repository-credentials]

Examples

Create virtual machine

az networkcloud virtualmachine create --resource-group "resourceGroupName" --name "virtualMachineName" --extended-location name="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName" type="CustomLocation" --location "location" --admin-username "admin" --boot-method "UEFI" --cloud-services-network-attachment attached-network-id="/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/CloudServicesNetworks/cloudServicesNetworkName" --cpu-cores 2 --memory-size 8 --network-attachments "[{attachedNetworkId:'/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName',defaultGateway:'True',ipAllocationMethod:'Dynamic',ipv4Address:'198.51.100.1',ipv6Address:'2001:0db8:0000:0000:0000:0000:0000:0000',networkAttachmentName:'networkAttachmentName'}]" --network-data "bmV0d29ya0RhdGVTYW1wbGU=" --placement-hints "[{hintType:'Affinity',resourceId:'/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName',schedulingExecution:'Hard,scope:''}]" --ssh-key-values "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT= admin@vm" --storage-profile disk-size=120 create-option="Ephemeral" delete-option="Delete" --tags key1="myvalues1" --tags key2="myvalues2" --user-data "dXNlckRhdGVTYW1wbGU=" --vm-device-model "T2" --vm-image "myacr.azurecr.io/ubuntu-pw:20.04" --vm-image-repository-credentials password="password" registry-url="myacr.azurecr.io" username="username"

Required Parameters

--admin-username

The name of the administrator to which the ssh public keys will be added into the authorized keys.

--cloud-services-network-attachment --csn

The cloud service network that provides platform-level services for the virtual machine. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--cpu-cores

The number of CPU cores in the virtual machine.

--extended-location

The extended location of the cluster associated with the resource. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--memory-size --memory-size-gb --memory-size-gib

The memory size of the virtual machine in gibibytes.

--name --virtual-machine-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>.

--storage-profile

The storage profile that specifies size and other parameters about the disks related to the virtual machine. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--vm-image

The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image.

Optional Parameters

--boot-method

Selects the boot method for the virtual machine.

Accepted values: BIOS, UEFI
Default value: UEFI
--generate-ssh-keys

Generate SSH public and private key files if missing. The keys will be stored under '~/.ssh'.

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

The geo-location where the resource lives When not specified, the location of the resource group will be used.

--na --network-attachments

The list of network attachments to the virtual machine. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--nd --network-data

The Base64 encoded cloud-init network data.

--no-wait

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

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

The scheduling hints for the virtual machine. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--ssh-dest-key-path

The list of space-separated paths to ssh public keys. A file path can be provided or a directory. If a directory is provided will attempt to load all the public keys (.pub) found. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--ssh-key-values

The list of space-separated SSH public keys. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--tags

Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--ud --user-data

The Base64 encoded cloud-init user data.

--vm-device-model

The type of the device model to use.

Accepted values: T1, T2
Default value: T2
--vm-image-repository-credentials --vmi-creds

The credentials used to login to the image repository that has access to the specified image. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

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 networkcloud virtualmachine delete

Preview

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

Delete the provided virtual machine.

az networkcloud virtualmachine delete [--ids]
                                      [--name]
                                      [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                      [--resource-group]
                                      [--subscription]
                                      [--yes]

Examples

Delete virtual machine

az networkcloud virtualmachine delete --resource-group "resourceGroupName" --name "virtualMachineName"

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.

--name --virtual-machine-name -n

The name of the virtual machine.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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.

--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 networkcloud virtualmachine list

Preview

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

List virtual machines in the provided resource group or subscription.

az networkcloud virtualmachine list [--max-items]
                                    [--next-token]
                                    [--resource-group]

Examples

List virtual machines for resource group

az networkcloud virtualmachine list --resource-group "resourceGroupName"

List virtual machines for subscription

az networkcloud virtualmachine list

Optional Parameters

--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.

--resource-group -g

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

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 networkcloud virtualmachine power-off

Preview

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

Power off the provided virtual machine.

az networkcloud virtualmachine power-off [--ids]
                                         [--name]
                                         [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                         [--resource-group]
                                         [--skip-shutdown {False, True}]
                                         [--subscription]

Examples

Power off virtual machine

az networkcloud virtualmachine power-off --resource-group "resourceGroupName" --name "virtualMachineName" --skip-shutdown "True"

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.

--name --virtual-machine-name -n

The name of the virtual machine.

--no-wait

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

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

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

--skip-shutdown

The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately.

Accepted values: False, True
Default value: False
--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 networkcloud virtualmachine reimage

Preview

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

Reimage the provided virtual machine.

az networkcloud virtualmachine reimage [--ids]
                                       [--name]
                                       [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--resource-group]
                                       [--subscription]

Examples

Reimage virtual machine

az networkcloud virtualmachine reimage --resource-group "resourceGroupName" --name "virtualMachineName"

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.

--name --virtual-machine-name -n

The name of the virtual machine.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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 networkcloud virtualmachine restart

Preview

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

Restart the provided virtual machine.

az networkcloud virtualmachine restart [--ids]
                                       [--name]
                                       [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--resource-group]
                                       [--subscription]

Examples

Restart virtual machine

az networkcloud virtualmachine restart --resource-group "resourceGroupName" --name "virtualMachineName"

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.

--name --virtual-machine-name -n

The name of the virtual machine.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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 networkcloud virtualmachine show

Preview

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

Get properties of the provided virtual machine.

az networkcloud virtualmachine show [--ids]
                                    [--name]
                                    [--resource-group]
                                    [--subscription]

Examples

Get virtual machine

az networkcloud virtualmachine show --resource-group "resourceGroupName" --name "virtualMachineName"

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.

--name --virtual-machine-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>.

--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 networkcloud virtualmachine start

Preview

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

Start the provided virtual machine.

az networkcloud virtualmachine start [--ids]
                                     [--name]
                                     [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                     [--resource-group]
                                     [--subscription]

Examples

Start virtual machine

az networkcloud virtualmachine start --resource-group "resourceGroupName" --name "virtualMachineName"

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.

--name --virtual-machine-name -n

The name of the virtual machine.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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 networkcloud virtualmachine update

Preview

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

Update the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently.

az networkcloud virtualmachine update [--ids]
                                      [--name]
                                      [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                      [--resource-group]
                                      [--subscription]
                                      [--tags]
                                      [--vm-image-repository-credentials]

Examples

Patch virtual machine

az networkcloud virtualmachine update --resource-group "resourceGroupName" --name "virtualMachineName" --vm-image-repository-credentials password="password" registry-url="myacr.azurecr.io" username="myuser" --tags key1="myvalue1" key2="myvalue2"

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.

--name --virtual-machine-name -n

The name of the virtual machine.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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.

--tags

The Azure resource tags that will replace the existing ones. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--vm-image-repository-credentials --vmi-creds

The credentials used to login to the image repository that has access to the specified image. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

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 networkcloud virtualmachine wait

Preview

Command group 'az networkcloud' 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 networkcloud virtualmachine wait [--created]
                                    [--custom]
                                    [--deleted]
                                    [--exists]
                                    [--ids]
                                    [--interval]
                                    [--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
--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
--name --virtual-machine-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>.

--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.