Tuesday, August 13, 2024

Script: Create affinity and anti-affinity rules using script on Azure cli for Azure vmware solution

 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

RAV migration cutover was failing after sync

 Issue: HCX RAV migration was failing after base sync and while cutover the VM. Noticed below error in hcx connector app logs. TxId: 4cda256...