Search the VMware Knowledge Base (KB)
View by Article ID

Resetting the VMware vCenter Server 5.x Inventory Service database (2042200)

  • 76 Ratings
Language Editions

Purpose

This article provides steps to reset the Inventory Service database for vCenter Server 5.0, vCenter Server 5.1, and vCenter Server 5.5 installed on a Microsoft Windows Server. For more information on resetting the vCenter Server Appliance Inventory Service database, see vCenter Inventory Service fails to start in vCenter Server Appliance 5.x (2037952).
 

For more information on VMware vCenter Inventory Service, see the vCenter Inventory Service section in the VMware vCenter Server 5.5 Deployment Guide.

Important:
  • vCloud Director matches Storage Policies/Profiles name. This needs to be recorded and recreated exactly after an Inventory Service database resets. After you have created the Storage Policies/Profiles with the same name and the next sync occurs, vCloud Director picks up the Policy/Profile and the associated datastores. A Sync occurs every 5 minutes unless triggered. A Sync can be triggered from vCloud Director by selecting the vCenter Server, right-clicking and selecting Reconnect.
  • If Storage Profiles do not exist within the vCloud, the vCenter Server 5.1 and the vCenter Server 5.5 environment, then there is no expected effect on vCloud Director. If you reset the Inventory Service database, vCloud Director's connection with vCenter Server goes out of sync and does not have accurate information about managed virtual machines.
  • Any Storage Profiles that you are using through the vSphere Profile-Driven Storage service are lost when the Inventory Service database is reset.
  • All tags are deleted during a reset. 
  • If the vCenter Server is part of vCenter Server Heartbeat, replication needs to be stopped prior to performing these steps. Also, when running the re-point to the Inventory Service, the Public IP must be used. When it completes, restart the vCenter Server Heartbeat services to restore replication.
  • If the vCenter Server environment has Site Recovery Manager and you reset the Inventory Service database, you need to run a Change/Modify and Repair on Site Recovery Manager from the Windows Programs and Features to re-register Site Recovery Manager with the vCenter Server and Inventory Service.
  • If the environment uses VEEAM for backup operations, the jobs must be mapped to the virtual machines again.
  • Linked Mode should be disabled before running these steps. For more information, see Disabling Linked Mode for VMware vCenter Server 4.x and 5.x (1010432).
Note: This issue does not affect VMware View environments.

Resolution

Before resetting the VMware vCenter Server Inventory Service database, see Searching for virtual machines in the vSphere Client and vSphere Web Client return the error: Search returned no results (2124226) to check if it matches the symptoms you are experiencing.
To reset the VMware vCenter Server 5.5/5.1 Inventory Service database using Command Prompt:

Note: If you have installed vCenter Server in a location other than the default C:\Program Files\, adjust the path accordingly in these steps.
  1. Stop the vCenter Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Stop.

  2. Back up the current Inventory Service database. For more information, see the Back Up the Inventory Service Database on Windows section in the vSphere Installation and Setup guide.
  3. Click Start > Run, type cmd, and click OK. The Command Prompt window opens.
  4. Back up the xdb.bootstrap header by running this command:

    type "C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap"|findstr "<server" > "C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt"

  5. Rename the folder C:\Program Files\VMware\Infrastructure\Inventory Service\data.

    For example:

    C:\Program Files\VMware\Infrastructure\Inventory Service\data.old

  6. Change directory to C:\Program Files\VMware\Infrastructure\Inventory Service\scripts by running this command:

    cd C:\Program Files\VMware\Infrastructure\Inventory Service\scripts

  7. Run the createDB.bat command with no arguments to reset the vCenter Server Inventory Service database.
  8. Restore the xdb.bootstrap header. Copying the contents of the datahash1234321.txt created in Step 3 and replace the line <server version...> in the xdb.bootstrap file that is newly created.

    For example:

    Note: You must update text which is bold.

    <?xml version="1.0" encoding="UTF-8"?>
    <server version="xDB 9.0" pagesize="4096" license="025ByMJA6x1ZN#yYPyXyYTXQxSPQvdgXQEGP7PM5I" passwd="ay3OudfeqezYy+7vcdVYVWPrZjqi7rELGMsWhE9x">
    <log path="log" id="1388782839740" keep-log-files="false"/>

    Replace with content from datahash1234321.txt:

    <?xml version="1.0" encoding="UTF-8"?>
    <server version="xDB 1.0" pagesize="4096" license="025ByMJA6x1ZN#yYPyXyYTXQxSPQvdgXQEGP7PM5I" passwd="+3umz7whoCOr4iWkW2f2bqDUzkz5RVaesfaJ4g5H">
    <log path="log" id="1388782839740" keep-log-files="false"/>

  9. Start the VMware vCenter Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Start.

  10. Change directory to C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool by running the command:

    cd C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool

  11. Run the register-is.bat command to update the stored configuration information of the Inventory Service:

    register-is.bat vCenter_Server_URL Inventory_Service_URL Lookup_Service_URL

    For example:

    register-is.bat https://machinename.corp.com:443/sdk https://machinename.corp.com:10443 https://machinename.corp.com:7444/lookupservice/sdk

    In this example, 44310443, and 7444 are the default HTTPS port numbers for vCenter Server, the Inventory Service, and vCenter Single Sign-On (SSO) respectively. If you use custom ports, replace the port numbers in the example with the port numbers in use.

    Note: To save time when running the preceding command, you can substitute machinename.corp.com with an environment variable. Create the environment variable with the command:

    set vcenter=machinename.corp.com

    After resetting the database, you can clear the environment variable by running this command:

    set vcenter=

    Note: If the registration is successful, you see the output similar to:

    Shutting down CompiledHttpConfiguration@191758420 as there are no more clients.
    Client was disposed successfully
    Registration completed
    Finished performing register action
    0
    0


  12. Restart the VMware VirtualCenter Server service. The vCenter Inventory Service database is now reset.
  13. Verify that the Inventory Service is started correctly by waiting five minutes and attempting to use the search function in vCenter Server.
To reset the VMware vCenter Server 5.0 Inventory Service database using Command Prompt:

Note: If you have installed vCenter Server in a location other than the default C:\Program Files\, adjust the path accordingly in these steps.
  1. Stop the vCenter Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Stop.

  2. Click Start > Run, type cmd, and click OK. The Command Prompt window opens.
  3. Back up the xdb.bootstrap file header by running the command:

    type "C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap"|findstr "<server" > "C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt"

  4. Rename the folder C:\Program Files\VMware\Infrastructure\Inventory Service\data.

    For example:

    C:\Program Files\VMware\Infrastructure\Inventory Service\data.old

  5. Change directory to C:\Program Files\VMware\Infrastructure\Inventory Service\scripts by running the command:

    cd C:\Program Files\VMware\Infrastructure\Inventory Service\scripts

  6. Run the createDB.bat command with no arguments to reset the vCenter Server Inventory Service database.
  7. Restore the xdb.bootstrap header by copying the contents of the datahash1234321.txt created in Step 3 and replacing the line <server version...> in the xdb.bootstrap file freshly created. For example:

    Note:  Only the text in bold needs to be updated.

    <?xml version="1.0" encoding="UTF-8"?>
    <server version="xDB 9.0" pagesize="4096" license="025ByMJA6x1ZN#yYPyXyYTXQxSPQvdgXQEGP7PM5I" passwd="ay3OudfeqezYy+7vcdVYVWPrZjqi7rELGMsWhE9x">

    <log path="log" id="1388782839740" keep-log-files="false"/>

    Replace with content from datahash1234321.txt:

    <?xml version="1.0" encoding="UTF-8"?>
    <server version="xDB 1.0" pagesize="4096" license="025ByMJA6x1ZN#yYPyXyYTXQxSPQvdgXQEGP7PM5I" passwd="+3umz7whoCOr4iWkW2f2bqDUzkz5RVaesfaJ4g5H">
    <log path="log" id="1388782839740" keep-log-files="false"/>

  8. Run this command to update the stored configuration information of the Inventory Service:

    register.bat vCenter_Server_FQDN vCenter_Server_HTTPS_port

    For example, if the vCenter Server's fully qualified domain name (FQDN) is machinename.corp.com, and the HTTPS port is 443, run this command:

    register.bat machinename.corp.com 443

  9. Start the vCenter Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Start.

  10. Verify that the Inventory Service is started correctly by waiting for five minutes and then trying to use the search function in vCenter Server. If the search function does not work as expected, try restarting the VMware VirtualCenter Server service, or consider rebooting the server.


To reset the VMware vCenter Server 5.5/5.1 Inventory Service database using PowerShell:

Note: If you have installed vCenter Server in a location other than the default C:\Program Files\, adjust the path accordingly in the following steps.

  1. Stop the vCenter Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Stop.

  2. Open a PowerShell prompt.
  3. Back up the xdb.bootstrap header by running the command:

    Get-Content 'C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap' | Select-String -pattern "<server" | ForEach-Object { $_.line } | Out-File 'C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt'

  4. Remove the entire contents of the C:\Program Files\VMware\Infrastructure\Inventory Service\data directory by running the command:

    Move-Item "C:\Program Files\VMware\Infrastructure\Inventory Service\data" "C:\Program Files\VMware\Infrastructure\Inventory Service\data_old"

  5. Run the createDB.bat command with no arguments to recreate the vCenter Server Inventory Service database:

    Start-Process "C:\Program Files\VMware\Infrastructure\Inventory Service\scripts\createDB.bat"

    Note: This brings up a command prompt briefly as the batch file executes.

  6. Restore the xdb.bootstrap header by running the command:

    $oldcontent = [IO.FILE]::ReadAllText("C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt"); $newcontent = [IO.FILE]::ReadAllText("C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap"); $newcontent -replace "<server.+" , "$oldcontent" | Out-File "C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap"; remove-item "C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt"

  7. Start the VMware vCenter Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Start.

  8. Re-register the vCenter Inventory Service with vCenter Server:

    1. Run this command to start Command Prompt within PowerShell:

      cmd.exe


    2. Change directory to C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool by running the command:

      cd C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool

    3. Run the register-is.bat command to update the stored configuration information of the Inventory Service:

      register-is.bat vCenter_Server_URL Inventory_Service_URL Lookup_Service_URL

      For example:

      register-is.bat https://machinename.corp.com:443/sdk https://machinename.corp.com:10443 https://machinename.corp.com:7444/lookupservice/sdk

      In this example, 443, 10443, and 7444 are the default HTTPS port numbers for the vCenter Server, the Inventory Service, and vCenter Single Sign-On (SSO) respectively. If you use custom ports, replace the port numbers in the example with the port numbers in use.

      Note: To save time when running the preceding command, you can substitute machinename.corp.com with an environment variable. Create the environment variable with the command:

      set vcenter=machinename.corp.com

      After resetting the database, you can clear the environment variable with the command:

      set vcenter=


    4. Execute this command to exit from the nest Command Prompt:

      Exit

  9. Restart vCenter Server. The vCenter Inventory Service database is now reset.
  10. Verify that the Inventory Service is started correctly by waiting five minutes and attempting to use the search function in vCenter Server.

To reset the VMware vCenter Server 5.0 Inventory Service database using PowerShell:

Note: If you installed vCenter Server in a location other than the default C:\Program Files\, adjust the path accordingly in the following steps.
  1. Stop the vCenter Server Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Stop.

  2. Open a PowerShell prompt.
  3. Back up the xdb.bootstrap header by running the command:

    Get-Content 'C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap' | Select-String -pattern "<server" | ForEach-Object { $_.line } | Out-File 'C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt'

  4. Remove the entire contents of the C:\Program Files\VMware\Infrastructure\Inventory Service\data directory by running the command:

    Move-Item "C:\Program Files\VMware\Infrastructure\Inventory Service\data" "C:\Program Files\VMware\Infrastructure\Inventory Service\data_old"

  5. Run the createDB.bat command with no arguments to recreate the vCenter Server Inventory Service database:

    Start-Process "C:\Program Files\VMware\Infrastructure\Inventory Service\scripts\createDB.bat"

    Note: This brings up a command prompt briefly as the batch file executes.

  6. Restore the xdb.bootstrap header by running the command:

    $oldcontent = [IO.FILE]::ReadAllText("C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt"); $newcontent = [IO.FILE]::ReadAllText("C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap"); $newcontent -replace "<server.+" , "$oldcontent" | Out-File "C:\Program Files\VMware\Infrastructure\Inventory Service\data\xdb.bootstrap"; remove-item "C:\Program Files\VMware\Infrastructure\Inventory Service\datahash1234321.txt"

  7. Re-register the vCenter Inventory Service with vCenter Server:

    1. Run this command to start Command Prompt within PowerShell:

      cmd.exe

    2. Change directory to C:\Program Files\VMware\Infrastructure\Inventory Service\scripts by running the command:

      cd C:\Program Files\VMware\Infrastructure\Inventory Service\scripts

    3. To update the stored configuration information of the Inventory Service, run the command:

      register.bat
      vCenter_Server_FQDNvCenter_Server_HTTPS_port

      For example, if the vCenter Server's fully qualified domain name (FQDN) is machinename.corp.com, and the HTTPS port is 443, run this command:

      register.bat machinename.corp.com 443

    4. Execute this command to exit from the nest Command Prompt:

      Exit

  8. Start the vCenter Inventory Service:

    1. From the Windows Administrative Tools control panel, click Services.
    2. Right-click VMware vCenter Inventory Service and click Start.

  9. Verify that the Inventory Service is started correctly by waiting for five minutes and then try to use the search function in vCenter Server. If the search function does not work as expected, try restarting the VMware VirtualCenter Server service, or consider rebooting the server.

Additional Information

Resetting Inventory database causes vSphere tags to be deleted. For more information on backup and restore of the tags, see Using vSphere Tags with PowerCLI.

Tags

vcenter inventory service not running, Inventory service database corrupted, reset inventory service database, corrupt inventory service database

See Also

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 76 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 76 Ratings
Actions
KB: