az connectedvmware vm
Note
此參考是 Azure CLI 的 connectedvmware 擴充功能的一部分(2.0.67 版或更高版本)。 擴充功能會在您第一次執行 az connectedvmware vm 命令時自動安裝。 深入了解擴充功能。
Vm 資源。
命令
| 名稱 | Description | 類型 | 狀態 |
|---|---|---|---|
| az connectedvmware vm create |
建立 VMInstance 資源。 |
Extension | GA |
| az connectedvmware vm create-from-machines |
從現有的 Microsoft.HybridCompute 機器建立 VMInstance 資源。 |
Extension | GA |
| az connectedvmware vm delete |
刪除 VM 資源。 |
Extension | GA |
| az connectedvmware vm disk |
Vm 磁碟。 |
Extension | GA |
| az connectedvmware vm disk add |
將虛擬磁碟新增至虛擬機。 |
Extension | GA |
| az connectedvmware vm disk delete |
將虛擬磁碟刪除至虛擬機。 |
Extension | GA |
| az connectedvmware vm disk list |
從指定的資源組名和 VM 名稱擷取 VM 磁碟清單。 |
Extension | GA |
| az connectedvmware vm disk show |
依 VM 磁碟的名稱、資源群組和 VM 名稱取得詳細數據。 |
Extension | GA |
| az connectedvmware vm disk update |
將虛擬磁碟更新為虛擬機。 |
Extension | GA |
| az connectedvmware vm extension |
使用 connectedvmware 管理 VM 擴充功能。 |
Extension | GA |
| az connectedvmware vm extension create |
要建立延伸模組的作業。 |
Extension | GA |
| az connectedvmware vm extension delete |
要刪除延伸模組的作業。 |
Extension | GA |
| az connectedvmware vm extension list |
取得非 Azure VM 所有擴充功能的作業。 |
Extension | GA |
| az connectedvmware vm extension show |
取得延伸模組的作業。 |
Extension | GA |
| az connectedvmware vm extension update |
更新延伸模組的作業。 |
Extension | GA |
| az connectedvmware vm guest-agent |
Vm 客體代理程式。 |
Extension | GA |
| az connectedvmware vm guest-agent enable |
在 VM 上啟用客體代理程式。 |
Extension | GA |
| az connectedvmware vm guest-agent show |
依客體代理程式名稱、資源群組和 VM 名稱取得客體代理程式的詳細數據。 |
Extension | GA |
| az connectedvmware vm nic |
Vm nic。 |
Extension | GA |
| az connectedvmware vm nic add |
將虛擬 nic 新增至虛擬機。 |
Extension | GA |
| az connectedvmware vm nic delete |
將虛擬 nic 刪除至虛擬機。 |
Extension | GA |
| az connectedvmware vm nic list |
從指定的資源組名和 VM 名稱擷取 vm nic 清單。 |
Extension | GA |
| az connectedvmware vm nic show |
依 vm nic 的名稱、資源群組和 VM 名稱取得詳細數據。 |
Extension | GA |
| az connectedvmware vm nic update |
更新虛擬機的虛擬網路介面。 |
Extension | GA |
| az connectedvmware vm restart |
重新啟動 VM 資源。 |
Extension | GA |
| az connectedvmware vm show |
依標識符、資源群組、資源群組、資源集區名稱或訂用帳戶取得 VM 的詳細數據。 |
Extension | GA |
| az connectedvmware vm start |
啟動 VM 資源。 |
Extension | GA |
| az connectedvmware vm stop |
停止 VM 資源。 |
Extension | GA |
| az connectedvmware vm update |
更新 VM 資源。 |
Extension | 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]
[--mo-name]
[--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 /subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/contoso-rg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/contoso-vc/InventoryItems/vm-123456 --name contoso-vm
使用 moName 啟用結束的 VM。
az connectedvmware vm create --subscription contoso-sub --resource-group contoso-rg --vcenter contoso-vcenter --mo-name contoso-moname --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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
vm 的管理員密碼。
vm 的管理員用戶名稱。
用於部署 VM 的叢集名稱或標識碼。
將管理此資源的自定義位置名稱或標識碼。
用於部署 VM 的數據存放區名稱或識別碼。
VM 的磁碟覆寫。 使用量: --disk name=<> disk-size=<> disk-mode=<> controller-key=<> device-key=<> unit-number=<>。
用於部署 VM 的主機名稱或識別碼。
清查項目的名稱或標識碼。
Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。
您想要連結至 vCenter 之 Microsoft.HybridCompute Machine 資源的 ARM 識別符。
VM 所需的記憶體大小為 MB。
VCenter 中資源的名稱。
HCRP 計算機資源的名稱。
VM 的網路覆寫。 使用方式:--nic name=<> network=<> nic-type=<> power-on-boot=<> allocation-method=<> ip-address=<> subnet-mask=<> device-key=<> gateway=<command separated list of gateways>。
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
VM 所需的 vCPU 數目。
VM 每個套接字所需的核心數目。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
用於部署 VM 的資源集區名稱或識別碼。
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
管理此資源的 vCenter 名稱或識別碼。
用於部署 VM 的 VM 樣本名稱或識別碼。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 的 ARM 識別碼。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
Microsoft.HybridCompute Machine 資源的名稱。 如果您想要將單一計算機轉換成 VMware VM,請提供此參數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
將掃描 HCRP 機器的資源群組名稱。 注意:不會使用使用 az configure --defaults group=<name> 設定的預設群組,而且必須明確指定。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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"
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
從 VMware 主機刪除 VM。
是否強制刪除。
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
保留父Microsoft.HybridCompute Machine 資源。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
立即略過關機和關閉電源。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
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 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
VM 所需的記憶體大小為 MB。
資源的名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
VM 所需的 vCPU 數目。
VM 每個套接字所需的核心數目。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |