vCenter 7.x Upgrade Failure: ‘Failed to Set Hostname’ Error
search cancel

vCenter 7.x Upgrade Failure: ‘Failed to Set Hostname’ Error

book

Article ID: 315565

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

General troubleshooting/Workaround to fix the upgrade issue where PNID and nslookup have inconsistent upper or lower case

Symptoms:
vCenter Server 7.x fails to upgrade with error "Failed to set Hostname" when PNID and nslookup have inconsistent upper or lower case

For Example:

PNID: VCENTER.SAMPLE.DOMAIN
nslookup: vcenter.sample.domain

If you try to change the PNID all in lower case from VAMI, you will get below error "Adding new CN entries failed"

Log snippet from /var/log/vmware/applmgmt/pnid_change.log

YYYY-MM-DD HH:MM:SS,XXX - pnid utils-update ldap entries () : 594 - INFO - Successfully connected to LDAP.
YYYY-MM-DD HH:MM:SS,XXX - pnid_utils-search_all_cn_hostname () :157 - INFO - Hostname CN search result count 2
YYYY-MM-DD HH:MM:SS,XXX - pnid utils-add new cn entries () : 193 - INFO - Adding new DN entry cn=vcenter.sample.domain, cn=Servers,cn=Default-First-Site, cn=Sites, cn=Configuration, dc=vsphere, dc=local
YYYY-MM-DD HH:MM:SS,XXX - pnid utils-add new cn entries () :248 - ERROR - Failed to add dn : cn=vcenter.sample.domain, cn=Servers,cn=Default-First-Site, cn=Sites, cn=Configuration, dc=vsphere,dc=local
YYYY-MM-DD HH:MM:SS,XXX - pnid utils-add new_cn entries () : 193 - INFO - Adding new DN entry cn=vcenter.sample.domain, ou=Domain Controllers, dc=vsphere, dc=local
YYYY-MM-DD HH:MM:SS,XXX - pnid_utils-add_new_cn_entries () : 248 - ERROR - Failed to add dn : cn=vcenter.sample.domain, ou=Domain Controllers, dc=vsphere, dc=local
YYYY-MM-DD HH:MM:SS,XXX - pnid_utils-update_task_status () : 1441 - INFO - Task : Adding new CN entries failed.
YYYY-MM-DD HH:MM:SS,XXX - pnid utils-secure delete () : 1301 - INFO - Removing file : /var/vmware/applmgmt/pnid/pnid_change.cfg

Environment

VMware vCenter Server 7.0.1

Cause

Due to inconsistency of the name format with the nslookup hostname set fails

 

Resolution

Solution 1:

  • The issue with the PNID change workflow has been identified, and a resolution is actively being worked on to address this behavior and ensure proper handling in future scenarios.
  • Before proceeding with the steps below, ensure that you have a complete backup or snapshot of the vCenter.
  • To work around this issue, follow these steps to change the PNID:
    • Update the DNS records before changing the FQDN.
    • Change the PNID to a temporary FQDN (e.g., appliance.vmware.com). Ensure the PNID is unique.
    • Reboot the vCenter (this is necessary to update the Likewise registry).
    • Update the DNS records again to the desired FQDN.
    • Change the PNID to the desired FQDN.

Solution 2:

  • Take a snapshot of the vCenter before applying the solution below.
  • To resolve this issue, access the vCenter Appliance via SSH and update the FQDN to match the case of the PNID.
    • Retrieve the PNID value using vmafd-cli:
      /usr/lib/vmware-vmafd/bin/vmafd-cli get-pnid --server-name localhost
    • Run the VAMI network configuration tool:
      /opt/vmware/share/vami/vami_config_net
      Select option 3, "hostname," and enter the PNID obtained in step 1.
    • Retry the upgrade.

Additional Information

Impact/Risks:

Unable to upgrade vCenter