vCenter Server patch/upgrade fails due to an incorrect machine ID in lwregshell
search cancel

vCenter Server patch/upgrade fails due to an incorrect machine ID in lwregshell

book

Article ID: 312479

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • vCenter Server failed to upgrade with 'Exception occured in postInstallHook' error.
  • When reviewing /var/log/vmware/applmgmt/PatchRunner.log, the below errors are seen:
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'"
        }
    ],
    "componentKey": null,
    "problemId": null,
    "resolution": null
}

Environment

VMware vCenter Server 7.0.x
 
VMware vCenter Server 8.0.x
 
 

Cause

This is caused due to an incorrect or missing machine ID in lwregshell

Resolution

1) Check the current machine ID.

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

   or

 /opt/likewise/bin/lwregshell ls "[HKEY_THIS_MACHINE\Services\vmdir]" | grep MachineGuid | awk '{print $2,$NF}'
   
2) Use the VDT tool to validate for the machine ID details and ensure it matches with the output from Step1.Refer to : Download vSphere Diagnostic Tool and upload to vCenter Server to run vdt script.

3) Update the correct machine ID in lwregshell using:

   /opt/likewise/bin/lwregshell set_value '[HKEY_THIS_MACHINE\Services\vmdir]' "MachineGuid" <Correct Machine-ID from step 2>

4) If MachineGuid section is missing in lwregshell, set_value would fail.

    To check if MachineGuid field exists, run this:

    /opt/likewise/bin/lwregshell ls "[HKEY_THIS_MACHINE\Services\vmdir]"
   
5) If 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 correct machine ID using the CMD from step 3.