{"id":105,"date":"2021-09-09T21:35:07","date_gmt":"2021-09-09T21:35:07","guid":{"rendered":"https:\/\/monitoringstuff.com\/?p=105"},"modified":"2021-09-09T21:35:08","modified_gmt":"2021-09-09T21:35:08","slug":"scvmm-s2d-scom-or-how-to-traumatize-sql-server","status":"publish","type":"post","link":"https:\/\/monitoringstuff.com\/?p=105","title":{"rendered":"SCVMM + S2D + SCOM, or: how to traumatize SQL Server&#8230;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Sometimes, even proper change hygiene can&#8217;t prevent issues. If that surprises you, you haven&#8217;t been in IT long enough&#8230; and recently, we again saw proof of this. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We use Hyper-V as our virtualization platform, managed by SCVMM and monitored by SCOM, using the SCVMM Management Pack. So far, nothing really weird (although I know several VMWare fanatics who would disagree, but let&#8217;s skip that part&#8230;)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As part of the usual lifecycle management principles, the team responsible for the virtualization and storage decided to replace our classic storage environment by a more software-defined approach involving the new <a href=\"https:\/\/docs.microsoft.com\/en-us\/system-center\/vmm\/storage-spaces-overview?view=sc-vmm-2019\"><em>Storage Spaces Direct (S2D)<\/em> functionality<\/a> in Windows Server 2016. And that is managed through SCVMM.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, SCOM is not a very fast application &#8211; and in part, that&#8217;s because the SQL side of it is not the most efficient application out there. Basically,if we do <em>not<\/em> see a deadlock a few times a day, we&#8217;re worrying that something is wrong&#8230; and if the slowness gets worse, we usually look at the SQL side first. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And that is also what we did when we started getting complaints that SCOM wasn&#8217;t just slow, it was completely freezing. Checking the SQL side we saw plenty of indications of resource hogs. Now, I don&#8217;t pretend to be a SQL specialist&#8230; I just know some very good resources, like <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wait-statistics-or-please-tell-me-where-it-hurts\/\">Paul Randal&#8217;s fantastic blog on Wait Stats<\/a> and of course, the massive amount of information from <a href=\"http:\/\/www.brentozar.com\">Brent Ozar<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We also filed a support case with Microsoft, and after quite some &#8211; very well executed &#8211; investigations we concluded that both the resources and the configuration of the SCOM database servers should be OK for the workloads. I did get some good suggestions for fine-tuning, but we were sure there were no dramatic underlying issues with AlwaysOn, disk I\/O and the likes. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Looking at all the information I had gathered, I couldn&#8217;t stop thinking that it must be a previously undiscovered entity &#8211; and a big one. And by big, I mean that you&#8217;d have a diagram view with thousands of objects. At first, I thought it was our new VDI implementation &#8211; if you think of a cluster with several nodes and a few thousand VDI&#8217;s, that would classify as a big entity. Fortunately, there&#8217;s a good way to disable discovery of the resource groups &#8211; check out <a href=\"https:\/\/cloudadministrator.net\/2014\/12\/13\/disable-discovery-of-virtual-machine-resource-groups-in-cluster-mp\/\">this blog post<\/a>. We had that override in place for Server 2012R2, but not yet for Server 2016. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We applied the override, and thought we fixed the problem. But when we checked the next morning, we apparently hadn&#8217;t even come close &#8211; SCOM was still pretty much frozen. So our journey went on&#8230; Using sp_who2 I created a temp table, checking for the head blocker. I then set a SQL Profiler trace on that process, and there was a query that didn&#8217;t fire very often but when it did, it went to the absolute top in CPU usage. The query mentioned &#8220;DiscoverySourceID&#8221;, along with a GUID. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ever heard of &#8220;letting sleeping dogs lie&#8221;? Well, there&#8217;s a dog in the SCVMM Management Pack. It&#8217;s a discovery, called Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.Discovery.Discovery. (Yes, it actually has the word &#8220;Discovery&#8221; in it twice). And it&#8217;s not vicious, it&#8217;s downright rabid&#8230; think <a href=\"https:\/\/www.imdb.com\/title\/tt0085382\/\">Cujo<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The GUID that i found in the query, led me to the discovery, and the trace showed me the Management Server that the discovery was running on. It fires a Powershell script, that logs event 108. In the OperationsManager eventlog on the Management Server, I then found this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"235\" height=\"106\" src=\"https:\/\/monitoringstuff.com\/wp-content\/uploads\/2021\/08\/Event-108-screenshot.png\" alt=\"\" class=\"wp-image-111\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Whoa.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hang on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">20.000 objects? 24000 relationships?? How many group memberships would that involve? With the recursive memberships??? Like I said, think Cujo&#8230; this was a downright horror movie for SQL Server. When that much info is dumped into the OperationsManager database, SQL Server probably simply got traumatized.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Looking through the script, it apparently discovers <em>all<\/em> storage objects in VMM. And <em>all<\/em> of their relationships. For more info, check <a href=\"https:\/\/systemcenter.wiki\/?Get-ManagementPack=Microsoft.SystemCenter.VirtualMachineManager.Storage.2016.Discovery&amp;Version=10.0.6.0\">the systemcenter.wiki<\/a> page&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We disabled the discovery, and then ran Remove-SCOMDisabledClassInstance several times over the course of a few days. Pretty soon, SQL was getting happy again&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the Microsoft Support case, this was identified as a bug and registered as such. I hope to be able to update this post soon with a fix&#8230; <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep monitoring!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, even proper change hygiene can&#8217;t prevent issues. If that surprises you, you haven&#8217;t been in IT long enough&#8230; and recently, we again saw proof of this. We use Hyper-V as our virtualization platform, managed by SCVMM and monitored by SCOM, using the SCVMM Management Pack. So far, nothing really weird (although I know several &hellip; <a href=\"https:\/\/monitoringstuff.com\/?p=105\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SCVMM + S2D + SCOM, or: how to traumatize SQL Server&#8230;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[10,7,9,8],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-scom","tag-s2d","tag-scom","tag-scvmm","tag-sql"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=105"}],"version-history":[{"count":5,"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":122,"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions\/122"}],"wp:attachment":[{"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monitoringstuff.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}