There are multiple ways to reset the Inventory Service database in VMware vCenter Server 5.x:
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.
- Stop the vCenter Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Stop.
- 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.
- Click Start > Run, type cmd, and click OK. The Command Prompt window opens.
- 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"
- Rename the folder C:\Program Files\VMware\Infrastructure\Inventory Service\data.
For example:
C:\Program Files\VMware\Infrastructure\Inventory Service\data.old
- Change directory to C:\Program Files\VMware\Infrastructure\Inventory Service\scripts by running this command:
cd C:\Program Files\VMware\Infrastructure\Inventory Service\scripts
- Run the createDB.bat command with no arguments to reset the vCenter Server Inventory Service database.
- 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"/>
- Start the VMware vCenter Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Start.
- Change directory to C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool by running the command:
cd C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool
- 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 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
- Restart the VMware VirtualCenter Server service. The vCenter Inventory Service database is now reset.
- 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.
- Stop the vCenter Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Stop.
- Click Start > Run, type cmd, and click OK. The Command Prompt window opens.
- 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"
- Rename the folder C:\Program Files\VMware\Infrastructure\Inventory Service\data.
For example:
C:\Program Files\VMware\Infrastructure\Inventory Service\data.old
- Change directory to C:\Program Files\VMware\Infrastructure\Inventory Service\scripts by running the command:
cd C:\Program Files\VMware\Infrastructure\Inventory Service\scripts
- Run the createDB.bat command with no arguments to reset the vCenter Server Inventory Service database.
- 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"/>
- 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
- Start the vCenter Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Start.
- 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.
- Stop the vCenter Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Stop.
- Open a PowerShell prompt.
- 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'</font>
- 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"
- 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.
- 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"</font>
- Start the VMware vCenter Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Start.
- Re-register the vCenter Inventory Service with vCenter Server:
- Run this command to start Command Prompt within PowerShell:
cmd.exe
- Change directory to C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool by running the command:
cd C:\Program Files\VMware\Infrastructure\VirtualCenter Server\isregtool
- 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=
- Execute this command to exit from the nest Command Prompt:
Exit
- Restart vCenter Server. The vCenter Inventory Service database is now reset.
- 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.
- Stop the vCenter Server Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Stop.
- Open a PowerShell prompt.
- 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'</font>
- 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"
- 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.
- 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"</font>
- Re-register the vCenter Inventory Service with vCenter Server:
- Run this command to start Command Prompt within PowerShell:
cmd.exe
- Change directory to C:\Program Files\VMware\Infrastructure\Inventory Service\scripts by running the command:
cd C:\Program Files\VMware\Infrastructure\Inventory Service\scripts
- 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
- Execute this command to exit from the nest Command Prompt:
Exit
- Start the vCenter Inventory Service:
- From the Windows Administrative Tools control panel, click Services.
- Right-click VMware vCenter Inventory Service and click Start.
- 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.