az connectedvmware vm

注意

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

Vm 資源。

命令

名稱 Description 類型 狀態
az connectedvmware vm create

建立 VMInstance 資源。

副檔名 GA
az connectedvmware vm create-from-machines

從現有的 Microsoft.HybridCompute 機器建立 VMInstance 資源。

副檔名 GA
az connectedvmware vm delete

刪除 VM 資源。

副檔名 GA
az connectedvmware vm disk

Vm 磁碟。

副檔名 GA
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 extension

使用 connectedvmware 管理 VM 擴充功能。

副檔名 GA
az connectedvmware vm extension create

要建立延伸模組的作業。

副檔名 GA
az connectedvmware vm extension delete

要刪除延伸模組的作業。

副檔名 GA
az connectedvmware vm extension list

取得非 Azure VM 所有擴充功能的作業。

副檔名 GA
az connectedvmware vm extension show

取得延伸模組的作業。

副檔名 GA
az connectedvmware vm extension update

更新延伸模組的作業。

副檔名 GA
az connectedvmware vm guest-agent

Vm 客體代理程式。

副檔名 GA
az connectedvmware vm guest-agent enable

在 VM 上啟用客體代理程式。

副檔名 GA
az connectedvmware vm guest-agent show

依客體代理程式名稱、資源群組和 VM 名稱取得客體代理程式的詳細數據。

副檔名 GA
az connectedvmware vm list

擷取指定資源群組的 VM 清單。

副檔名 已取代
az connectedvmware vm nic

Vm nic。

副檔名 GA
az connectedvmware vm nic add

將虛擬 nic 新增至虛擬機。

副檔名 GA
az connectedvmware vm nic delete

將虛擬 nic 刪除至虛擬機。

副檔名 GA
az connectedvmware vm nic list

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

副檔名 GA
az connectedvmware vm nic show

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

副檔名 GA
az connectedvmware vm nic update

更新虛擬機的虛擬網路介面。

副檔名 GA
az connectedvmware vm restart

重新啟動 VM 資源。

副檔名 GA
az connectedvmware vm show

依標識符、資源群組、資源群組、資源集區名稱或訂用帳戶取得 VM 的詳細數據。

副檔名 GA
az connectedvmware vm start

啟動 VM 資源。

副檔名 GA
az connectedvmware vm stop

停止 VM 資源。

副檔名 GA
az connectedvmware vm update

更新 VM 資源。

副檔名 GA

az connectedvmware vm create

建立 VMInstance 資源。

az connectedvmware vm create [--admin-password]
                             [--admin-username]
                             [--cluster]
                             [--custom-location]
                             [--datastore]
                             [--disk]
                             [--host]
                             [--inventory-item]
                             [--location]
                             [--machine-id]
                             [--memory-size]
                             [--name]
                             [--nic]
                             [--no-wait]
                             [--num-CPUs]
                             [--num-cores-per-socket]
                             [--resource-group]
                             [--resource-pool]
                             [--tags]
                             [--vcenter]
                             [--vm-template]

範例

建立 vm

az connectedvmware vm create --inventory-item "name or id of the inventory item" --name "virtual machine name" --resource-group "resource group name" --vcenter "name or id of the vcenter"

啟用 Azure 的結束 VM。

az connectedvmware vm create --subscription contoso-sub --resource-group contoso-rg --inventory-item 01234567-0123-0123-0123-0123456789ab --name contoso-vm

使用計算機標識碼,將 HCRP 機器連結到另一個訂用帳戶中的 vCenter。

az connectedvmware vm create --machine-id /subscriptions/01234567-0123-0123-0123-0123456789ab/resourceGroups/contoso-rg/providers/Microsoft.HybridCompute/machines/contoso-vm --vcenter /subscriptions/fedcba98-7654-3210-0123-456789abcdef/resourceGroups/contoso-rg/providers/Microsoft.ConnectedVMwareVsphere/vcenters/contoso-vcenter

使用計算機名稱,將 HCRP 電腦連結到另一個訂用帳戶中的 vCenter。

az connectedvmware vm create --resource-group contoso-rg --name hcrp-contoso-machine --vcenter /subscriptions/fedcba98-7654-3210-0123-456789abcdef/resourceGroups/contoso-rg/providers/Microsoft.ConnectedVMwareVsphere/vcenters/contoso-vcenter

將 HCRP 機器連結至相同訂用帳戶和資源群組中的 vCenter。

az connectedvmware vm create --resource-group contoso-rg --name hcrp-contoso-machine --vcenter contoso-vcenter

選擇性參數

--admin-password

管理員 vm 的密碼。

--admin-username

管理員 vm 的用戶名稱。

--cluster

用於部署 VM 的叢集名稱或標識碼。

--custom-location -c

將管理此資源的自定義位置名稱或標識碼。

--datastore

用於部署 VM 的數據存放區名稱或識別碼。

--disk

VM 的磁碟覆寫。 使用量:--disk name= disk-size=<> disk-mode=<> controller-key= device-key=<><> unit-number=<>。<>

--host

用於部署 VM 的主機名稱或識別碼。

--inventory-item -i

清查項目的名稱或標識碼。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--machine-id -m

您想要連結至 vCenter 之 Microsoft.HybridCompute Machine 資源的 ARM 識別符。

--memory-size

VM 所需的記憶體大小為 MB。

--name -n

HCRP 計算機資源的名稱。

--nic

VM 的網路覆寫。 使用方式:--nic name= network=<> nic-type=<> power-on-boot=<> allocation-method=<> ip-address=<> subnet-mask<>= device-key=<> gateway=。<>

--no-wait

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

預設值: False
--num-CPUs

VM 所需的 vCPU 數目。

--num-cores-per-socket

VM 每個套接字所需的核心數目。

--resource-group -g

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

--resource-pool

用於部署 VM 的資源集區名稱或識別碼。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--vcenter -v

管理此資源的 vCenter 名稱或識別碼。

--vm-template

用於部署 VM 的 VM 樣本名稱或識別碼。

全域參數
--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 create-from-machines

從現有的 Microsoft.HybridCompute 機器建立 VMInstance 資源。

az connectedvmware vm create-from-machines --vcenter-id
                                           [--ids]
                                           [--name]
                                           [--resource-group]
                                           [--subscription]

範例

從 vCenter 中為伺服器計算機指定的 Arc 建立 VMware 資源

az connectedvmware vm create-from-machines --resource-group contoso-rg --name contoso-vm --vcenter-id /subscriptions/fedcba98-7654-3210-0123-456789abcdef/resourceGroups/contoso-rg-2/providers/Microsoft.ConnectedVMwareVsphere/vcenters/contoso-vcenter

從屬於該 vCenter 之指定資源群組中所有 Arc for Servers 機器建立 VMware 資源

az connectedvmware vm create-from-machines --resource-group contoso-rg --vcenter-id /subscriptions/fedcba98-7654-3210-0123-456789abcdef/resourceGroups/contoso-rg-2/providers/Microsoft.ConnectedVMwareVsphere/vcenters/contoso-vcenter

在屬於該 vCenter 的指定訂用帳戶中,從所有 Arc for Servers 機器建立 VMware 資源

az connectedvmware vm create-from-machines --subscription contoso-sub --vcenter-id /subscriptions/fedcba98-7654-3210-0123-456789abcdef/resourceGroups/contoso-rg-2/providers/Microsoft.ConnectedVMwareVsphere/vcenters/contoso-vcenter

必要參數

--vcenter-id -v

要鏈接電腦之 vCenter 的 ARM 識別碼。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

Microsoft.HybridCompute Machine 資源的名稱。 如果您想要將單一計算機轉換成 VMware VM,請提供此參數。

--resource-group -g

將掃描 HCRP 機器的資源群組名稱。 注意:未使用 'az configure --defaults group=' 設定的預設群組,而且必須明確指定。

--subscription

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

全域參數
--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 delete

刪除 VM 資源。

az connectedvmware vm delete [--delete-from-host]
                             [--force]
                             [--ids]
                             [--name]
                             [--no-wait]
                             [--resource-group]
                             [--retain-machine]
                             [--subscription]
                             [--yes]

範例

刪除 vm

az connectedvmware vm delete --ids "resource id" --name "virtual machine name"                --resource-group "resource group name" --subscription "Name or ID of subscription"

選擇性參數

--delete-from-host

從 VMware 主機刪除 VM。

--force

是否強制刪除。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

資源的名稱。

--no-wait

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

預設值: False
--resource-group -g

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

--retain-machine

保留父系 Microsoft.HybridCompute Machine 資源。

--subscription

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

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

已被取代

此命令已被取代,並將在未來版本中移除。 請改用 『az connectedvmware vm show』。

擷取指定資源群組的 VM 清單。

az connectedvmware vm list [--resource-group]

範例

擷取 VM 資源清單

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

選擇性參數

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<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 restart

重新啟動 VM 資源。

az connectedvmware vm restart [--ids]
                              [--name]
                              [--no-wait]
                              [--resource-group]
                              [--subscription]

範例

重新啟動 VM

az connectedvmware vm restart --ids "resource id" --name "virtual machine name"                --resource-group "resource group name" --subscription "Name or ID of subscription"

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

資源的名稱。

--no-wait

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

預設值: False
--resource-group -g

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

--subscription

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

全域參數
--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 show

依標識符、資源群組、資源群組、資源集區名稱或訂用帳戶取得 VM 的詳細數據。

az connectedvmware vm show [--ids]
                           [--name]
                           [--resource-group]
                           [--subscription]

範例

取得 VM 資源的詳細數據

az connectedvmware vm show --ids "resource id" --name "vm template name"                --resource-group "resource group name" --subscription "Name or ID of subscription"

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

資源的名稱。

--resource-group -g

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

--subscription

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

全域參數
--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 start

啟動 VM 資源。

az connectedvmware vm start [--ids]
                            [--name]
                            [--no-wait]
                            [--resource-group]
                            [--subscription]

範例

啟動 VM

az connectedvmware vm start --ids "resource id" --name "virtual machine name"                --resource-group "resource group name" --subscription "Name or ID of subscription"

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

資源的名稱。

--no-wait

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

預設值: False
--resource-group -g

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

--subscription

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

全域參數
--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 stop

停止 VM 資源。

az connectedvmware vm stop [--ids]
                           [--name]
                           [--no-wait]
                           [--resource-group]
                           [--skip-shutdown]
                           [--subscription]

範例

停止 VM

az connectedvmware vm stop --ids "resource id" --name "virtual machine name"                --resource-group "resource group name" --subscription "Name or ID of subscription"

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

資源的名稱。

--no-wait

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

預設值: False
--resource-group -g

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

--skip-shutdown

立即略過關機和關閉電源。

預設值: False
--subscription

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

全域參數
--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 update

更新 VM 資源。

az connectedvmware vm update [--ids]
                             [--memory-size]
                             [--name]
                             [--no-wait]
                             [--num-CPUs]
                             [--num-cores-per-socket]
                             [--resource-group]
                             [--subscription]
                             [--tags]

範例

更新 vm

az connectedvmware vm update --ids "resource id" --name "virtual machine name"                --resource-group "resource group name" --subscription "Name or ID of subscription"                --memory-size "vm memory size in MB" --num-CPUs "no. of CPUs"

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是完整資源識別碼,其中包含「資源標識碼」引數的所有資訊。 您應該提供 --ids 或其他「資源識別碼」引數。

--memory-size

VM 所需的記憶體大小為 MB。

--name -n

資源的名稱。

--no-wait

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

預設值: False
--num-CPUs

VM 所需的 vCPU 數目。

--num-cores-per-socket

VM 每個套接字所需的核心數目。

--resource-group -g

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

--subscription

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

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--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 來取得完整偵錯記錄。