With the ViewDbChk command, you can resolve inconsistencies in the databases that store information about desktop virtual machines.

In a View environment, information about desktop virtual machines is stored in three places:

  • The LDAP database

  • The View Composer database

  • The vCenter Server database

Normally, you can recover from an error that occurs during provisioning or other operations by removing or resetting a desktop virtual machine using View Administrator. On rare occasions, the information in the different databases about a machine that is in an error state might become inconsistent and it is not possible to recover from the error using View Administrator. You might see one of the following symptoms:

  • Provisioning fails with the error message Virtual machine with Input Specification already exists.

  • Recomposing a desktop pool fails with the error message Desktop Composer Fault: Virtual Machine with Input Specification already exists.

  • View Administrator shows that a desktop machine is stuck in a deleting state.

  • You cannot delete a desktop pool.

  • You cannot delete a desktop machine.

  • In View Administrator's Inventory tab, the status of a desktop machine is missing.

In situations where database inconsistencies cause a desktop machine to be in an unrecoverable error state or prevent a View Administrator task from completing successfully, you can use the ViewDbChk command to resolve the inconsistencies. The ViewDbChk command has the following characteristics:

  • ViewDbChk is automatically installed when you install View Standard Server or View Replica Server. The utility is not installed when you install View Security Server.

  • ViewDbChk is a command that you can run from the Windows Command Prompt or from a script.

  • ViewDbChk supports automated desktop pools of full virtual machines as well as View Composer linked clones.

  • When you want to remove a virtual machine, ViewDbChk performs a health check on the machine and prompts you for additional confirmation it the machine looks healthy.

  • ViewDbChk can delete erroneous or incomplete LDAP entries.

  • ViewDbChk supports input and output using I18N character sets.

  • ViewDbChk does not remove user data. For a full virtual machine, ViewDbChk removes the virtual machine from inventory but does not delete it from disk. For a linked clone virtual machine, ViewDbChk deletes the virtual machine and archives the user disks to the root folder in the case of VMFS datastores or to a sub-folder named archiveUDD in the case of Virtual SAN and Virtual Volumes datastores..

  • ViewDbChk does not support unmanaged machines.

ViewDbChk Syntax

ViewDbChk --findDesktop --desktopName <desktop name> [--verbose]

ViewDbChk --enableDesktop --desktopName <desktop name> [--verbose]

ViewDbChk --disableDesktop --desktopName <desktop name> [--verbose]

ViewDbChk --findMachine --desktopName <desktop name> --machineName <machine name> [--verbose]

ViewDbChk --removeMachine --machineName <machine name> [--desktopName <desktop name>] [--force] [--noErrorCheck] [--verbose]

ViewDbChk --scanMachines [--desktopName <desktop name>] [--limit <maximum deletes>] [--force] [--verbose]

ViewDbChk --help [--commandName] [--verbose]

ViewDbChk Parameters

Parameter

Description

--findDesktop

Finds a desktop pool.

--enableDesktop

Enables a desktop pool.

--disableDesktop

Disables a desktop pool.

--findMachine

Finds a machine.

--removeMachine

Removes a machine from a desktop pool. Before removing a machine, ViewDbChk prompts the user to disable the desktop pool. After removing the machine, ViewDbChk prompts the user to re-enable the desktop pool.

--scanMachines

Searches for machines that are in an error or cloneerror state or have missing virtual machines, lists the problem machines grouped by desktop pool, and gives the option to remove the machines. Before removing a machine, ViewDbChk prompts the user to disable the desktop pool. After removing all erroneous machines in a desktop pool, ViewDbChk prompts the user to re-enable the desktop pool.

--help

Displays the syntax of ViewDbChk.

--desktopName <desktop name>

Specifies the desktop pool name.

--machineName <machine name>

Specifies the machine name.

--limit <maximum deletes>

Limits the number of machines that ViewDbChk can remove. The default is 1.

--force

Forces machine removal without user confirmation.

--noErrorCheck

Forces the removal of machines that have no errors.

--verbose

Enables verbose logging.

Note:

All the parameter names are case-sensitive.

ViewDbChk Usage Example

A desktop machine named lc-pool2-2 is in an error state and we cannot remove it using View Administrator. We use ViewDbChk to remove it from the View environment.

C:\>viewdbchk --removeMachine --machineName lc-pool2-2 
Looking for desktop pool "lc-pool2" in LDAP...
   Desktop Pool Name: lc-pool2
   Desktop Pool Type: AUTO_LC_TYPE
   VM Folder: /vdi/vm/lc-pool2/
   Desktop Pool Disabled: false
   Desktop Pool Provisioning Enabled: true
Looking for machine "/vdi/vm/lc-pool2/lc-pool2-2" in vCenter...
   Connecting to vCenter "https://10.133.17.3:443/sdk". This may take some time...
Checking connectivity...
   Connecting to View Composer "https://10.133.17.3:18443". This may take some time...
The desktop pool "lc-pool2" must be disabled before proceeding. Do you want to disable the desktop pool? (yes/no):yes
Found machine "lc-pool2-2"
   VM Name: lc-pool2-2
   Creation Date: 1/25/15 1:20:26 PM PST
   MOID: vm-236
   Clone Id: b12a9ed2-8535-44ee-a9d6-6c9b5cf6f878
   VM Folder: /vdi/vm/lc-pool2/lc-pool2-2
   VM State: ERROR
Do you want to remove the desktop machine "lc-pool2-2"? (yes/no):yes
Shutting down VM "/vdi/vm/lc-pool2/lc-pool2-2"...
Archiving persistent disks...
Destroying View Composer clone "b12a9ed2-8535-44ee-a9d6-6c9b5cf6f878"...
Removing ThinApp entitlements for machine "/vdi/vm/lc-pool2/lc-pool2-2"...
Removing machine "/vdi/vm/lc-pool2/lc-pool2-2" from LDAP...
Running delete VM scripts for machine "/vdi/vm/lc-pool2/lc-pool2-2"...
Do you want to enable the desktop pool "lc-pool2"? (yes/no):yes