script connects to your vCenter Server, identifies the cluster and VMs, and creates a new VM affinity rule to keep the specified VMs together
az vmware placement-policy vm create --resource-group Groupnamehere --private-cloud Namehere --cluster-name Namehere --placement-policy-name POLICYNAMEHERE --state Enabled --display-name POLICYDISPLAYNAMEHERE --vm-members /subscriptions/Subcriptionidhere /resourceGroups/Namehere/providers/Microsoft.AVS/privateClouds/Namehere/clusters/Namehere/virtualMachines/VMIDhere /subscriptions/SubscriptionID here/resourceGroups/resourcegroupname here/providers/Microsoft.AVS/privateClouds/AVS SDDC namhere/clusters/Cluster-1/virtualMachines/vm-IDHERE /subscriptions/SubscriptionID /resourceGroups/resourcegroupname/providers/Microsoft.AVS/privateClouds/AVS SDDC namhere/clusters/Cluster-1/virtualMachines/vm-IDHERE --affinity-type AntiAffinity
No comments:
Post a Comment