Anti-affinity rules do not persist across VMware Cloud Foundation instances during recovery using Site Recovery Manager. You must create the anti-affinity rules for the placeholder virtual machines in the recovery VMware Cloud Foundation instance so that the rules apply after a failover of the protected virtual machines.

You create separate anti-affinity rules to keep the virtual machines of vRealize Operations Manager, vRealize Automation, and the clustered Workspace ONE Access on separate hosts.

For the following procedure, use the VMware Cloud Foundation Planning and Preparation Workbook.

UI Procedure

  1. Log in to the management domain vCenter Server at https://<recovery_vcenter_server_fqdn>/ui in the recovery VMware Cloud Foundation instance as administrator@vsphere.local.
  2. In the Hosts and clusters inventory, expand the management domain vCenter Server tree and expand the management domain data center.
  3. Select the default management cluster and click the Configure tab.

  4. In the left pane, navigate to Configuration > VM/Host rules and click Add.

  5. On the Create VM/Host rule dialog box, configure the settings, configure the remaining settings according to your VMware Cloud Foundation Planning and Preparation Workbook, and click OK.

    Setting

    Value

    Enable rule

    Selected

    Type

    Separate virtual machines

PowerShell Procedure

  1. Start Windows PowerShell.

  2. Replace the values in the sample code with values from your VMware Cloud Foundation Planning and Preparation Workbook and run the commands in the PowerShell console.

    $sddcManagerFqdn = "lax-vcf01.lax.rainpole.io"
    $sddcManagerUser = "administrator@vsphere.local"
    $sddcManagerPass = "VMw@re1!"
    
    $sddcDomainName = "lax-m01"
    
    $wsaAntiAffinityRuleName = "anti-affinity-rule-wsa"
    $wsaAntiAffinityVMs = "xint-wsa01a,xint-wsa01b,xint-wsa01c"
    $vropsAntiAffinityRuleName = "anti-affinity-rule-vrops"
    $vropsAntiAffinityVMs = "xint-vrops01a,xint-vrops01b,xint-vrops01c"
    $vraAntiAffinityRuleName = "anti-affinity-rule-vra"
    $vraAntiAffinityVMs = "xint-vra01a,xint-vra01b,xint-vra01c"
  3. Perform the configuration by running the command in the PowerShell console.

    Add-AntiAffinityRule -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass -domain $sddcDomainName -ruleName $wsaAntiAffinityRuleName -antiAffinityVMs $wsaAntiAffinityVMs
    Add-AntiAffinityRule -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass -domain $sddcDomainName -ruleName $vropsAntiAffinityRuleName -antiAffinityVMs $vropsAntiAffinityVMs
    Add-AntiAffinityRule -server $sddcManagerFqdn -user $sddcManagerUser -pass $sddcManagerPass -domain $sddcDomainName -ruleName $vraAntiAffinityRuleName -antiAffinityVMs $vraAntiAffinityVMs