שתף באמצעות


az stack-hci-vm disk

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 disk command. Learn more about extensions.

Manage virtualharddisk with stack-hci-vm.

Commands

Name Description Type Status
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 disk attach

Attach disk to a VM.

az stack-hci-vm disk attach [--disks]
                            [--ids]
                            [--name]
                            [--resource-group]
                            [--subscription]
                            [--vm-name]
                            [--yes]

Examples

AttachDisk

az stack-hci-vm disk attach --resource-group "test-rg" --vm-name "test-vm" --disks "disk1" "disk2"

Optional Parameters

--disks

One or more names or IDs of the managed disk (space-delimited).

Usage: --disks "disk1" "disk2".

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

The name or ID of the managed disk.

Usage: --name "test-disk".

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

--vm-name

The name of the virtual machine.

Usage: --vm-name "test-vm".

--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 stack-hci-vm disk create

Create a virtual hard disk.

az stack-hci-vm disk create --custom-location
                            --name
                            --resource-group
                            [--block-size-bytes]
                            [--disk-file-format]
                            [--download-url]
                            [--dynamic {false, true}]
                            [--location]
                            [--logical-sector-bytes]
                            [--physical-sector-bytes]
                            [--polling-interval]
                            [--size-gb]
                            [--storage-path-id]
                            [--tags]

Examples

PutVirtualHardDisk

az stack-hci-vm disk create --resource-group "test-rg" --custom-location "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" --location "West US2" --size-gb 2 --name "test-vhd" --storage-path-id "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storagecontainers/test-storagepath"

Required Parameters

--custom-location

The ID of the extended location.

--name

Name of the virtual hard disk.

--resource-group -g

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

Optional Parameters

--block-size-bytes

Block size.

--disk-file-format

Disk file format of the virtual hard disk - vhd or vhdx.

Usage: --disk-file-format "vhd".

--download-url

Download Url.

--dynamic

Boolean for enabling dynamic sizing on the virtual hard disk.

Accepted values: false, true
--location -l

If location is not specified, the location of the resource group is used.

--logical-sector-bytes

Logical Sector.

--physical-sector-bytes

Physical Sector.

--polling-interval

ARM polling interval for long running operations.

--size-gb

Size of the disk in GB.

--storage-path-id

Azure ID of the Storage Path which is used to store the VHD.

--tags

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

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 stack-hci-vm disk delete

Delete a virtual hard disk.

az stack-hci-vm disk delete [--ids]
                            [--name]
                            [--polling-interval]
                            [--resource-group]
                            [--subscription]
                            [--yes]

Examples

DeleteVirtualHardDisk

az stack-hci-vm disk delete --resource-group "test-rg" --name "test-vhd"

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

--polling-interval

ARM polling interval for long running operations.

--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 stack-hci-vm disk detach

Detach disk from a VM.

az stack-hci-vm disk detach --resource-group
                            --vm-name
                            [--name]
                            [--yes]

Examples

DetachDisk

az stack-hci-vm disk detach --resource-group "test-rg" --vm-name "test-vm" --name "test-disk"

Required Parameters

--resource-group -g

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

--vm-name

The name of the virtual machine.

Usage: --vm-name "test-vm".

Optional Parameters

--name

The name or ID of the managed disk.

Usage: --name "test-disk".

--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 stack-hci-vm disk list

List all virtual hard disks.

az stack-hci-vm disk list [--resource-group]

Examples

ListVirtualHardDiskByResourceGroup

az stack-hci-vm disk list --resource-group "test-rg"

ListVirtualHardDiskByResourceGroup

az stack-hci-vm disk 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 stack-hci-vm disk show

Get the details of a virtual hard disk.

az stack-hci-vm disk show [--ids]
                          [--name]
                          [--resource-group]
                          [--subscription]

Examples

GetVirtualHardDisk

az stack-hci-vm disk show --resource-group "test-rg" --name "test-vhd"

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

--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 stack-hci-vm disk update

Update a virtual hard disk.

az stack-hci-vm disk update [--ids]
                            [--name]
                            [--resource-group]
                            [--subscription]
                            [--tags]

Examples

UpdateVirtualHardDisk

az stack-hci-vm disk update --resource-group "test-rg" --tags additionalProperties="sample" --name "test-vhd"

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

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

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.