VMware vSphere vCenter Server installs an Active Directory Application Mode (ADAM) [aka Active Directory Lightweight Directory Service (ADLDS)] instance called VMwareVCMSDS. I have had several problems with this service — one issue with the contents of the directory (see vCenter Migration) and a couple with the actual ADAM/ADLDS instance. In a recent upgrade I moved a lab environment from vSphere 4.0 to 4.1 and started getting the following event log message:
VMwareVCMSDS (2428) ADAMDSA: Database 'D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\adamntds.dit': The secondary index 'INDEX_00000003' of table 'datatable' may be corrupt. If there is no later event showing the index being rebuilt, then please defragment the database to rebuild the index.
The solution to this problem was rather simple — but required working directly with the ADAM instance. This took a little trial and error but here is a description of the solution in case you run into the same error:
Stop the VMwareVCMSDS service:
net stop ADAM_VMwareVCMSDS
Enter the directory service database utility application:
dsdbutil
The following commands get you to the file configuration settings:
Activate Instance VMwareVCMSDS Files info
Here is my test systems file configuration:
Drive Information: C:\ NTFS (Fixed Drive ) free(5.4 Gb) total(23.9 Gb) D:\ NTFS (Fixed Drive ) free(2.6 Gb) total(3.9 Gb) DS Path Information: Database : D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\adamntds.dit - 4.1 Mb Backup dir : D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\dsadata.bak Working dir: D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS Log dir : D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS - 30.0 Mb total edbres00002.jrs - 10.0 Mb edbres00001.jrs - 10.0 Mb edb.log - 10.0 Mb
To compact/defrag the database type the following command in the dsdbutil screen:
compact to d:\temp\defragged
Here are the results of the compact operation:
Initiating DEFRAGMENTATION mode... Source Database: D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\adamntds.dit Target Database: d:\temp\defragged\adamntds.dit Defragmentation Status (% complete) 0 10 20 30 40 50 60 70 80 90 100 |----|----|----|----|----|----|----|----|----|----| ................................................... It is recommended that you immediately perform a full backup of this database. If you restore a backup made before the defragmentation, the database will be rolled back to the state it was in at the time of that backup. Compaction is successful. You need to: copy "d:\temp\defragged\adamntds.dit" "D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\adamntds.dit" and delete the old log files: del D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\*.log
I created a zip file contianing all the files in: “D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS” before proceeding with the given instructions.
copy "d:\temp\defragged\adamntds.dit" "D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\adamntds.dit"
Answering yes to the overwrite files confirmation.
del "D:\Program Files\VMware\Infrastructure\VirtualCenter Server\VMwareVCMSDS\*.log"
After completing the defragmentation I started the VMwareVCMSDS service again but had problems authenticating back to vCenter. Instead of restarting the vCenter service I went ahead and rebooted the server — which seems to have cleared up all my errors.