Recreate corrupt/empty vpxd.cfg file
search cancel

Recreate corrupt/empty vpxd.cfg file

book

Article ID: 320700

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

The purpose of this is to recreate a vpxd.cfg file

Symptoms:
  • vpxd service won't start using service-control
  • vpxd is not logging
  • /etc/vmware-vpx/vpxd.cfg is empty/invalid
  • /sbin/vpxd returns "Aborted (core dumped)"
  • python /usr/lib/vmware-vpx/py/xmlcfg.py -f /etc/vmware-vpx/vpxd.cfg get /config/alarms/vim/version fails


Environment

VMware vCenter Server 6.5.x
VMware vCenter Server 6.7.x
VMware vCenter Server 7.0.x

Cause

This is caused by the vpxd.cfg file becoming empty/corrupt.

Resolution

Have a valid snapshot and/or backup of all nodes in the SSO domain.  The steps below are for 6.7 or 7.x some

  1. Obtain a vpxd.cfg file from a deployment of the same version i.e. 6.7u1, 7.x, and copy this file to /tmp
  2. Edit the file with vi:
    • vi /tmp/vpxd.cfg
  3. Remove the line that has <key_EvaluationExpiryDate> from the copied file.
  4. Update <hostnameUrl> to match the correct VC FQDN.
  5. Ensure all <uri> tags under the <sso> tag point to the correct PSC FQDN (or VC FQDN if embedded).
  6. Change the machine ID for the vpxd solution user.
    • In another SSH session, get the machine ID using the command:
      •  /usr/lib/vmware-vmafd/bin/vmafd-cli get-machine-id --server-name localhost
  7. Ensure Postgres DB version is correct (if no entry in vpxd.cfg for db version, skip this step) by running;
    • /opt/vmware/vpostgres/9.6/bin/psql -V.  
  8. If the VC is self managed, i.e. the VC VM is in the inventory of itself, we need to then add or updated the <key_VCVmId> to the Entity ID of the VC's VM. We can find the ID of the VM from the database by running the commands below. The VM ID is vm-<ID>
    • In another SSH session, login to Database on VCSA:
      • /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
    • Run this database command:
      • select id from VPX_ENTITY where name = '<VC VM Name>';
    • Quit from PSQL using \q and enter.
    • Update the key_VCVmId field  in the vpxd.cfg file to look like (it should be placed above </registry> tag): 
      • <key_VCVmId>vm-1017</key_VCVmId>
  9. Save the vpxd.cfg file into the correct location (NOTE: This overwrites the existing vpxd.cfg, ensure you backed up the existing file prior just in case)
    • cp /tmp/vpxd.cfg /etc/vmware-vpx/vpxd.cfg
  10. Update the VCDB password within the new vpxd.cfg with the previous one. 
    • Cat the file: /etc/vmware-vpx/vcdb.properties It should look something like:
      • password = g4XaA?QR%p(CWc2o
    • Now run this command to update the DB password in the vpxd.cfg file, use the password from the previous step. It should prompt for the password twice then exit cleanly.
      • /sbin/vpxd -p
  11. ​​​​​​​Restart services on appliance.
    • service-control --stop --all
    • service-control --start --all