Share via


az connectedvmware vm

Note

This reference is part of the connectedvmware extension for the Azure CLI (version 2.0.67 or higher). The extension will automatically install the first time you run an az connectedvmware vm command. Learn more about extensions.

Vm resource.

Commands

Name Description Type Status
az connectedvmware vm create

Create VMInstance resource.

Extension GA
az connectedvmware vm create-from-machines

Create VMInstance resource(s) from existing Microsoft.HybridCompute machines.

Extension GA
az connectedvmware vm delete

Delete vm resource.

Extension GA
az connectedvmware vm disk

Vm disk.

Extension GA
az connectedvmware vm disk add

Add virtual disk to a virtual machine.

Extension GA
az connectedvmware vm disk delete

Delete virtual disks to a virtual machine.

Extension GA
az connectedvmware vm disk list

Retrieve a list of vm disk from given resource group name and vm name.

Extension GA
az connectedvmware vm disk show

Get details of a vm disk by it's name, resource-group and vm name.

Extension GA
az connectedvmware vm disk update

Update virtual disk to a virtual machine.

Extension GA
az connectedvmware vm extension

Manage vm extension with connectedvmware.

Extension GA
az connectedvmware vm extension create

The operation to create the extension.

Extension GA
az connectedvmware vm extension delete

The operation to delete the extension.

Extension GA
az connectedvmware vm extension list

The operation to get all extensions of a non-Azure vm.

Extension GA
az connectedvmware vm extension show

The operation to get the extension.

Extension GA
az connectedvmware vm extension update

The operation to update the extension.

Extension GA
az connectedvmware vm guest-agent

Vm guest agent.

Extension GA
az connectedvmware vm guest-agent enable

Enable guest agent on the vm.

Extension GA
az connectedvmware vm guest-agent show

Get details of a guest agent by guest agent name, resource-group and vm name.

Extension GA
az connectedvmware vm list

Retrieve a list of vm of given resource group.

Extension Deprecated
az connectedvmware vm nic

Vm nic.

Extension GA
az connectedvmware vm nic add

Add virtual nic to a virtual machine.

Extension GA
az connectedvmware vm nic delete

Delete virtual nic to a virtual machine.

Extension GA
az connectedvmware vm nic list

Retrieve a list of vm nic from given resource group name and vm name.

Extension GA
az connectedvmware vm nic show

Get details of a vm nic by it's name, resource-group and vm name.

Extension GA
az connectedvmware vm nic update

Update virtual network interface of a virtual machine.

Extension GA
az connectedvmware vm restart

Restart vm resource.

Extension GA
az connectedvmware vm show

Get details of a vm by id, resource-group, reource pool name or subscription.

Extension GA
az connectedvmware vm start

Start vm resource.

Extension GA
az connectedvmware vm stop

Stop vm resource.

Extension GA
az connectedvmware vm update

Update vm resource.

Extension GA

az connectedvmware vm create

Create VMInstance resource.

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]

Examples

Create 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"

Enable an exiting VM to azure.

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

Enable an exiting VM using moName.

az connectedvmware vm create --subscription contoso-sub --resource-group contoso-rg --vcenter contoso-vcenter --mo-name contoso-moname --name contoso-vm

Link an HCRP Machine to a vCenter in another subscription using the machine id.

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

Link an HCRP Machine to a vCenter in another subscription using the machine name.

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

Link an HCRP Machine to a vCenter in the same subscription and resource group.

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

Optional Parameters

--admin-password

Admin password for the vm.

--admin-username

Admin username for the vm.

--cluster

Name or ID of the cluster for deploying the VM.

--custom-location -c

Name or ID of the custom location that will manage this resource.

--datastore

Name or ID of the datastore for deploying the VM.

--disk

Disk overrides for the vm. Usage: --disk name=<> disk-size=<> disk-mode=<> controller-key=<> device-key=<> unit-number=<>.

--host

Name or ID of the host for deploying the VM.

--inventory-item -i

Name or ID of the inventory item.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--machine-id -m

ARM ID of the Microsoft.HybridCompute Machine resource which you want to link to vCenter.

--memory-size

Desired memory size in MBs for the vm.

--mo-name

Name of the resource in the VCenter.

--name -n

Name of the HCRP Machine resource.

--nic

Network overrides for the vm. Usage: --nic name=<> network=<> nic-type=<> power-on-boot=<> allocation-method=<> ip-address=<> subnet-mask=<> device-key=<> gateway=.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--num-CPUs

Number of desired vCPUs for the vm.

--num-cores-per-socket

Number of desired cores per socket for the vm.

--resource-group -g

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

--resource-pool

Name or ID of the resource pool for deploying the vm.

--tags

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

--vcenter -v

Name or ID of the vCenter that is managing this resource.

--vm-template

Name or ID of the vm template for deploying the vm.

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 connectedvmware vm create-from-machines

Create VMInstance resource(s) from existing Microsoft.HybridCompute machines.

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

Examples

Create VMware resources from the specified Arc for Servers machine in the vCenter

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

Creates VMware resources from all Arc for Servers machines in the specified resource group belonging to that vCenter

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

Create VMware resources from all Arc for Servers machines in the specified subscription belonging to that vCenter

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

Required Parameters

--vcenter-id -v

ARM ID of the vCenter to which the machines will be linked.

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

Name of the Microsoft.HybridCompute Machine resource. Provide this parameter if you want to convert a single machine to VMware VM.

--resource-group -g

Name of the resource group which will be scanned for HCRP machines. NOTE: The default group configured using 'az configure --defaults group=' is not used, and it must be specified explicitly.

--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 connectedvmware vm delete

Delete vm resource.

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

Examples

Delete vm

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

Optional Parameters

--delete-from-host

Delete the VM from the VMware host.

--delete-machine
Deprecated

Argument 'delete_machine' has been deprecated and will be removed in a future release.

Delete the parent Microsoft.HybridCompute Machine resource.

--force

Whether force delete or not.

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

Name of the resource.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--resource-group -g

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

--retain
Deprecated

Argument 'retain' has been deprecated and will be removed in a future release.

Retain the VM in the VMWare host.

--retain-machine

Retain the parent Microsoft.HybridCompute Machine resource.

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

Deprecated

This command has been deprecated and will be removed in a future release. Use 'az connectedvmware vm show' instead.

Retrieve a list of vm of given resource group.

az connectedvmware vm list [--resource-group]

Examples

Retrieve a list of vm resource

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

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 connectedvmware vm restart

Restart vm resource.

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

Examples

Restart vm

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

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

Name of the resource.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--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 connectedvmware vm show

Get details of a vm by id, resource-group, reource pool name or subscription.

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

Examples

Get details of a vm resource

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

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

Name of the resource.

--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 connectedvmware vm start

Start vm resource.

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

Examples

Start vm

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

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

Name of the resource.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--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 connectedvmware vm stop

Stop vm resource.

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

Examples

Stop vm

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

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

Name of the resource.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--resource-group -g

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

--skip-shutdown

Skips shutdown and power-off immediately.

Default value: False
--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 connectedvmware vm update

Update vm resource.

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

Examples

Update 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"

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.

--memory-size

Desired memory size in MBs for the vm.

--name -n

Name of the resource.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--num-CPUs

Number of desired vCPUs for the vm.

--num-cores-per-socket

Number of desired cores per socket for the vm.

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