Unable to deploy vCLS vms by switching to Retreat mode
search cancel

Unable to deploy vCLS vms by switching to Retreat mode

book

Article ID: 301482

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Trying to deploy vCLS vms by using Retreat mode


Symptoms:

  • DRS not able to migrate VMs .
  • The existing vCLS VMs were in a powered off state and were not able to get power ON.
  • Tried to put the cluster in retreat mode but found the following error in the vpxd.log
YYYY-MM-DDT15:58:23.767-04:00 error vpxd[06977] [Originator@6876 sub=Default opID=wcp-vCLS-1c] [VdbStatement] Bind parameters:
 YYYY-MM-DDT15:58:23.767-04:00 error vpxd[06977] [Originator@6876 sub=Default opID=wcp-vCLS-1c] [VdbStatement] [0]datatype: 3, size: 8, arraySize: 1
 YYYY-MM-DDT15:58:23.767-04:00 error vpxd[06977] [Originator@6876 sub=Default opID=wcp-vCLS-1c] [VdbStatement] value[0] = XXXX
 YYYY-MM-DDT15:58:23.768-04:00 error vpxd[06977] [Originator@6876 sub=Default opID=wcp-vCLS-1c] [Vdb::IsRecoverableErrorCode] Unable to recover from 23505:1
 YYYY-MM-DDT15:58:23.768-04:00 error vpxd[06977] [Originator@6876 sub=Default opID=wcp-vCLS-1c] [VdbStatement] SQLError was thrown: "ODBC error: (23505) - ERROR: duplicate key value violates unique constraint "pk_vpx_auth_tenant_mgmt_rs"
 --> DETAIL: Key (entity_id)=(XXXX) already exists.;
 --> Error while executing the query" is returned when executing SQL statement "INSERT INTO VPX_AUTH_TENANT_MGMT_RS(ENTITY_ID) VALUES (?)"
 YYYY-MM-DDT15:58:23.768-04:00 warning vpxd[06977] [Originator@6876 sub=TenantManager opID=wcp-vCLS-1c] DB constraint. Trying to add a duplicated record: "ODBC error: (23505) - ERROR: duplicate key value violates unique constraint "pk_vpx_auth_tenant_mgmt_rs"
 --> DETAIL: Key (entity_id)=(XXXX) already exists.;
 --> Error while executing the query" is returned when executing SQL statement "INSERT INTO VPX_AUTH_TENANT_MGMT_RS(ENTITY_ID) VALUES (?)"

 

 

 

Environment

VMware vSphere ESXi 7.0
VMware vSphere ESXi 8.0

Cause

Stale entry of vCLS VMs in the VCDB causing trouble in the deployment of New vCLS vms

Resolution

    • Take a offline snapshot of the vCenter server before proceeding with the below steps
    • Enabled retreat mode on the affected cluster as per Putting cluster in Retreat mode
    • Stop services VPXD and Content library on the vCenter server.
      • service-control --stop vmware-vpxd
      • service-control --stop content-library
    • Remove the stale entry of the VCLS VMs from the VCDB.
    • Connect to the vCenter Server vPostgres database:

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

    • Identify the Virtual Machine ID in the vCenter database with this command (replace <vm_name> with the display name of the virtual machine)
    • select * from vpx_entity where name like '%<vm_name>%';
    • Execute these SQL statements to remove the virtual machine from the vCenter database.

    delete from VPX_COMPUTE_RESOURCE_DAS_VM where VM_ID=XXXX;

    delete from VPX_COMPUTE_RESOURCE_DRS_VM where VM_ID=XXXX;

    delete from VPX_COMPUTE_RESOURCE_ORC_VM where VM_ID=XXXX;

    delete from VPX_VM_SGXINFO where VM_ID=XXXX;

    delete from VPX_GUEST_DISK where VM_ID=XXXX;

    delete from VPX_VM_VIRTUAL_DEVICE where ID=XXXX;

    delete from VPX_VM_DS_SPACE where VM_ID=XXXX;

    delete from VPX_NON_ORM_VM_CONFIG_INFO where ID=XXXX;

    delete from VPX_NORM_VM_FLE_FILE_INFO where VM_ID=XXXX;

    delete from VPX_VDEVICE_BACKING_REL where VM_ID=XXXX;

    delete from VPX_VIRTUAL_DISK_IOFILTERS where VM_ID=XXXX;

    delete from VPX_VM_STATIC_OVERHEAD_MAP where VM_ID=XXXX;

    delete from VPX_VM_TEXT where VM_ID=XXXX;

    delete from VPX_VM where ID=XXXX;

    delete from VPX_ENTITY where ID=XXXX;

     

    • Start services VPXD and Content library on the vCenter Server to pick up the database changes.

    service-control --start vmware-vpxd

    service-control --start content-library

     

    • Disable retreat mode on the affected cluster.
    • VCLs vm provisioning starts and the vms are deployed from the OVF file

     

 

Additional Information