tag:blogger.com,1999:blog-8576967095849015622024-02-08T18:49:11.616+01:00dhjensenA blog about various IT technology topics. Mostly about the daily hassle of being a day to day IT System administratordhjensenhttp://www.blogger.com/profile/05470370340403482241noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-857696709584901562.post-88646337043538912552015-08-13T09:16:00.000+02:002015-08-13T09:16:09.483+02:00Orphaned vmdk search return exception on large DatastoresOne 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.<br />
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<br />
Examples:<br />
<br />
<ul>
<li><a href="https://communities.vmware.com/message/1527123">https://communities.vmware.com/message/1527123</a></li>
<li><a href="http://virtuallyjason.blogspot.dk/2013/08/orphaned-vmdk-files.html">http://virtuallyjason.blogspot.dk/2013/08/orphaned-vmdk-files.html</a></li>
<li><a href="http://www.lucd.info/2011/04/25/orphaned-files-and-folders-spring-cleaning/">http://www.lucd.info/2011/04/25/orphaned-files-and-folders-spring-cleaning/</a></li>
</ul>
<br />
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)<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: 'Andale Mono', 'Lucida Console', Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code style="color: black; word-wrap: normal;">Exception calling "SearchDatastoreSubFolders" with "2" argument(s): "</code><code style="word-wrap: normal;"><span style="color: red;">An error o
ccurred while communicating with the remote host</span></code><code style="color: black; word-wrap: normal;">."
At xxxxx
+ $searchResult = $dsBrowser.SearchDatastoreSubFolders <<<< ($rootPath, $se
archSpec)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException".
</code></pre>
<br />
I noticed the exception message was about the remote host so I figured it must be vCenter / ESXi related.<br />
<br />
Based on above finding I found this <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017253" target="_blank">vmware KB article</a> 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:<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: 'Andale Mono', 'Lucida Console', Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;">$xxx.SearchDatastoreSubFolders($rootPath, $searchSpec)</pre>
<div>
<br /></div>
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<br />
<pre style="background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); font-family: 'Andale Mono', 'Lucida Console', Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;">chmod u+w /etc/vmware/vpxa/vpxa.cfg</pre>
<code><code><br /></code></code>
I hope this makes sense for everyone.<br />
Please comment if you have any questions or feedback.dhjensenhttp://www.blogger.com/profile/05470370340403482241noreply@blogger.com1tag:blogger.com,1999:blog-857696709584901562.post-19663549602727250712014-12-16T15:41:00.004+01:002014-12-16T15:48:20.031+01:00Lync Response Group Usage Report very slow or not completingIn Lync 2013 it's possibly to generate reports in SQL reporting services. This works fine for all except the "Response Group Usage Report".<br />
<br />
The problem is that the report never finish unless it's given a very short time window. I posted this in the Lync forum <a href="https://social.technet.microsoft.com/Forums/office/en-US/7e472c38-35ac-42cb-ad4a-a683eb0becac/response-group-usage-report-not-working?forum=lyncinterop" rel="nofollow" target="_blank">here</a> and a very kind person who been in contact with Microsoft support posted the SQL script below.<br />
<br />
The script creates two index that help speed up the stored procedure that fetch the data for the report.<br />
<br />
Someone asked if this can be made more visibly so I created this blog / post. Enjoy!!<br />
Please provide any feedback as this is my first blog / post about anything.<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code style="color: black; word-wrap: normal;">/*
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
</code>
</pre>
dhjensenhttp://www.blogger.com/profile/05470370340403482241noreply@blogger.com3