13 August 2015

Orphaned vmdk search return exception on large Datastores

One of the challenges working with Vmware vcenter is keeping clean and healthy datastores. Making sure only vmdk files registered with active VMs is stored on Datastores is one example.
For this purposes there are numerous scripts around that will compare the files of registered VMs with the actual list of vmdk files found in a Datastore
Examples:


There is however one problem no one seem to be able to address at all accross all these scripts. When you search "very" large datastores and the esxcli / powercli have been running for 15 minutes the script get an exception. (Our VDI linkedclone datastore is very large)
Exception calling "SearchDatastoreSubFolders" with "2" argument(s): "An error o
ccurred while communicating with the remote host."
At xxxxx
+     $searchResult = $dsBrowser.SearchDatastoreSubFolders <<<< ($rootPath, $se
archSpec)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException".

I noticed the exception message was about the remote host so I figured it must be vCenter / ESXi related.

Based on above finding I found this vmware KB article that describe how to increase the timeout for tasks to vCenter and ESXCLI to much more than the default 15 minutes. I implemented the KB article on my vCenter server and on all the ESXi hosts in the cluster. This did the trick for me and I can now complete the datastore search. More specific I'm now able to complete this line of code from the scripts without the exception:
$xxx.SearchDatastoreSubFolders($rootPath, $searchSpec)

I will not list my specific actions as they are covered in the KB article. However the article doesn't mention that the vpxa.cfg file is read only on the ESXi 5.5 host so you need to run the following to get write access
chmod u+w /etc/vmware/vpxa/vpxa.cfg

I hope this makes sense for everyone.
Please comment if you have any questions or feedback.

16 December 2014

Lync Response Group Usage Report very slow or not completing

In Lync 2013 it's possibly to generate reports in SQL reporting services. This works fine for all except the "Response Group Usage Report".

The problem is that the report never finish unless it's given a very short time window. I posted this in the Lync forum here and a very kind person who been in contact with Microsoft support posted the SQL script below.

The script creates two index that help speed up the stored procedure that fetch the data for the report.

Someone asked if this can be made more visibly so I created this blog / post. Enjoy!!
Please provide any feedback as this is my first blog / post about anything.

/*
USE [LcsCDR]
GO
DROP INDEX [IX_SessionDetails_CorrelationId_SessionIdTime] ON [dbo].[SessionDetails]
GO
*/

CREATE NONCLUSTERED INDEX [IX_SessionDetails_CorrelationId_SessionIdTime] ON [dbo].[SessionDetails]
(
 [CorrelationId] ASC,
 [SessionIdTime] ASC,
 [ReplacesDialogIdTime] ASC,
 [ReplacesDialogIdSeq] ASC,
 [CallFlag] ASC,
 [MediaTypes] ASC,
 [User1ClientVerId] ASC,
 [User2ClientVerId] ASC,
 [SessionIdSeq] ASC,
 [SessionStartedById] ASC,
 [User1Id] ASC,
 [User2Id] ASC,
 [ReferredById] ASC
)
INCLUDE (  [TargetUserId],
 [ResponseTime],
 [ResponseCode],
 [SessionEndTime]) WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]
go

/*
USE [LcsCDR]
GO
DROP INDEX [IX_SessionDetails_ReplacesDialogIdTime_SessionIdTime] ON [dbo].[SessionDetails]
GO
*/

CREATE NONCLUSTERED INDEX [IX_SessionDetails_ReplacesDialogIdTime_SessionIdTime] ON [dbo].[SessionDetails]
(
 [ReplacesDialogIdTime] ASC,
 [SessionIdTime] ASC,
 [ReplacesDialogIdSeq] ASC,
 [CallFlag] ASC,
 [MediaTypes] ASC,
 [User1ClientVerId] ASC,
 [User2ClientVerId] ASC,
 [SessionIdSeq] ASC,
 [SessionStartedById] ASC,
 [User1Id] ASC,
 [User2Id] ASC,
 [CorrelationId] ASC,
 [ReferredById] ASC
)
INCLUDE (  [TargetUserId],
 [ResponseTime],
 [ResponseCode],
 [SessionEndTime]) WITH (SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]
go