Error: Pre-check fails with Machine ID mismatch during vCenter Server upgrade
search cancel

Error: Pre-check fails with Machine ID mismatch during vCenter Server upgrade

book

Article ID: 312479

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • vCenter Server upgrade installer fails during the Stage 2 pre-check validation as it detects inconsistency in the machine identity across internal services. It can be verified using VCF Diagnostic Tool (VDT).
  • VCSA upgrade pre-check fails with the following error messages:

    Exception occurred in postInstallHook
    Internal error occurs during execution of the upgrade process

  • Certificate management operations may return [Errno 8] Exec format error if binary corruption accompanies the mismatch.
  • When running the VDT script, the section for VC Machine ID Check 'Compare Machine ID (VMAFD vs. registry)' and/or 'Compare Machine ID (vpxd.cfg vs. registry)' shows as failed.

    VC Machine ID Check

                [FAIL]    Machine ID Check
                            Machine ID doesn't match vpxd.cfg
                              Current MID: abc#####-####-####-####-########
                              Correct MID: 123#####-####-####-####-#########
                              Recommended command (service restart required):
                                    /usr/lib/vmware-vmafd/bin/vmafd-cli set-machine-id --server-name localhost --id 123#####-####-####-####-#########

  • vCenter - /var/log/vmware/applmgmt/PatchRunner.log

    patch_errors.UserError: vstats.patch.incrementalPatching.fail: Failed to apply patch: patch_04 due to: {
        "detail": [
            {
                "id": "install.ciscommon.command.errinvoke",
                "translatable": "An error occurred while invoking external command : '%(0)s'",
                "args": [
                    "Error 166 while adding user vpxd-extension-########-####-####-####-############ to SSO group \"vStatsGroup\":\ndir-cli failed, error= Specified User or Group to be added doesn't exist. 100006\n"
                ],
                "localized": "An error occurred while invoking external command : 'Error 166 while adding user vpxd-extension-########-####-####-####-############ to SSO group \"vStatsGroup\":\ndir-cli failed, error= Specified User or Group to be added doesn't exist. 100006\n'"
            }
        ],
        "componentKey": null,
        "problemId": null,
        "resolution": null
    }, 5, {
        "detail": [
            {
                "id": "install.ciscommon.command.errinvoke",
                "translatable": "An error occurred while invoking external command : '%(0)s'",
                "args": [
                    "Error 166 while adding user vpxd-extension-########-####-####-####-############ to SSO group \"vStatsGroup\":\ndir-cli failed, error= Specified User or Group to be added doesn't exist. 100006\n"
                ],
                "localized": "An error occurred while invoking external command : 'Error 166 while adding user vpxd-extension-########-####-####-####-############ to SSO group \"vStatsGroup\":\ndir-cli failed, error= Specified User or Group to be added doesn't exist. 100006\n'"

Environment

  • VMware vCenter Server 7.x
  • VMware vCenter Server 8.x
  • VMware vCenter Server 9.x

Cause

The MachineGuid value stored within the local Likewise registry (vmdir service) is missing or desynchronized from the authoritative Machine ID managed by VMAFD and referenced in /etc/vmware-vpx/vpxd.cfg.

Resolution

Update the Likewise registry to match the authoritative VMAFD Machine ID.

  1. Take an offline (powered off) snapshot of the vCenter Server. If the VCSA is part of an Enhanced Linked Mode setup, take offline snapshots of all replication partners. Refer to Snapshot best practices for vCenter Server virtual machines for additional information. 

  2. SSH to vCenter via root
  3. Retrieve the active machine ID

    /usr/lib/vmware-vmafd/bin/vmafd-cli get-machine-id --server-name localhost

  4. Check if the MachineGuid field exists in the registry: 

    /opt/likewise/bin/lwregshell ls "[HKEY_THIS_MACHINE\Services\vmdir]"

    Expected Output

    root@vCenterFQDN [ ~ ]# /opt/likewise/bin/lwregshell ls "[HKEY_THIS_MACHINE\Services\vmdir]"

    [\\Services\vmdir]
     "Arguments"         REG_SZ          "/usr/lib/vmware-vmdir/sbin/vmdird -L /var/log/vmware/vmdird/vmdird.log -l 0 -f /usr/lib/vmware-    vmdir/share/config/vmdirschema.ldif"
     "Autostart"          REG_DWORD       0x00000001 (1)
     "dcAccount"          REG_SZ          "vCenterFQDN"
     "dcAccountDN"        REG_SZ          "cn=vCenterFQDN,ou=Domain Controllers,dc=vsphere,dc=local"
     "dcAccountPassword"  REG_SZ          "########"
     "DirtyShutdown"      REG_DWORD       0x00000000 (0)
     "LduGuid"            REG_SZ          "#######-####-####-####-#########"
     "MachineGuid"        REG_SZ          "#######-####-####-####-#########"
     "SiteGuid"           REG_SZ          "#######-####-####-####-#########"
     "Dependencies"       REG_SZ          "vmafd"
     "Description"        REG_SZ          "VMware Directory Service"
     "Environment"        REG_SZ          ""
     "Path"               REG_SZ          "/usr/lib/vmware-vmdir/sbin/vmdird"
     "Type"               REG_DWORD       0x00000001 (1)

    [HKEY_THIS_MACHINE\Services\vmdir\Parameters]

  5. If the MachineGuid field does not exist, add it manually using a temporary value: 

    /opt/likewise/bin/lwregshell add_value '[HKEY_THIS_MACHINE\Services\vmdir]' MachineGuid REG_SZ 1

  6. Update the MachineGuid to the correct value obtained in Step 3: 

    /opt/likewise/bin/lwregshell set_value '[HKEY_THIS_MACHINE\Services\vmdir]' "MachineGuid" <Correct_UUID>

  7. Restart all vCenter services: 

    service-control --stop --all && service-control --start --all

  8. Re-run the vCenter upgrade pre-check or VDT to confirm the failure is resolved.

Additional Information