az stack-hci-vm
Note
This reference is part of the stack-hci-vm extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az stack-hci-vm command. Learn more about extensions.
Manage virtualmachine with stack-hci-vm.
Commands
Name | Description | Type | Status |
---|---|---|---|
az stack-hci-vm create |
Create a VM. |
Extension | GA |
az stack-hci-vm delete |
Delete a VM. |
Extension | GA |
az stack-hci-vm disk |
Manage virtualharddisk with stack-hci-vm. |
Extension | GA |
az stack-hci-vm disk attach |
Attach disk to a VM. |
Extension | GA |
az stack-hci-vm disk create |
Create a virtual hard disk. |
Extension | GA |
az stack-hci-vm disk delete |
Delete a virtual hard disk. |
Extension | GA |
az stack-hci-vm disk detach |
Detach disk from a VM. |
Extension | GA |
az stack-hci-vm disk list |
List all virtual hard disks. |
Extension | GA |
az stack-hci-vm disk show |
Get the details of a virtual hard disk. |
Extension | GA |
az stack-hci-vm disk update |
Update a virtual hard disk. |
Extension | GA |
az stack-hci-vm gpu |
Manage gpus with stack-hci-vm. |
Extension | GA |
az stack-hci-vm gpu attach |
Attach gpu to a VM (preview feature). |
Extension | GA |
az stack-hci-vm gpu detach |
Detach gpu from a VM (preview feature). |
Extension | GA |
az stack-hci-vm image |
Manage images with stack-hci-vm. |
Extension | GA |
az stack-hci-vm image create |
Create a gallery image. |
Extension | GA |
az stack-hci-vm image delete |
Delete an image. |
Extension | GA |
az stack-hci-vm image list |
List all gallery images. |
Extension | GA |
az stack-hci-vm image show |
Get the details of an image. |
Extension | GA |
az stack-hci-vm image update |
Update an image. |
Extension | GA |
az stack-hci-vm list |
List all the VMs. |
Extension | GA |
az stack-hci-vm network |
Manage network with stack-hvi-vm. |
Extension | GA |
az stack-hci-vm network lnet |
Manage logicalnetworks with stack-hci-vm. |
Extension | GA |
az stack-hci-vm network lnet create |
Create a logical network. |
Extension | GA |
az stack-hci-vm network lnet delete |
Delete a logical network. |
Extension | GA |
az stack-hci-vm network lnet list |
List all the logical networks. |
Extension | GA |
az stack-hci-vm network lnet show |
Get the details of a logical network. |
Extension | GA |
az stack-hci-vm network lnet update |
Update a logical network. |
Extension | GA |
az stack-hci-vm network nic |
Manage networkinterface with stack-hci-vm. |
Extension | GA |
az stack-hci-vm network nic create |
Create a network interface. |
Extension | GA |
az stack-hci-vm network nic delete |
Delete a network interface. |
Extension | GA |
az stack-hci-vm network nic list |
List all network interfaces. |
Extension | GA |
az stack-hci-vm network nic show |
Get the details of a network interface. |
Extension | GA |
az stack-hci-vm network nic update |
Update a network interface. |
Extension | GA |
az stack-hci-vm network nsg |
Manage Network Security Groups (NSGs). |
Extension | GA |
az stack-hci-vm network nsg create |
Create a network security group. |
Extension | GA |
az stack-hci-vm network nsg delete |
Delete a network security group. |
Extension | GA |
az stack-hci-vm network nsg list |
List network security groups. |
Extension | GA |
az stack-hci-vm network nsg rule |
Manage network security group rules. |
Extension | GA |
az stack-hci-vm network nsg rule create |
Create a network security group rule. |
Extension | GA |
az stack-hci-vm network nsg rule delete |
Delete a network security group rule. |
Extension | GA |
az stack-hci-vm network nsg rule list |
List all rules in a network security group. |
Extension | GA |
az stack-hci-vm network nsg rule show |
Get the details of a network security group rule. |
Extension | GA |
az stack-hci-vm network nsg rule update |
Update a network security group rule. |
Extension | GA |
az stack-hci-vm network nsg show |
Get information about a network security group. |
Extension | GA |
az stack-hci-vm network nsg update |
Update a network security group. |
Extension | GA |
az stack-hci-vm nic |
Manage vNIC of a virtual machine with stack-hci-vm. |
Extension | GA |
az stack-hci-vm nic add |
Add existing vNICs to a VM. |
Extension | GA |
az stack-hci-vm nic remove |
Remove vNICs from a VM. |
Extension | GA |
az stack-hci-vm pause |
Pause a VM. |
Extension | GA |
az stack-hci-vm restart |
Restart a VM. |
Extension | GA |
az stack-hci-vm save |
Save a VM. |
Extension | GA |
az stack-hci-vm show |
Get the details of a VM. |
Extension | GA |
az stack-hci-vm start |
Start a stopped VM. |
Extension | GA |
az stack-hci-vm stop |
Power off (stop) a running VM. |
Extension | GA |
az stack-hci-vm storagepath |
Manage storagepath with stack-hci-vm. |
Extension | GA |
az stack-hci-vm storagepath create |
Create a storage path. |
Extension | GA |
az stack-hci-vm storagepath delete |
Delete a storage path. |
Extension | GA |
az stack-hci-vm storagepath list |
List all the storage paths. |
Extension | GA |
az stack-hci-vm storagepath show |
Get the details of a storage path. |
Extension | GA |
az stack-hci-vm storagepath update |
Update a storage path. |
Extension | GA |
az stack-hci-vm update |
Update a VM. |
Extension | GA |
az stack-hci-vm create
Create a VM.
az stack-hci-vm create --custom-location
--name
--resource-group
[--admin-password]
[--admin-username]
[--attach-data-disks]
[--authentication-type {all, password, ssh}]
[--computer-name]
[--enable-agent {false, true}]
[--enable-secure-boot {false, true}]
[--enable-vm-config-agent {false, true}]
[--enable-vtpm {false, true}]
[--gpu-dda-count]
[--gpu-p-count]
[--gpus]
[--image]
[--location]
[--nics]
[--os-disk-name]
[--os-type {linux, windows}]
[--polling-interval]
[--proxy-configuration]
[--security-type {ConfidentialVM, TrustedLaunch}]
[--size]
[--ssh-dest-key-path]
[--ssh-key-values]
[--storage-path-id]
[--tags]
Examples
Create a Stack HCI VM
az stack-hci-vm create --resource-group "test-rg" --custom-location "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocatio n/customLocations/dogfood-location" --location "West US2" --size "Default" --nics "test-nic" --computer-name "test-machine" --admin-username xxx --admin-password xxx --image "test-gallery-image" --storage-path-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storagecontainers/test-storagepath" --name "test-vm" --authentication-type all --enable-agent true --ssh-key-values @key-file
Required Parameters
The ID of the extended location.
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 if authentication type is 'Password'.
Username for the VM.
Attach existing data disks to the VM. Can use the name or ID of a managed disk.
Type of authentication to use with the VM. Defaults to password for Windows and SSH public key for Linux. "all" enables both ssh and password authentication.
Name of the Computer.
Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later.
Enable secure boot.
Indicates whether virtual machine configuration agent should be provisioned on the virtual machine. When this property is not specified, default behavior is to set it to true.
Enable vtpm - Enable vTPM in security settings for the VMs. If the flag is not provided, default value is False.
Usage: --enable-vtpm=XX.
Number of GPU Discrete Device Assignment devices to be attached. i.e --gpu-dda-count 1.
Number of GPU Partition devices to be attached. i.e --gpu-p-count 1.
Space-separated list of one or more specifications of gpu to be attached. i.e --gpus GpuDDA,0 GpuDDA,0 or --gpus GpuP,4096 GpuP,4096.
Image - gallery image name the vm should use to provision.
If location is not specified, the location of the resource group is used.
Names or IDs of existing NICs to attach to the VM.
Os Disk - name of the vhd the vm should use to provision.
Type of OS installed on a custom VHD. Do not use when specifying an URN or URN alias.
ARM polling interval for long running operations.
ProxyConfiguration - describes the proxy configuration for the virtual machine.
Specifies the security type of the virtual machine.
The VM size to be created.
Destination file path on the VM for the SSH key.
Space-separated list of SSH public keys or public key file paths.
Azure ID of the Storage Path pointing to the location where the VM config files are stored.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Global Parameters
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 stack-hci-vm delete
Delete a VM.
az stack-hci-vm delete [--ids]
[--name]
[--polling-interval]
[--resource-group]
[--subscription]
[--yes]
Examples
DeleteVirtualMachine
az stack-hci-vm delete --resource-group "test-rg" --name "test-vm"
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 virtual machine.
ARM polling interval for long running operations.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
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 stack-hci-vm list
List all the VMs.
az stack-hci-vm list [--resource-group]
Examples
ListVirtualMachineByResourceGroup
az stack-hci-vm list --resource-group "test-rg"
ListVirtualMachineBySubscription
az stack-hci-vm list
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
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 stack-hci-vm pause
Pause a VM.
az stack-hci-vm pause [--ids]
[--name]
[--polling-interval]
[--resource-group]
[--subscription]
Examples
PauseVirtualMachine
az stack-hci-vm pause --resource-group "test-rg" --name "test-vm"
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 virtual machine.
ARM polling interval for long running operations.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
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 stack-hci-vm restart
Restart a VM.
az stack-hci-vm restart [--ids]
[--name]
[--polling-interval]
[--resource-group]
[--subscription]
Examples
RestartVirtualMachine
az stack-hci-vm restart --resource-group "test-rg" --name "test-vm"
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 virtual machine.
ARM polling interval for long running operations.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
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 stack-hci-vm save
Save a VM.
az stack-hci-vm save [--ids]
[--name]
[--polling-interval]
[--resource-group]
[--subscription]
Examples
SaveVirtualMachine
az stack-hci-vm save --resource-group "test-rg" --name "test-vm"
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 virtual machine.
ARM polling interval for long running operations.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
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 stack-hci-vm show
Get the details of a VM.
az stack-hci-vm show [--ids]
[--name]
[--resource-group]
[--subscription]
Examples
GetVirtualMachine
az stack-hci-vm show --resource-group "test-rg" --name "test-vm"
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 virtual machine.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
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 stack-hci-vm start
Start a stopped VM.
az stack-hci-vm start [--ids]
[--name]
[--polling-interval]
[--resource-group]
[--subscription]
Examples
StartVirtualMachine
az stack-hci-vm start --resource-group "test-rg" --name "test-vm"
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 virtual machine.
ARM polling interval for long running operations.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
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 stack-hci-vm stop
Power off (stop) a running VM.
az stack-hci-vm stop [--ids]
[--name]
[--polling-interval]
[--resource-group]
[--subscription]
Examples
StopVirtualMachine
az stack-hci-vm stop --resource-group "test-rg" --name "test-vm"
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 virtual machine.
ARM polling interval for long running operations.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
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 stack-hci-vm update
Update a VM.
az stack-hci-vm update [--add]
[--computer-name]
[--enable-agent {false, true}]
[--enable-vm-config-agent {false, true}]
[--force-string]
[--ids]
[--memory-mb]
[--name]
[--nics]
[--polling-interval]
[--remove]
[--resource-group]
[--set]
[--subscription]
[--tags]
[--v-cpus-available]
[--vhds]
Examples
UpdateVirtualMachine
az stack-hci-vm update --resource-group "test-rg" --tags additionalProperties="sample" --name "test-vm" --v-cpus-available XX --memory-mb XX
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>
.
Update the hostname of the VM.
Indicates whether virtual machine agent should be provisioned on the virtual machine during virtual machine update. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later.
Indicates whether virtual machine configuration agent should be provisioned on the virtual machine during the virtual machine update .
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
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.
RAM in mb for the virtual machine.
Name of the virtual machine.
List of vnic names.
ARM polling interval for long running operations.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Specify the number of vCPUs available.
List of virtual hard disk names.
Global Parameters
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.
Azure CLI