vCenter UI Displays "localhost" After Upgrade
search cancel

vCenter UI Displays "localhost" After Upgrade

book

Article ID: 372090

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

After update to vCenter 8, the vCenter inventory object in the hosts and clusters view of the vSphere Client inventory might be displayed as localhost instead of the vCenter FQDN.

Environment

VMware vCenter Server 8.0.x

Cause

This can be caused by a corrupt vpxd.cfg which triggers the vpxd process to start with default settings

$ /var/log/vmware/vmon/vmon.log

yyyy:mm:dd Wa(03) host-xxxxxx<vpxd> Service pre-start command's stderr: Failed to parse vpxd.cfg. File is not a valid XML! vpxd will launch with default settings. : Cannot parse file:/etc/vmware-vpx/vpxd.cfg

Resolution

Verify if the vpxd.cfg is valid or corrupt using KB316610.

Steps to recreate and edit vpxd.cfg file:

  1. Take a Snapshot or Backup

Before making changes, take a valid snapshot or backup of the affected vCenter Server Appliance (VCSA) and any other nodes in the SSO domain.

  1. Gather Required Information from the Broken VCSA

Connect to the broken VCSA using SSH or console and collect the following:

    • FQDN of the vCenter

      Run:
      hostname -f
    • Machine ID

      Run:
      /usr/lib/vmware-vmafd/bin/vmafd-cli get-machine-id --server-name localhost
    • PostgreSQL Version

      Run:
      /opt/vmware/vpostgres/current/bin/psql -V
    • vCenter Database Password

      Run:
      cat /etc/vmware-vpx/vcdb.properties
      (This should return something like password = my-secret-password)

    • Self-managed Check – vCenter VM ID (only if the VC manages itself)

      Run:
      /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
      Then at the prompt:
      select id from VPX_ENTITY where name = '<VC VM Name>';
      (Replace <VC VM Name> with the actual name of the VCSA VM)

      Note the returned ID, for example 1017, to be used as vm-1017.
  1. Get a Clean vpxd.cfg File

Deploy a temporary vCenter Server of the same version and build as the broken VCSA.

From the temporary VCSA, copy the file /etc/vmware-vpx/vpxd.cfg to your local PC using WinSCP or any SCP tool.

  1. Edit the Clean vpxd.cfg File

Choose one of the following options:

Option A-Edit on your local PC:

Open the file using a text editor, and make the following changes:

      • Remove the line <key_EvaluationExpiryDate>.
      • Replace the <hostnameUrl> value with the correct FQDN of the affected vCenter.
      • In the <sso> section, ensure all <uri> entries point to the correct PSC FQDN (or VCSA FQDN if embedded).
      • Replace the machine ID value with the one collected earlier.
      • If PostgreSQL version is present in the config, confirm it matches the version you gathered. If not present, you can skip this step.
      • If the vCenter manages itself, add this line just before </registry>:
        <key_VCVmId>vm-XXXX</key_VCVmId> (replace XXXX with the ID from the database query)

Option B -Edit directly on the affected VCSA using vi:

    • Copy the clean file to /tmp/vpxd.cfg on the broken VCSA. Then run:
      vi /tmp/vpxd.cfg

Make the same changes listed above using vi.

  1. Replace the Current Config File

On the affected VCSA:

    • Backup the original file:
      Rename /etc/vmware-vpx/vpxd.cfg to vpxd.cfg.bak

    • Replace it with the updated version:

      Move your edited file to /etc/vmware-vpx/vpxd.cfg
  1. Update the Database Password

If vcdb.properties contains a password, run:

      • /sbin/vpxd -p

You’ll be prompted to enter the password twice. If the file was empty, skip this step.

  1. Restart All vCenter Services

Run the following commands:

        • service-control --start vmware-vpxd