Share via


az vmware placement-policy vm

Note

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

Commands to manage VM placement policies.

Commands

Name Description Type Status
az vmware placement-policy vm create

Create a VM placement policy in a private cloud cluster.

Extension GA
az vmware placement-policy vm delete

Delete a VM placement policy in a private cloud cluster.

Extension GA
az vmware placement-policy vm update

Update a VM placement policy in a private cloud cluster.

Extension GA

az vmware placement-policy vm create

Create a VM placement policy in a private cloud cluster.

az vmware placement-policy vm create --affinity-type {Affinity, AntiAffinity}
                                     --cluster-name
                                     --name
                                     --private-cloud
                                     --resource-group
                                     --vm-members
                                     [--display-name]
                                     [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                     [--state {Disabled, Enabled}]

Examples

Create a VM placement policy.

az vmware placement-policy vm create --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1 --state Enabled --display-name policy1 --vm-members /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128 /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256 --affinity-type AntiAffinity

Required Parameters

--affinity-type

Placement policy affinity type.

Accepted values: Affinity, AntiAffinity
--cluster-name

Name of the cluster in the private cloud.

--name --placement-policy-name -n

Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy.

--private-cloud -c

Name of the private cloud.

--resource-group -g

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

--vm-members

Virtual machine members list Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Optional Parameters

--display-name

Display name of the placement policy.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--state

Whether the placement policy is enabled or disabled.

Accepted values: Disabled, Enabled
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 vmware placement-policy vm delete

Delete a VM placement policy in a private cloud cluster.

az vmware placement-policy vm delete [--cluster-name]
                                     [--ids]
                                     [--name]
                                     [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                     [--private-cloud]
                                     [--resource-group]
                                     [--subscription]
                                     [--yes]

Examples

Delete a VM placement policy.

az vmware placement-policy vm delete --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1

Optional Parameters

--cluster-name

Name of the cluster in the private cloud.

--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 --placement-policy-name -n

Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--private-cloud -c

Name of the private cloud.

--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 vmware placement-policy vm update

Update a VM placement policy in a private cloud cluster.

az vmware placement-policy vm update [--add]
                                     [--cluster-name]
                                     [--display-name]
                                     [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                     [--ids]
                                     [--name]
                                     [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                     [--private-cloud]
                                     [--remove]
                                     [--resource-group]
                                     [--set]
                                     [--state {Disabled, Enabled}]
                                     [--subscription]
                                     [--vm-members]

Examples

Update a VM placement policy.

az vmware placement-policy vm update --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1 --state Enabled --display-name policy1 --vm-members /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128 /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--cluster-name

Name of the cluster in the private cloud.

--display-name

Display name of the placement policy.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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 --placement-policy-name -n

Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--private-cloud -c

Name of the private cloud.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

--resource-group -g

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

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

--state

Whether the placement policy is enabled or disabled.

Accepted values: Disabled, Enabled
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--vm-members

Virtual machine members list Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

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.