az azurestackhci virtualmachine

Note

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

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage virtualmachine with azurestackhci.

Commands

Name Description Type Status
az azurestackhci virtualmachine create

Create a VM.

Extension Experimental
az azurestackhci virtualmachine delete

Delete a VM.

Extension Experimental
az azurestackhci virtualmachine extension

Manage virtualmachine extension with azurestackhci.

Extension Experimental
az azurestackhci virtualmachine extension create

Create a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension delete

Delete a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension list

List all the extensions for a virtualmachine.

Extension Experimental
az azurestackhci virtualmachine extension show

Get the details of a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension update

Update a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension wait

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

Extension Experimental
az azurestackhci virtualmachine list

List all the VMs.

Extension Experimental
az azurestackhci virtualmachine restart

Restart a VM.

Extension Experimental
az azurestackhci virtualmachine show

Get the details of a VM.

Extension Experimental
az azurestackhci virtualmachine start

Start a stopped VM.

Extension Experimental
az azurestackhci virtualmachine stop

Power off (stop) a running VM.

Extension Experimental
az azurestackhci virtualmachine update

Update a VM.

Extension Experimental
az azurestackhci virtualmachine vnic

Manage vNIC of a virtual machine with azurestackhci.

Extension Experimental
az azurestackhci virtualmachine vnic add

Add existing vNICs to a VM.

Extension Experimental
az azurestackhci virtualmachine vnic remove

Remove vNICs from a VM.

Extension Experimental

az azurestackhci virtualmachine create

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a VM.

az azurestackhci virtualmachine create --name
                                       --resource-group
                                       [--admin-password]
                                       [--admin-username]
                                       [--allow-password-auth {false, true}]
                                       [--computer-name]
                                       [--data-disk]
                                       [--disable-vm-management {false, true}]
                                       [--enable-tpm]
                                       [--extended-location]
                                       [--hardware-profile]
                                       [--image-reference]
                                       [--linux-configuration]
                                       [--location]
                                       [--network-profile]
                                       [--nic-id]
                                       [--os-disk]
                                       [--os-profile]
                                       [--security-profile]
                                       [--ssh-public-keys]
                                       [--storage-profile]
                                       [--storagepath-id]
                                       [--tags]
                                       [--vm-size]
                                       [--windows-configuration]

Examples

PutVirtualMachine

az azurestackhci virtualmachine create --resource-group "test-rg" --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio n/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --hardware-profile vm-size="Default" --nic-id "test-nic" --computer-name "test-machine" --admin-username xxx --admin-password xxx --ssh-public-keys /path/to/public_key.pub --image-reference "test-gallery-image" --storagepath-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" --name "test-vm" --allow-password-auth true --disable-vm-management true

Required Parameters

--name

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

--admin-password

AdminPassword - Administrator Password.

--admin-username

AdminUsername - Administrator Username.

--allow-password-auth

Enable password authentication for Linux VM.

Whether to enable password authentication for Linux virtual machines.

Note: This flag has no effect on Windows virtual machines.

accepted values: false, true
--computer-name

Name of the Computer.

--data-disk

Names of the data disk VHD's being attached to the VM.

--disable-vm-management

To enable/disable vm Management agent. The default behaviour enables the provisioning for VM ARC agent.

accepted values: false, true
--enable-tpm

Enable tpm - Enable TPM in security settings for the VMs. If the flag is not provided, default value is False.

Usage: --enable-tpm=XX.

default value: False
--extended-location

Usage: --extended-location type=XX name=XX

type: The extended location type. name: The extended location name.

--hardware-profile

HardwareProfile - Specifies the hardware settings for the virtual machine.

Usage: --hardware-profile vm-size=XX processors=XX memory-mb=XX maximum-memory-mb=XX minimum-memory-mb=XX target-memory-buffer=XX

processors: number of processors for the virtual machine memory-mb: RAM in mb for the virtual machine maximum-memory-mb: Maximum dynamic memory in mb minimum-memory-mb: Minimum dynamic memory in mb target-memory-buffer: Target memory buffer.

--image-reference

ImageReference - gallery image name the vm should use to provision.

--linux-configuration

LinuxConfiguration - Specifies the security settings for the virtual machine.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--network-profile

NetworkProfile - describes the network configuration the virtual machine.

--nic-id

NicID - Network Interface id to attach to the virtual machine.

--os-disk

Id of the VHD being used to provision the VM.

--os-profile

OsProfile - describes the configuration of the operating system and sets login data Expected value: json-string/@json-file.

--security-profile

SecurityProfile - Specifies the security settings for the virtual machine.

Usage: --security-profile secure-boot-enabled=XX.

--ssh-public-keys

Path to SSH public keys.

--storage-profile

StorageProfile - contains information about the disks and storage information for the virtual machine Expected value: json-string/@json-file.

--storagepath-id

Azure ID of the Storage Path pointing to the location where the VM config files are stored.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--vm-size

VMSize - stock vm hardware configuration to use.

--windows-configuration

WindowsConfiguration - Windows Configuration for the virtual machine.

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

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a VM.

az azurestackhci virtualmachine delete [--ids]
                                       [--name]
                                       [--resource-group]
                                       [--subscription]
                                       [--yes]

Examples

DeleteVirtualMachine

az azurestackhci virtualmachine delete --resource-group "test-rg" --name "test-vm"

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

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.

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

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all the VMs.

az azurestackhci virtualmachine list [--resource-group]

Examples

ListVirtualMachineByResourceGroup

az azurestackhci virtualmachine list --resource-group "test-rg"

ListVirtualMachineBySubscription

az azurestackhci virtualmachine list

Optional Parameters

--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 azurestackhci virtualmachine restart

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Restart a VM.

az azurestackhci virtualmachine restart [--ids]
                                        [--name]
                                        [--resource-group]
                                        [--subscription]

Examples

RestartVirtualMachine

az azurestackhci virtualmachine restart --resource-group "test-rg" --name "test-vm"

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

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 azurestackhci virtualmachine show

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get the details of a VM.

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

Examples

GetVirtualMachine

az azurestackhci virtualmachine show --resource-group "test-rg" --name "test-vm"

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

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

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Start a stopped VM.

az azurestackhci virtualmachine start [--ids]
                                      [--name]
                                      [--resource-group]
                                      [--subscription]

Examples

StartVirtualMachine

az azurestackhci virtualmachine start --resource-group "test-rg" --name "test-vm"

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

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 azurestackhci virtualmachine stop

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Power off (stop) a running VM.

az azurestackhci virtualmachine stop [--ids]
                                     [--name]
                                     [--resource-group]
                                     [--subscription]

Examples

StopVirtualMachine

az azurestackhci virtualmachine stop --resource-group "test-rg" --name "test-vm"

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

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 azurestackhci virtualmachine update

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update a VM.

az azurestackhci virtualmachine update [--cpu-count]
                                       [--ids]
                                       [--memory-mb]
                                       [--name]
                                       [--resource-group]
                                       [--subscription]
                                       [--tags]
                                       [--vhd-names]
                                       [--vnic-names]

Examples

UpdateVirtualMachine

az azurestackhci virtualmachine update --resource-group "test-rg" --tags additionalProperties="sample" --name "test-vm" --cpu-count XX --memory-mb XX --vhd-names vhd1 vhd2 --vnic-names vnic1 vnic2

Optional Parameters

--cpu-count

Number of processors.

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

--memory-mb

Amount of RAM in mb.

--name

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.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--vhd-names

List of vhd names.

--vnic-names

List of vnic names.

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.