Unable to expand edge cluster. VSPHERE_VM_ANTIAFFINITY_RULE_CREATION_FAILED Failed to create VM-VM anti-affinity rule null in vCenter domain
search cancel

Unable to expand edge cluster. VSPHERE_VM_ANTIAFFINITY_RULE_CREATION_FAILED Failed to create VM-VM anti-affinity rule null in vCenter domain

book

Article ID: 420005

calendar_today

Updated On:

Products

VMware SDDC Manager

Issue/Introduction

Unable to add a new edge node. Expand Edge Cluster task is failing at the subtask "Update Anti Affinity Rule"

The following events are listed in the log file, /var/log/vmware/vcf/domainmanager/domainmanager.log :

YYYY-MM-DDTHH:MM:SS.397+0000 ERROR [vcf_dm,692###,####] [c.v.v.c.f.p.a.i.UpdateAntiAffinityRuleAction,dm-exec-15]  
Desired spec {"vm":
[{"_type":"VirtualMachine","_value":"vm-1####","_serverGuid":"########-####-4a95-87c4-############"},
{"_type":"VirtualMachine","_value":"vm-2####","_serverGuid":"########-####-4a95-87c4-############"},
{"_type":"VirtualMachine","_value":"vm-3####","_serverGuid":"########-####-4a95-87c4-############"}],
"enabled":true,"ruleUuid":"########-c7e9-0ae5-663a-############"} does not exist in cluster domain-c####

YYYY-MM-DDTHH:MM:SS.403+0000 ERROR [vcf_dm,692###,####] [c.v.e.s.o.model.error.ErrorFactory,dm-exec-15]  [Q1####] VSPHERE_VM_ANTIAFFINITY_RULE_CREATION_FAILED Failed to create VM-VM anti-affinity rule null in vCenter domain-c####

 

Unable to manually enable the affinity rule in vCenter Server. /var/log/vmware/vpxd/vpxd.log reports the following events:

YYYY-MM-DDTHH:MM:SS.161+11:00 info vpxd[49164] [Originator@6876 sub=drmLogger opID=####-auto-c] DRS automation level of cluster [vim.ClusterComputeResource:domain-c####,hce-fdc-mgt1] is fullyAutomated
YYYY-MM-DDTHH:MM:SS..161+11:00 info vpxd[49164] [Originator@6876 sub=drmLogger opID=####-auto-c] Editing rule VCF-edge_mgt-ec01_antiAffinity_#######-10aa-46f0-a8dd-###########. New rule's name is VCF-edge_mgt-ec01_antiAffinity_#######-10aa-46f0-a8dd-###########, isEnabled is true and isMandatory is <unset>
YYYY-MM-DDTHH:MM:SS..161+11:00 info vpxd[49164] [Originator@6876 sub=drmLogger opID=####-auto-c] New anti affinity rule is conflicting with other anti affinity rules
YYYY-MM-DDTHH:MM:SS..161+11:00 info vpxd[49164] [Originator@6876 sub=drmLogger opID=####-auto-c] Disabling anti affinity rule [N3Vim7Cluster20AntiAffinityRuleSpecE:0x00007f3c94083ab0] because of conflicts

Environment

VMware Cloud Foundation 5.2.x

Cause

Edge deployment subtask is failing as SDDC manager is unable to validate the affinity rule configuration in the vCenter Server Cluster where the edge VMs are running.

Resolution

  1. Validate the Edge VMs affinity rule configuration in vCenter Server.
    1. Are all the edge nodes added to the affinity rule. If not, manually add the missing edge node to the affinity rule.
    2. Are you able to manually disable and enable the affinity rule?

  2. Validate and fix any conflicting affinity rules in vCenter Server at the cluster level.
  3. If there are no conflicting affinity rules in the vSphere Client, review the vpx_compute_resource table in the vCenter Server database for duplicates or entries with null values.
    1. Ensure you have a working backup of the vCenter Server.
    2. Take a powered off snapshot of the vCenter Server.
    3. SSH to the vCenter Server as the root user and connect to the database using the command:

      /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

      For more information, see the article, Interacting with the vCenter Server Appliance 6.5/6.7/7.0/8.0 embedded vPostgres Database
    4. Review the affinity rules saved in the database using the command:

      select id,rules_info from vpx_compute_resource;

      In the output, id will be the moid of the cluster.

    5. If duplicate affinity rules exist in rules_info, please engage Broadcom Support. 

  4. If there are no conflicting entries in the vSphere Client as well as the vCenter Server database, restart the vCenter Server Appliance and retry expanding the edge cluster.

Additional Information

Edge cluster expansion fails with error "VSPHERE_VM_ANTIAFFINITY_RULE_CREATION_FAILED Failed to create VM-VM anti-affinity rule"