Recently, had an issue with 2 view Desktop Pools that were stuck in Deleting state in horizon view manager. We are running Horizon View 7.2 and this issue happening since View 4.x.
Out of 2 Pools, I was able to delete one pool by just removing the VM from Resources-->Machines--> Filtered using Pool name.But when doing the same thing for the TEST-Pool I was getting an error as below,
"Machine","Desktop Pool","DNS Name","User","Host","Agent Version","Datastore","Status"
"TEST-POOL-046","TEST-POOL","TEST-POOL-046.TEST.LOCAL","","esx3.TEST.LOCAL","Unknown","[TEST-VCENTER1VSAN]","Status:Error Status Errors:Nov 30, 2017 10:38:20 PM PST: Failed to delete VM - null"
So I logged in to the connection server and found the following error logs,
C:\programdata\vmware\vdm\logs\debug-2017-11-30-221023.txt
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2017-11-30T22:48:16.169-08:00 DEBUG (0B74-1010) <propagate-8512659f-1a31-4f16-aa4a-9ae9370566d1> [VirtualCenterDriver] Pool TEST-POOL recovery: waiting for result of recovery action for TEST-POOL-046
2017-11-30T22:49:03.349-08:00 DEBUG (0608-168C) <HAResourceManager> [PendingOperationSet] com.vmware.vdi.desktopcontroller.VirtualCenterDriver@2c5ce1d8 Received Prepare from TEST-CONSERVER1 for DeletingLC on /test-vcenter1/vm/TEST-POOL/TEST-POOL-046(/test-vcenter1/vm/TEST-POOL/TEST-POOL-046)
2017-11-30T22:49:03.349-08:00 DEBUG (0608-168C) <HAResourceManager> [VirtualCenterDriver] Accepting Prepare from TEST-CONSERVER1 for DeletingLC on /test-vcenter1/vm/TEST-POOL/TEST-POOL-046(/test-vcenter1/vm/TEST-POOL/TEST-POOL-046)
2017-11-30T22:49:03.357-08:00 DEBUG (0B74-1010) <propagate-8512659f-1a31-4f16-aa4a-9ae9370566d1> [VirtualCenterDriver] cn=TEST-POOL,ou=server groups,dc=vdi,dc=vmware,dc=int::determineDeletingChanges::Attempting deletion of ipHostNumber=TEST-POOL-046.TEST.LOCAL/-/192.168.10.2, ipHostNumberOverride not set (VM was marked for deletion)
BROKER_PROVISIONING_SVI_ERROR_REMOVING_VM
Provisioning error occurred for Machine TEST-POOL-046: Unable to remove Machine from inventory
Attributes:
MachineId=29539968-1089-4240-bb00-043f1580559e
MachineName=TEST-POOL-046
Node=TEST-CONSERVER1.TEST.LOCAL
Severity=ERROR
Time=Thu Nov 30 22:49:05 PST 2017
Module=Broker
Source=com.vmware.vdi.desktopcontroller.PendingOperation
Acknowledged=true
2017-11-30T22:49:05.591-08:00 ERROR (0B74-8F18) <PendingOperation-/test-vcenter1/vm/TEST-POOL/TEST-POOL-046-DeletingLC> [PendingOperation] Pool TEST-POOL::Unable to remove from inventory VM /test-vcenter1/vm/TEST-POOL/TEST-POOL-046 - null
2017-11-30T22:49:05.591-08:00 DEBUG (0B74-8F18) <PendingOperation-/test-vcenter1/vm/TEST-POOL/TEST-POOL-046-DeletingLC> [EventLogger] Error_Event:[BROKER_PROVISIONING_SVI_ERROR_REMOVING_VM] "Provisioning error occurred for Machine TEST-POOL-046: Unable to remove Machine from inventory": MachineId=29539968-1089-4240-bb00-043f1580559e, MachineName=TEST-POOL-046, Node=TEST-CONSERVER1.TEST.LOCAL, Severity=ERROR, Time=Thu Nov 30 22:49:05 PST 2017, Module=Broker, Source=com.vmware.vdi.desktopcontroller.PendingOperation, Acknowledged=true
2017-11-30T22:49:05.591-08:00 DEBUG (0B74-8F18) <PendingOperation-/test-vcenter1/vm/TEST-POOL/TEST-POOL-046-DeletingLC> [VmInformation] ::Updating VM state /test-vcenter1/vm/TEST-POOL/TEST-POOL-046 ERROR ERROR: Failed to delete VM - null
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The google search was always pointing to the KB https://kb.vmware.com/s/article/2015112, but the solutions based on editing/removing from the ADAM DB or Composer DB.
So wanted to try the powerful command viewdbcheck.cmd from the connection server and this can be found under C:\Program Files\VMware\VMware View\Server\tools\bin\ in the connection server.
The ViewDbChk tool allows administrators to scan for and fix provisioning errors that can not be addressed using View Administrator. Provisioning errors can occur when there are inconsistencies between the LDAP, vCenter and View Composer databases. These inconsistencies can be caused by (but are not limited to) 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 cannot be provisioned and removes all invalid database entries from the necessary databases.
Read more about viewcheckdb.cmd from here:https://kb.vmware.com/s/article/2118050.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
C:\Program Files\VMware\VMware View\Server\tools\bin>viewdbcheck.cmd --scanMachines --limit 10
Processing desktop pool "TEST-POOL"
Desktop Pool Name: TEST-POOL
Desktop Pool Type: AUTO_LC_TYPE
VM Folder: /TEST-VCENTER1/vm/TEST-POOL/
Desktop Pool Disabled: true
Desktop Pool Provisioning Enabled: false
Checking connectivity...
Machine "TEST-POOL-046" has errors
VM Name: TEST-POOL-046
Creation Date: 2/6/17 7:46:08 PM PST
MOID: vm-13657
Clone Id: 93e5fd0b-d51e-4a1f-bfa3-3c1f043c3226
VM Folder: /TEST-VCENTER1/vm/TEST-POOL/TEST-POOL-046
VM State: ERROR
VM Clone Error: Failed to delete VM - null
VM Clone Error Time: Nov 30, 2017 11:24:00 PM PST
View Composer Error: Failed to delete VM - null
Do you want to remove the desktop machine "TEST-POOL-046"? (yes/no):yes
Shutting down VM "/TEST-VCENTER1/vm/TEST-POOL/TEST-POOL-046"...
Archiving persistent disks...
Destroying View Composer clone "93e5fd0b-d51e-4a1f-bfa3-3c1f043c3226"...
Removing ThinApp entitlements for machine "/TEST-VCENTER1/vm/TEST-POOL/TEST-POOL
-046"...
Removing machine "/TEST-VCENTER1/vm/TEST-POOL/TEST-POOL-046" from LDAP...
Running delete VM scripts for machine "/TEST-VCENTER1/vm/TEST-POOL/TEST-POOL-046
"...
Provisioning has been disabled for the desktop pool "TEST-POOL". Do you want to
enable it? (yes/no):no
Do you want to enable the desktop pool "TEST-POOL"? (yes/no):no
java.lang.Exception: ** ERROR: Failed to find desktop for "cn=TEST-POOL,ou=serv
er groups,dc=vdi,dc=vmware,dc=int" **
at com.vmware.vdi.viewdbchk.desktop.MiniPoolInformation.disableDesktopAn
dPool(MiniPoolInformation.java:245)
at com.vmware.vdi.viewdbchk.command.PoolHelper.promptEnablePool(PoolHelp
er.java:214)
at com.vmware.vdi.viewdbchk.command.ScanMachines.execute(ScanMachines.ja
va:183)
at com.vmware.vdi.viewdbchk.command.ViewDbCmd.execute(ViewDbCmd.java:409
)
at com.vmware.vdi.viewdbchk.ViewDbChk.go(ViewDbChk.java:129)
at com.vmware.vdi.viewdbchk.ViewDbChk.main(ViewDbChk.java:62)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
When running viewdbcheck.cmd you can specify the pool name and how many VMs need to be removed and the desktop pool name also. From the above output, this VM TEST-POOL-046 had a provisioning error and which was preventing the desktop pool deletion from the Horizon View Manager.Once the VM is removed it was asking whether to enable the pool or not since the pool was already stuck in deleting state once the VM is removed the pool also got removed immediately.
Comments
Post a Comment
Please leave your valuable comment to improvise the content.