ViewDbChk is new free utility from VMware Labs which allows to fix VMware Horizon View database in case you're experiencing provisioning errors. The creator of ViewDbChk is Griff James. The utility allows to clean the DB from orphaned Horizon View desktop pools or individual desktops. If an admin has deleted a VM from within the vSphere client instead of doing the operation through Horizon view Management console, the object still exists in the Horizon view Db. This can happen, but in this case the View Db is left with an orphaned items and you can't delete the object through the Horizon view Web based console.
Quote from the release:
The ViewDbChk tool allows administrators to scan for, and fix provisioning errors that can not be addressed using View Administrator. Provisioning errors occur when there are inconsistencies between the LDAP, vCenter and View Composer databases. These can be caused by: direct editing of the vCenter inventory, restoring a backup, or a long term network problem.
This tool allows VMware View administrators to scan for machines which can not be provisioned and remove all database entries for them. The View Connection Server will then be able to re-provision the machine without any errors.
Orphaned view desktops or desktop pools are one thing. Orphaned view replica (in case you're using linked clones) is another thing. If you have such a problem, I have wrote a quick tip in case you got stuck and unable to delete orphaned view replica.
But let's get back to this new utility – ViewDbChk.
ViewDbChk – Here is what you need to do for installation:
01. Download the VMware ViewDbChk zip file.
02. Create a new directory that is independent of the existing View Server installation.
03. Unzip the ViewDbChk zip file into the new directory.
04. Open a command prompt and ‘cd' to the new directory.
05. Type ‘viewdbchk' to display the tool's help.
Just type viewdbchk and you'll see all the options:
You can use individual commands or just the –scanMachines option which scan the full DB for all machines. You can limit the scan to a single machine, desktop pool. You can also force remove machines without user confirmation.
Scan your Horizon View Database with ViewDbChk
You see that in my lab there aren' t any errors… (note the command options are case sensitive).
If you using composer and linked clones, and you got errors that “Virtual Machine with Input Specification already exists” then you have to go through with an utility called sviconfig (Virtual Machine with Input Specification already exists).
View Composer and vCenter Server to refer to the same virtual machine with different names.That’s a problem. You should NOT do this, definitely. Manually change a name of a VM through vCenter Server after the pool has been created. So If you broke the link, the composer throws you an error like this one: Desktop Composer Fault: ‘Virtual Machine with Input Specification already exists'. You gonna have to make a changes to the ADAM database. Check the solution here.
ViewDbChk can be downloaded from this page at VMware Labs Website. Enjoy… -:)