共用方式為


az connectedvmware vm disk

備註

此參考是 Azure CLI connectedvmware 擴充功能的一部分(2.0.67 版或更高版本)。 當您第一次執行 az connectedvmware vm disk 命令時,擴充功能會自動安裝。 深入瞭解擴充功能

Vm 磁碟。

命令

名稱 Description 類型 狀態
az connectedvmware vm disk add

將虛擬磁碟新增至虛擬機。

擴充套件 GA
az connectedvmware vm disk delete

將虛擬磁碟刪除至虛擬機。

擴充套件 GA
az connectedvmware vm disk list

從指定的資源組名和 VM 名稱擷取 VM 磁碟清單。

擴充套件 GA
az connectedvmware vm disk show

依 VM 磁碟的名稱、資源群組和 VM 名稱取得詳細數據。

擴充套件 GA
az connectedvmware vm disk update

將虛擬磁碟更新為虛擬機。

擴充套件 GA

az connectedvmware vm disk add

將虛擬磁碟新增至虛擬機。

az connectedvmware vm disk add --controller-key
                               --disk-size
                               --name
                               --resource-group
                               --vm-name
                               [--disk-mode]
                               [--no-wait]
                               [--unit-number]

範例

將虛擬磁碟新增至虛擬機

az connectedvmware vm disk add --controller-key "The controller key of the disk"                --disk-size "The disk size in GBs" --name "Name of the Disk" --resource-group                "resource group name" --vm-name "Name of the virtual machine"

必要參數

--controller-key

磁碟的控制器金鑰。

--disk-size

GB 中的磁碟大小。

--name -n

磁碟的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--vm-name

虛擬機器的名稱。

選擇性參數

--disk-mode

磁碟的模式。

預設值: PERSISTENT
--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--unit-number

磁碟的單位編號。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az connectedvmware vm disk delete

將虛擬磁碟刪除至虛擬機。

az connectedvmware vm disk delete --disks
                                  --resource-group
                                  --vm-name
                                  [--no-wait]
                                  [--yes]

範例

將虛擬磁碟刪除至虛擬機

az connectedvmware vm disk delete --disk "Names of the Disks" --resource-group                "resource group name" --vm-name "Name of the virtual machine"

必要參數

--disks

磁碟的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--vm-name

虛擬機器的名稱。

選擇性參數

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--yes -y

請勿提示確認。

預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az connectedvmware vm disk list

從指定的資源組名和 VM 名稱擷取 VM 磁碟清單。

az connectedvmware vm disk list --resource-group
                                --vm-name

範例

擷取 VM 磁碟清單

az connectedvmware vm disk list --resource-group "resource group name" --vm-name                "Name of the virtual machine"

必要參數

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--vm-name

虛擬機器的名稱。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az connectedvmware vm disk show

依 VM 磁碟的名稱、資源群組和 VM 名稱取得詳細數據。

az connectedvmware vm disk show --name
                                --resource-group
                                --vm-name

範例

取得 VM 磁碟的詳細數據

az connectedvmware vm disk show --name "Name of the Disk" --resource-group                "resource group name" --vm-name "Name of the virtual machine"

必要參數

--name -n

磁碟的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--vm-name

虛擬機器的名稱。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az connectedvmware vm disk update

將虛擬磁碟更新為虛擬機。

az connectedvmware vm disk update --resource-group
                                  --vm-name
                                  [--controller-key]
                                  [--device-key]
                                  [--disk-mode]
                                  [--disk-size]
                                  [--name]
                                  [--no-wait]
                                  [--unit-number]

範例

將虛擬磁碟更新為虛擬機

az connectedvmware vm disk update --controller-key "The controller key of the disk"                --disk-size "The disk size in GBs" --name "Name of the Disk" --resource-group                "resource group name" --vm-name "Name of the virtual machine"

必要參數

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--vm-name

虛擬機器的名稱。

選擇性參數

--controller-key

磁碟的控制器金鑰。

--device-key

磁碟的裝置金鑰。

--disk-mode

磁碟的模式。

--disk-size

GB 中的磁碟大小。

--name -n

磁碟的名稱。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--unit-number

磁碟的單位編號。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。