tag:blogger.com,1999:blog-87875908537254892072024-02-07T20:21:41.218-05:00Don't Call Me ScottTech ramblings from a guy named Todd, too often called Scott.Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-8787590853725489207.post-7355451903857899012019-09-01T12:41:00.000-04:002019-09-01T12:41:19.775-04:00Send Active vSphere Alarms to Microsoft TeamsOne of the ways that we have been driving adoption of Microsoft Teams at work is by automatically pushing useful content into channels via its <a href="https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/connectors/connectors-using" target="_blank">webhook</a> support.<br />
<div>
<br /></div>
<div>
I've pushed alarms from our general monitoring system into Teams and it removes the limitation of short text messages while providing more details on an issue before resorting to using the corporate VPN. I simply arm myself with the Microsoft Teams app on my phone.</div>
<div>
<br /></div>
<div>
I thought about what else might benefit from the ability to see details while on the go and came up with active vSphere alarms. I wanted to be able to get details on active alarms, the time they started, their status (severity, if you ask me) and the objects and clusters involved.</div>
<div>
<br /></div>
<div>
I started playing around with PowerShell and soon had rudimentary alarm data going into a Microsoft Teams channel. But what if I am or can be connected to work? </div>
<div>
<br /></div>
<div>
I added a button to open the vSphere Client and then an alarm-specific button that opens the vSphere Client summary page for the object: </div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwIPZfhFaesmA0rfg_mwE_hvJ37lC9NCrHraAGXI0RhnYZ66cxkCYkOzhxJGes1EazvEW7LO93yjNd52jknNbR_W8nMMCTVQtJjfyFeaPUUrsfKnAStfvcCGoGyyCWZpVNyN1Kc4EJIQKr/s1600/vSphere+Teams+Alerts+Example.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1102" data-original-width="1600" height="275" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwIPZfhFaesmA0rfg_mwE_hvJ37lC9NCrHraAGXI0RhnYZ66cxkCYkOzhxJGes1EazvEW7LO93yjNd52jknNbR_W8nMMCTVQtJjfyFeaPUUrsfKnAStfvcCGoGyyCWZpVNyN1Kc4EJIQKr/s400/vSphere+Teams+Alerts+Example.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Example vSphere Alarms Alert</td></tr>
</tbody></table>
<div>
Setting it all up is pretty straightforward: create an incoming webhook connector in Microsoft Teams, save the URL, and schedule the PowerShell to run at a frequency of your choosing.</div>
<div>
<br /></div>
<h4>
Adding a Webhook</h4>
<div>
Open Microsoft Teams, choose or create a new Team, choose or create a new channel within that Team, and then select the three dots to the right of the channel name to create a connector. The screenshots below will help lead you along, but it's pretty simple. Be sure to save the link that is generated for your connector. You can always go back and manage the configured connectors on your channel if you need to get the URL again.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi88GYIHR016GETKZdmD_M0NzHMHaVYOd7AjaC9wUcBwHhqeo9p1CxNwAhP0jMRz3spn9McjminxY2csJpvqyD5ciQrrXkAFZ1o6ZN4qMI_yqRloIivu1QZTZpaItx5bmiHpsWT-SLHQKUG/s1600/Teams+Connector+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="614" data-original-width="420" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi88GYIHR016GETKZdmD_M0NzHMHaVYOd7AjaC9wUcBwHhqeo9p1CxNwAhP0jMRz3spn9McjminxY2csJpvqyD5ciQrrXkAFZ1o6ZN4qMI_yqRloIivu1QZTZpaItx5bmiHpsWT-SLHQKUG/s200/Teams+Connector+1.png" width="136" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgmwuwPW7VOKueyD6gLFaflOr2TGhf9OCF4gAQ563c-wuWT0BLzZOAG4QodbbC2KoaenSEHrWhoifGym2K4jtyBzzdnxy4G8X4b_YrYlBhEXHzVEnRvl6-l2omWhiOdYc6JjPD2yjonznQ/s1600/Teams+Connector+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="563" data-original-width="1592" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgmwuwPW7VOKueyD6gLFaflOr2TGhf9OCF4gAQ563c-wuWT0BLzZOAG4QodbbC2KoaenSEHrWhoifGym2K4jtyBzzdnxy4G8X4b_YrYlBhEXHzVEnRvl6-l2omWhiOdYc6JjPD2yjonznQ/s320/Teams+Connector+2.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_TvkK7_uzL3Md0_UOAT7tfG3NpRMjoq4AdtskpJjmNjuRCt6mbLFIMsNVKEbb0ocbUgZzOW5xEcOBzrHLd7tVu9xt93xCwgZD4OEIsO0-bunefSyvuiSldk4yqvtOUNQMmVUKjhErJaVE/s1600/Teams+Connector+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="787" data-original-width="1569" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_TvkK7_uzL3Md0_UOAT7tfG3NpRMjoq4AdtskpJjmNjuRCt6mbLFIMsNVKEbb0ocbUgZzOW5xEcOBzrHLd7tVu9xt93xCwgZD4OEIsO0-bunefSyvuiSldk4yqvtOUNQMmVUKjhErJaVE/s320/Teams+Connector+3.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMHssMDUYkjmMBg7FmcG2mtoLf1UX-66EBzfxZsQt_kyVdzVGwY5yafKttMy2902Up6PAZhnJ9sPX57iCNzfLd4v2pAABSBM3wHYtkhR9n_RgxFnB8tw26WTiSaoeygPnK2QR16JsoOuun/s1600/Teams+Connector+4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="417" data-original-width="1431" height="93" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMHssMDUYkjmMBg7FmcG2mtoLf1UX-66EBzfxZsQt_kyVdzVGwY5yafKttMy2902Up6PAZhnJ9sPX57iCNzfLd4v2pAABSBM3wHYtkhR9n_RgxFnB8tw26WTiSaoeygPnK2QR16JsoOuun/s320/Teams+Connector+4.png" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<h4>
Scheduling</h4>
<div>
Save the PowerShell at the bottom of this article and save it on a server somewhere so that you can set it up as a Scheduled Task. Invocation is easy, and you will need to provide your vCenter FQDN and Microsoft Teams webhook URL as part of the program/scripts arguments:</div>
<div>
<br /></div>
<div style="text-align: center;">
-ExecutionPolicy Bypass -file Send-vSphereAlarms.ps1 -vcenter <i>vcenter-fqdn</i> -TeamsUri <i>uri</i></div>
<div style="text-align: center;">
<br /></div>
<div>
I like to configure the task to run every 10 minutes, but pick what works best for you and your environment. </div>
<div>
<br /></div>
<div>
I'm certain that a lot can be changed in the script. Play around and enjoy!</div>
<div>
<br /></div>
<div>
<h4>
Send-vSphereAlarms.ps1</h4>
</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/TScalzott/30f422e010a974d86397e695223edc28.js"></script>
</div>
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-88153770557499850472019-01-30T20:34:00.001-05:002019-01-31T06:12:54.476-05:00vSphere Syslog SlamMaybe you are like me and you have a new syslog destination (SIEM is grand). Maybe you want to ensure that all of your vSphere hosts are configured the same.<br />
<br />
Automation being king, this will do it. The general process for each host:<br />
<ol>
<li>Set the syslog destination </li>
<li>Insure a firewall exception </li>
<li>Restart the syslog service.</li>
</ol>
<div>
In vSphere 5.1 the Set-VMHostSysLogServer cmdlet was added to PowerCLI. While there are other ways to accomplish the same task, I tend to prefer using any method that is more obvious when coding. Set-VMHostSysLogServer it is.</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/TScalzott/256f48e218a6a3b1c07e097bdbd3a503.js"></script>
</div>
Cheers!<br />
<br />Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-88852219208349387392018-12-26T14:52:00.003-05:002018-12-26T14:52:59.462-05:00VMware Authorization Service High CPU UsageWhen running VMware Workstation on Microsoft Windows, the VMware Authorization Service (vmware-authd.exe) may place a high CPU load on the system. Upgrading from Workstation 14 to the latest Workstation 15 had no impact, so it's not something that VMware recently fixed. I remember the issue from many years ago, but not how to resolve the situation.<br />
<br />
<i>I'm documenting here so that I don't forget the solution. It's my remind-future-self post.</i><br />
<br />
While I found plenty of Google hits with a similar complaint, I hadn't found any solutions that worked for me.<br />
<br />
The vCommunity is great, so a quick tweet was met with a quick reply from buddy <a href="https://twitter.com/plankers" target="_blank">Bob Plankers</a>:<br />
<blockquote class="twitter-tweet tw-align-center" data-partner="tweetdeck">
<div dir="ltr" lang="und">
<a href="https://t.co/q62OpGpke1">https://t.co/q62OpGpke1</a></div>
— Bob Plankers (@plankers) <a href="https://twitter.com/plankers/status/1068518720488652802?ref_src=twsrc%5Etfw">November 30, 2018</a></blockquote>
<script async="" charset="utf-8" src="https://platform.twitter.com/widgets.js"></script>
<br />
<div>
Bob's reply sent me to an <a href="https://michlg.wordpress.com/2009/12/30/vmware-authd-exe-has-a-high-cpu-load-how-to-fix-it/" target="_blank">article</a> on michlG's blog. The proposed solution did not fit my particular circumstances, but it got me on the right track: looking at Windows performance counters. </div>
<br />
When running PerfMon (I suppose that I should do so more often) I received an error:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyUROvKgP9Dulv2MrfcD6tEHvHYAEmU3D92WphwDmKCuUo1WNBd0rT0DyDNk4x5iRj3Oi-A6Vf2h3wsOdU_B32Bcb0rclp3Fz4vaDkI2I1GC2NJrMNPyNdZCIH_UJpV2e3X27pOsDNwTPw/s1600/vmware-authd-perfmon-error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="474" data-original-width="596" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyUROvKgP9Dulv2MrfcD6tEHvHYAEmU3D92WphwDmKCuUo1WNBd0rT0DyDNk4x5iRj3Oi-A6Vf2h3wsOdU_B32Bcb0rclp3Fz4vaDkI2I1GC2NJrMNPyNdZCIH_UJpV2e3X27pOsDNwTPw/s320/vmware-authd-perfmon-error.png" width="320" /></a></div>
<br />
<br />
My next stop was a Technet <a href="https://social.technet.microsoft.com/wiki/contents/articles/19374.windows-performance-monitor-unable-to-add-these-counters.aspx" target="_blank">article</a> which did the trick:<br />
<br />
<ol>
<li><span style="color: blue;"><b>lodctr /r</b></span></li>
<li><span style="color: blue;"><b>lodctr /q</b></span> to find anything disabled.</li>
<li><span style="color: blue;"><b>lodctr /e:"performance counter"</b></span> to enable</li>
</ol>
<div>
<br /></div>
<br />
<br />
<br />
<br />
<br />Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-17237659511221445772018-12-18T18:05:00.000-05:002018-12-18T19:26:32.818-05:00Windows Registry: Loading and Unloading All User Hives Today my team was discussing the need to search all user registry hives when scanning for malware.<br />
<div>
<br /></div>
<div>
It's not too bad to do this manually if there are a two user profiles on a system, but it gets considerably more tedious on common-use PCs with more user profiles. And I'm lazy.</div>
<div>
<br /></div>
<div>
The process might also prove handy for other registry-related tasks, where perhaps can't use Group Policy to be lazy.</div>
<div>
<br /></div>
<div>
Queue Load-UserHives.ps1. This quick-and-dirty PowerShell will search the system for available user profiles and load each key. Later, you can reverse this with the -Unload switch. Rather than externally tracking what was loaded prior, a simple naming prefix is used for the unload process.</div>
<div>
<br /></div>
<div>
<script src="https://gist.github.com/TScalzott/0e6258d283a7b74852e347272b00754b.js"></script>
<br /></div>
<div>
<br /></div>
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-13735534652106642422017-01-19T15:10:00.000-05:002017-01-19T15:10:12.081-05:00LUNs with Multiple ExportsWe have a vSphere 5.5 environment with your standard multiple paths to shared storage. In our case, 2 paths to each of 2 nodes in a 7000-series HPE 3PAR array.<br />
<br />
While investigating some stability issues we noticed something interesting:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEUGArX0PrnFo7TVP1K_4dpCZNzyOTeGCM2_e4270B5cIVdyasyXm90au-Vhc_-TItnQoGUaaBgNNNXtcAMT1Xm0y4YsPReNpJOe7LAB7VDo5dxLQ_rwrF7HU5XLMTrVDrIhaFuTjrKVAt/s1600/MultLUNnumbers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="257" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEUGArX0PrnFo7TVP1K_4dpCZNzyOTeGCM2_e4270B5cIVdyasyXm90au-Vhc_-TItnQoGUaaBgNNNXtcAMT1Xm0y4YsPReNpJOe7LAB7VDo5dxLQ_rwrF7HU5XLMTrVDrIhaFuTjrKVAt/s640/MultLUNnumbers.png" title="Multiple LUN Numbers" width="640" /></a></div>
<br />
That's one device and the LUN IDs should be the same. In this configuration, vSphere sees the same device multiple times.<br />
<br />
What's more, the vSphere GUI is doing us a "favor" and condensing the output. Using esxcli we can confirm that there are, in fact, more than 4 paths:<br />
<br />
<script src="https://gist.github.com/TScalzott/e3cd1c458d91267342e6a9332f888394.js"></script>
Whoa Nelly! I've condensed the output some, but that's 12 paths instead of 4. Each LUN ID represents one set of paths. <br />
<br />
The 3PAR GUI confirms:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OWURUXL6VyQ1hOS2xY4a6FcAMVbbijhkZcK1srljXD8XgSdGqGUqq6Mho0_0vjOcu_cDv4j5XqtXiiqbsvy_vF62Zr-UGcJYwSVkbys9qbFi4cpU3kviWJ1RN60UTA5mirrcEA2l9Uj8/s1600/3PAR-GUI-Exports.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OWURUXL6VyQ1hOS2xY4a6FcAMVbbijhkZcK1srljXD8XgSdGqGUqq6Mho0_0vjOcu_cDv4j5XqtXiiqbsvy_vF62Zr-UGcJYwSVkbys9qbFi4cpU3kviWJ1RN60UTA5mirrcEA2l9Uj8/s640/3PAR-GUI-Exports.png" width="640" /></a></div>
<br />
This particular virtual volume was exported directly to the host twice and once indirectly via a Host Set. <i>Yeah, don't do that!</i><br />
<br />
<h3>
Determining the Scope of the Issue</h3>
I found a <a href="https://communities.vmware.com/message/2601943#2601943" target="_blank">thread</a> on VMware Communities from <a href="https://twitter.com/vMarkus_K" target="_blank">Markus Kraus</a>, where he saw the same issue, although ultimately from a different cause. Markus has a <a href="http://mycloudrevolution.com/2016/06/15/doppele-3par-lun-exporte-erkennen/" target="_blank">blog post</a> too, with a great script and vCheck plugin!<br />
<br />
Using Markus' script, I was able to determine all devices with more than one LUN ID. Now we know how prevalent the issue is and which LUNs are involved on each particular vSphere host.<br />
<br />
<h3>
Unwinding</h3>
While we like 3PAR Host Sets, our implementation was incomplete. Moving toward completion has the potential of causing more problems because exports are also tied to the Host Sets. The biggest sin here was mixing the use of direct host exports and exports in Host Sets.<br />
<br />
With the right attack plan we can work on one vSphere host at a time without any outage:<br />
<br />
<ol>
<li>Place a host into Maintenance Mode.<br /> </li>
<li>Remove the host from any 3PAR Host Set.<br /> </li>
<li>Remove host-based duplicate virtual volume exports one at a time.<br /> </li>
<li>Rescan HBAs.<br /> </li>
<li>Exit Maintenance Mode.</li>
</ol>
<div>
We are not going to use the 3PAR GUI because it's not granular enough. <b> <i>Removing a host from a host set would also remove the exports and risk impact on other hosts.</i></b> ssh into the 3PAR to access their rather nice CLI.<br /> </div>
<b>Our Command Set<br /> </b><br />
<div>
List all Host Sets and their members:</div>
<blockquote class="tr_bq">
<span style="color: #990000;">showhostset</span></blockquote>
Show Virtual Volumes exported to a host:<br />
<blockquote class="tr_bq">
<span style="color: #990000;">showvlun -sortcol 1 -host <host> </span></blockquote>
<div>
Remove the host from the Host Set:</div>
<blockquote class="tr_bq">
<span style="color: #990000;">removehostset <setname> <host></span></blockquote>
<div>
Unexport from a host:</div>
<blockquote class="tr_bq">
<span style="color: #990000;">removevlun <vvname> <lunid> <host></span></blockquote>
What I found to work best is to first remove the host from any Host Set followed by a rescan of the vSphere host HBA. When that is completed, unexport any duplicate exports by removing the highest LUN ID(s). Then rescan HBAs again. <br />
<br />
Keep in mind that VVNames and Host Set Names are case sensitive.<br />
<h3>
<br />Example Time</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjshnG0EtaEvSEWafYHvqXYAKIeI-vnbTe3yeAjO3CBvjs0Rihry1bzOEL55gdSxUk8jJVyCOJL-Q91wGzlTA7yULS0vQBcXgfN_uCZGfFlg-XeGkkdzHpk2RLxCFQ_-4syImtUkCgJ7LYW/s1600/showvlun.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjshnG0EtaEvSEWafYHvqXYAKIeI-vnbTe3yeAjO3CBvjs0Rihry1bzOEL55gdSxUk8jJVyCOJL-Q91wGzlTA7yULS0vQBcXgfN_uCZGfFlg-XeGkkdzHpk2RLxCFQ_-4syImtUkCgJ7LYW/s640/showvlun.png" width="640" /></a></div>
<br />
<br />
<ol>
<li><span style="color: #990000;">removehostset My-Host-Set host-9</span><br /> </li>
<li>Rescan HBA<br /> </li>
<li><span style="color: #990000;">removevlun NL-THIN-3 34 host-9</span><br /> </li>
<li><span style="color: #990000;">removevlun NL-THIN-3 33 host-9</span><br /> </li>
<li>Rescan HBA<br /> </li>
<li><span style="color: #990000;">showvlun -sortcol 1 -host host-9</span><br /> </li>
<li>Verify with <span style="color: #990000;">esxcli storage core path list --device <device></span></li>
</ol>
<div>
<br /></div>
<br />
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-68303049441908095432016-03-14T21:23:00.001-04:002016-03-14T21:23:55.845-04:00Microsoft SQL Server on vSphere Best Practices GuideSome of us have been running Microsoft SQL Server on top of vSphere for years. Maybe it was only for your pre-VCSA vCenter or maybe you have dozens of instances--but that doesn't stop an official Best Practices Guide from being good reading.<br />
<br />
VMware has just updated, re-titled, and published "Architecting Microsoft SQL Server on VMware vSphere -- Best Practices Guide." <br />
<br />
There looks to be some pretty good information within, so get comfortable and grab the PDF <a href="https://www.vmware.com/files/pdf/solutions/SQL_Server_on_VMware-Best_Practices_Guide.pdf?src=vmw_so_vex_tscal_952" target="_blank">here</a>.<br />
<br />
<br />Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-10404748928284599862015-12-09T15:35:00.001-05:002015-12-09T15:36:59.078-05:00vSphere Host Logging Levels<p>If you are configuring vSphere hosts for syslog collection you may be overwhelmed by the amount of data thrown at your collector. By default hostd and vpxa are configured for a logging level of “verbose.”</p> <p>To view the configuration for all of your vSphere hosts, break out PowerCLI. I’m forever forgetting how to retrieve information from certain cmdlets and include the host name. Here it is for me to find again:</p><script src="https://gist.github.com/TScalzott/0043fcd3e2cc83d25f68.js"></script> <p> </p> <p>Setting hostd and vpxa logging levels on all hosts to “info” is pretty easy:</p><script src="https://gist.github.com/TScalzott/e784ac8d9a3d0f391cd9.js"></script> Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-13735932748873325012015-10-30T06:29:00.000-04:002015-10-30T06:29:58.414-04:00Note to Self: Learn Get-View<h2>
Queue Deflation</h2>
I’m rather red-faced right now. I chimed in with a reply in the VMTN <a href="https://communities.vmware.com/community/vmtn/automationtools/powercli?src=vmw_so_vex_tscal_952" target="_blank">VMware vSphere PowerCLI</a> forum and promptly got schooled.<br />
<br />
Which is great; these things should happen.<br />
<br />
<h2>
Where’s the Template?</h2>
In <a href="https://communities.vmware.com/thread/523351?src=vmw_so_vex_tscal_952" target="_blank">this</a> thread, VMTN Communities member denjoh44 asked how one would obtain a list of templates along with the name of the vSphere hosts on which they reside.<br />
<br />
I haven’t had the need to do this myself, but I wanted to give it a shot. I fired up PowerShell ISE and plugged away:<br />
<br />
<script src="https://gist.github.com/TScalzott/c420a5f85bedb6bc5f4e.js"></script>
And it works, which is nice.<br />
<br />
<h2>
I See Your 12 Lines and…</h2>
It wasn’t long after that I revisited the thread only to find a much more elegant solution posted by <a href="http://thecrazyconsultant.com/" target="_blank">Christophe Calvet</a>:<br />
<br />
<script src="https://gist.github.com/TScalzott/6bfbd7090b9af65d4569.js"></script>
My personality dictates that I should feel silly about my reply. Christophe nailed it with a one-liner. Instead, I’m going to focus on my inexperience with Get-View and do some reading. I'll endeavor to always keep calculated expressions in mind as well.<br />
<br />
<h2>
Time to Learn</h2>
<a href="https://twitter.com/vbriangraf" target="_blank">Brian Graf</a> has a 3-part blog series on Get-View which I’ve seen before and marked for reading in more detail “later.” If you are interested in learning more about Get-View, start here:<br />
<ul>
<li><a href="https://blogs.vmware.com/PowerCLI/2015/02/get-view-part-1-introduction.html?src=vmw_so_vex_tscal_952" target="_blank">Get-View Part 1: Introduction</a></li>
<li><a href="https://blogs.vmware.com/PowerCLI/2015/02/get-view-part-2-views-extension-data.html?src=vmw_so_vex_tscal_952" target="_blank">Get-View Part 2: Views and Extension Data</a></li>
<li><a href="https://blogs.vmware.com/PowerCLI/2015/06/get-view-part-3-peformance-really-much-different.html?src=vmw_so_vex_tscal_952" target="_blank">Get-View Part 3: Performance Impact</a></li>
</ul>
While you are at it, Christophe has a blog worth checking out at <a href="http://thecrazyconsultant.com/" target="_blank">TheCrazyConsultant.com</a>
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com1tag:blogger.com,1999:blog-8787590853725489207.post-72086098131623303792015-10-06T20:31:00.002-04:002015-10-06T20:31:14.397-04:00vSphere 5.5 Update 3 Patch Available<span style="font-family: Verdana; font-size: 14px;">
</span>
<h3>
<span style="font-family: Verdana; font-size: 14px;">
The Best Intentions</span></h3>
<span style="font-family: Verdana; font-size: 14px;">It was obvious and natural; the Right Thing to do. In preparation for a deployment across all vSphere hosts we took the step of insuring the latest updates. And since we are running vSphere 5.5, this meant Update 3.<br />
<br />
There was even some chest-thumping among our small team of generalists as they completed the task within short order. And why not?<br />
<br />
<h3>
That was Short-Lived</h3>
Within 2 weeks we were crestfallen. Update 3 introduced a service-impacting defect involving seldom-used (sic) snapshots. <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2133118&src=vmw_so_vex_tscal_952" target="_blank">KB 2133118</a> was released to announce "unexpected signal: 11." Consolidate or delete a snapshot and you may suffer a VM outage.<br />
<br />
To be honest, I find the KB lacking in details--there are no specifics to indicate contributing factors or degree of impact across customers.<br />
<br />
<h3>
<span style="color: red;">
A New Hope?</span></h3>
While we haven't been impacted (whew!), <span style="color: red;">I'm happy to see that today brings the release of patch <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2133825&src=vmw_so_vex_tscal_952" target="_blank">ESXi550-201510401-BG</a> to address this issue.</span><br />
<br />
Fire up Update Manager and start patching! Let us know how it goes, because I'm not sure that we wish to be first on this one.<br />
<br />
<br />
<span id="kbarticlename" style="border: 0px none; color: white; font-family: Verdana; font-size: 14px; font-stretch: inherit; font-weight: bold; margin: 0px; padding: 0px; vertical-align: baseline;">2</span><br />
</span>Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com1tag:blogger.com,1999:blog-8787590853725489207.post-81810778207672077162015-09-24T15:48:00.003-04:002015-09-24T16:43:20.930-04:00Snazzy-Up Your PowerShell with a GUI<span style="font-family: Verdana; font-size: 14px;"><img src="http://d2ws0xxnnorfdo.cloudfront.net/character/meme/12-year-old-redditor.jpg" height="176" width="240" /><br clear="all" /><span style="font-size: 14px;"><br /></span></span><br />
<span style="font-family: Verdana; font-size: 14px;"><span style="font-size: 14px;">I’d like to say that I work with virtualization every day, and in a way I do. Virtually every server in my employer’s environment is virtualized (see what I did there?). </span></span><br />
<span style="font-family: Verdana; font-size: 14px;"><span style="font-size: 14px;"><br /></span></span>
<span style="font-family: Verdana; font-size: 14px;">That we are a small team in an SME environment dictates that we are I.T. generalists. That’s not a curse—that’s variety and opportunity alleviating the mundane. It’s also an opportunity to automate the mundane. </span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">For the purposes of user provisioning I wanted to use PowerShell for identity management on a shoestring budget. As with many things, creating is harder than destroying; this provisioning needs a GUI. Pick an OU, pick a user/template, and copy with new details. While that’s how I got to the point of driving a GUI with PowerShell, it’s difficult to effectively convey a company-specific workflow. So I’ll demonstrate with something virtualization-focused.</span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">With a little bit of Googling I found an older option or two along with .NET-based Windows Presentation Foundation (WPF). .NET this plus .NET that sounded appealing with me, so I dug in further. </span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">There are solid posts to be found that give you all that you need. I’m working against some of my </span><a href="http://notscott.blogspot.com/2015/09/musings-of-infrequent-blogger_17.html" target="_blank"><span style="font-family: Verdana; font-size: 14px;">musings</span></a><span style="font-family: Verdana; font-size: 14px;">, so here I share my journey toward the same end result.</span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">At a higher level the process is relatively simple:</span><br />
<ul>
<li><span style="font-family: Verdana; font-size: 14px;">Generate a GUI form in </span><a href="https://en.wikipedia.org/wiki/Extensible_Application_Markup_Language" target="_blank"><span style="font-family: Verdana; font-size: 14px;">Extensible Application Markup Language</span></a><span style="font-family: Verdana; font-size: 14px;"> (XAML). </span> </li>
<li><span style="font-family: Verdana; font-size: 14px;">Load the XAML in PowerShell with some minor (automated) transformations. </span> </li>
<li><span style="font-family: Verdana; font-size: 14px;">Instantiate the WPF form. </span> </li>
<li><span style="font-family: Verdana; font-size: 14px;">Create variables for working with our GUI elements. </span> </li>
<li><span style="font-family: Verdana; font-size: 14px;">Define PowerShell event handlers for each GUI element, incorporating our workflow within.</span></li>
</ul>
<h2>
<span style="font-family: Verdana; font-size: 16px;">Generating Your GUI’s XAML</span></h2>
<span style="font-family: Verdana; font-size: 14px;">To generate the GUI we need something that will generate XAML that WPF can handle. Anything from Visual Studio 2010 on up will do here. I used </span><a href="https://www.visualstudio.com/products/free-developer-offers-vs.aspx" target="_blank"><span style="font-family: Verdana; font-size: 14px;">Visual Studio 2015 Community</span></a><span style="font-family: Verdana; font-size: 14px;"> since it is full featured with an investment of $0.</span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">Open Visual Studio and create a new project. Choose WPF Application under Visual C# Templates and give it a name. Any name will do—we only want the XAML which this project will generate.</span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<br />
<div style="text-align: center;">
<a href="http://lh3.googleusercontent.com/-dZ1gBElSHNQ/VgNNhp-Lf-I/AAAAAAAAahE/7I6VpV1G5Bc/s1600-h/2015-09-23%25252020_26_39-Start%252520Page%252520-%252520Microsoft%252520Visual%252520Studio%25255B4%25255D.png"><span style="font-family: Verdana; font-size: 14px;"></span></a><span style="font-family: Verdana; font-size: 14px;"><a href="http://lh3.googleusercontent.com/-tXGNnPMDYXw/VgRErEFAO_I/AAAAAAAAaiI/wxD2-9Pn1II/s1600-h/2015-09-23-20_26_39-Start-Page---Mic.png"><img alt="2015-09-23 20_26_39-Start Page - Microsoft Visual Studio" border="0" src="http://lh3.googleusercontent.com/-ALXnqeOGZi4/VgNNiWO1K8I/AAAAAAAAaiM/W8o1yRWaLsw/2015-09-23-20_26_39-Start-Page---Mic%25255B3%25255D.png?imgmax=800" height="362" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2015-09-23 20_26_39-Start Page - Microsoft Visual Studio" width="640" /></a></span></div>
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">What you will notice is a blank window in the main center pane, labeled MainWindow.xaml. The pane below contains the XAML in which we are interested. </span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<br />
<div style="text-align: center;">
<a href="http://lh3.googleusercontent.com/-dkplat6QoJk/VgNNiw8eGtI/AAAAAAAAahQ/cqPL0BE2fio/s1600-h/LetUsWPF%252520-%252520Main%252520Window%25255B4%25255D.png"><span style="font-family: Verdana; font-size: 14px;"></span></a><span style="font-family: Verdana; font-size: 14px;"><a href="http://lh3.googleusercontent.com/-dkplat6QoJk/VgNNiw8eGtI/AAAAAAAAaiY/6Gb06hEs_Xw/s1600-h/LetUsWPF---Main-Window8.png"><img alt="LetUsWPF - Main Window" border="0" src="http://lh3.googleusercontent.com/-bVs3jDbrO4c/VgNNjofZ_AI/AAAAAAAAaik/-WOWRJblKcI/LetUsWPF---Main-Window_thumb6.png?imgmax=800" height="480" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="LetUsWPF - Main Window" width="609" /></a></span></div>
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">I find it best to turn on the toolbox from the View menu and pin it to the side bar this yields an environment tailored for creating window forms.</span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">Let’s use the toolbox to drag and position a few controls:</span><br />
<ul>
<li><span style="font-family: Verdana; font-size: 14px;">A ComboBox selector for Cluster</span> </li>
<li><span style="font-family: Verdana; font-size: 14px;">A DataGrid to display VMs within a selected Cluster.</span> </li>
<li><span style="font-family: Verdana; font-size: 14px;">A Button for launching a selected VM’s console.</span> </li>
<li><span style="font-family: Verdana; font-size: 14px;">A Label or three for clarity.</span></li>
</ul>
<span style="font-family: Verdana; font-size: 14px;">While we can add these controls in any order, Visual Studio will set the form’s tab order based on the order of definition. That’s not a particularly big deal because of a neat Visual Studio feature: the GUI form is tied to the XAML and the XAML is tied to the GUI form. We can adjust the tab order by re-ordering the text inside the XAML pane copy and paste!</span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">With each control use the properties pane and give it a unique name, which we will use later to bind to PowerShell variables. I like to start all label control names with “label_” for easier exclusion from this binding process.</span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<br />
<div style="text-align: center;">
<a href="http://lh3.googleusercontent.com/-S1bHix7mR1E/VgREtJlwhcI/AAAAAAAAai0/PLj-hQ4STlk/s1600-h/LetUsWPF%252520-%252520Drawn%252520Form%25255B3%25255D.png"><img alt="LetUsWPF - Drawn Form" border="0" src="http://lh3.googleusercontent.com/-xAsYeTX9UIM/VgREtp0_pzI/AAAAAAAAai4/Yt2YohU9BBU/LetUsWPF%252520-%252520Drawn%252520Form_thumb%25255B1%25255D.png?imgmax=800" height="437" style="background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="LetUsWPF - Drawn Form" width="644" /></a></div>
<h2>
<span style="font-family: Verdana; font-size: 16px;"><br /></span></h2>
<h2>
<span style="font-family: Verdana; font-size: 16px;">Loading the XAML</span></h2>
<span style="font-family: Verdana; font-size: 14px;">All we need from Visual Studio is the XAML, which we will copy and paste into a PowerShell here-string. The string isn’t perfect for PowerShell processing yet, so we’ll also rework it to take care of these issues and cast as XML:</span>
<br />
<br />
<script src="https://gist.github.com/TScalzott/4c474c660c73b3712042.js"></script>
<br />
<h2>
<span style="font-family: Verdana; font-size: 16px;">Instantiating the GUI Form</span></h2>
<br />
<span style="font-family: Verdana; font-size: 14px;">Next we need to load the PresentationFramework assembly and process our form so that it can be presented:</span>
<br />
<br />
<script src="https://gist.github.com/TScalzott/b05c0143d898cdd6c588.js"></script>
<br />
<h2>
<span style="font-family: Verdana; font-size: 16px;">Creating GUI Variables</span></h2>
<br />
<span style="font-family: Verdana; font-size: 14px;">We need to be able to work with the controls on form that comprise our GUI, and that means variables that let us get/set values and work with other properties and methods afforded to us by WPF. </span><br />
<span style="font-family: Verdana; font-size: 14px;"><br /></span>
<span style="font-family: Verdana; font-size: 14px;">We can do this rather handily in PowerShell by invoking Set-Variable for nodes within the XML that comprises our form. The iteration of those nodes will return Label controls as well, which we’ll ignore based on giving them a prefix of “Label_”, which was mentioned earlier:</span>
<br />
<br />
<script src="https://gist.github.com/TScalzott/467deb1152ed37274dcf.js"></script>
<br />
<h2>
<span style="font-family: Verdana; font-size: 16px;">Defining Event Handlers</span></h2>
<br />
<span style="font-family: Verdana; font-size: 14px;">WPF will send asynchronous signals (events) to our script when the GUI is acted upon. Examples include when a selection is made, a button is clicked, and when the window is instantiated or destroyed. </span><br />
<br />
<span style="font-family: Verdana; font-size: 14px;">Defining event handler functions in our PowerShell lets us dictate our workflow:</span><br />
<ul>
<li><span style="font-family: Verdana; font-size: 14px;">When the window is created, connect to vCenter, get a list of clusters, and populate the cluster ComboBox.</span></li>
<li><span style="font-family: Verdana; font-size: 14px;">When a selection is made in the cluster ComboBox, get a list of cluster VMs and populate the details DataGrid.</span></li>
<li><span style="font-family: Verdana; font-size: 14px;">When a VM selection is made in the DataGrid, enable the console Button.</span></li>
<li><span style="font-family: Verdana; font-size: 14px;">When the console Button is clicked, launch a vSphere Remote Console window.</span></li>
<li><span style="font-family: Verdana; font-size: 14px;">When the window is closed, disconnect from vCenter</span></li>
</ul>
<span style="font-family: Verdana; font-size: 14px;">Anything is possible, of course. Here’s our event handlers:</span><br />
<br />
<br />
<script src="https://gist.github.com/TScalzott/8d32bbbf625910d24031.js"></script>
<br />
<h2>
<span style="font-family: Verdana; font-size: 16px;">Final Bits</span></h2>
<span style="font-family: Verdana; font-size: 14px;">There’s not much left! Define the vCenter server against which we will operate and display the form:</span><br />
<br />
<br />
<script src="https://gist.github.com/TScalzott/e18b0ce4a4ed30fd5a92.js"></script>
<br />
<h2>
<span style="font-family: Verdana; font-size: 16px;">Reveal</span></h2>
<span style="font-family: Verdana; font-size: 14px;">Run this little puppy and off we go. Pick a cluster from the drop-down to see a list of VMs and click the column headers to if you don’t like it ordered by VM name. Choose a VM and the console button becomes active so long as the VM state is “PoweredOn.”</span><br />
<br />
<div style="text-align: center;">
<span style="font-family: Verdana; font-size: 14px;"><a href="http://lh3.googleusercontent.com/-10xPTxO5g38/VgREuVhlG-I/AAAAAAAAajA/1AViu_0Br9Q/s1600-h/LetUsWPF%252520-%252520Pick%252520Cluster%25255B6%25255D.png"><img alt="LetUsWPF - Pick Cluster" border="0" src="http://lh3.googleusercontent.com/-qMhduYIMe5Y/VgREu4PD8-I/AAAAAAAAajI/zTAx40FxEdM/LetUsWPF%252520-%252520Pick%252520Cluster_thumb%25255B4%25255D.png?imgmax=800" height="271" style="background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="LetUsWPF - Pick Cluster" width="387" /></a></span></div>
<br />
<div style="text-align: center;">
<a href="http://lh3.googleusercontent.com/-Ftpsp9M2QQ4/VgREvZWp2vI/AAAAAAAAajQ/RlUgHN1GCFo/s1600-h/LetUsWPF%252520-%252520Pick%252520VM%25255B3%25255D.png"><img alt="LetUsWPF - Pick VM" border="0" src="http://lh3.googleusercontent.com/-rWuZWRhX-PM/VgREv4qDQPI/AAAAAAAAajY/Z6aAgN9qfiM/LetUsWPF%252520-%252520Pick%252520VM_thumb%25255B1%25255D.png?imgmax=800" height="274" style="background-image: none; border: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="LetUsWPF - Pick VM" width="389" /></a></div>
<br />
<h2>
<span style="font-family: Verdana; font-size: 16px;">What else?</span></h2>
<ul>
<li><span style="font-family: Verdana; font-size: 14px;">My error checking and validations are non-existent--Add some.</span></li>
<li><span style="font-family: Verdana; font-size: 14px;">Add another button to perform another task.</span></li>
<li><span style="font-family: Verdana; font-size: 14px;">Change what VM properties appear in the DataGrid.</span></li>
<li><span style="color: #c0504d; font-family: Verdana; font-size: 14px;"><em>Do something else and have fun with it!</em></span></li>
</ul>
<h2>
<span style="font-family: Verdana; font-size: 16px;"><br /></span></h2>
<h2>
<span style="font-family: Verdana; font-size: 16px;">Full Code</span></h2>
<span style="font-family: Verdana; font-size: 14px;">You can grab the full code from <a href="https://gist.github.com/TScalzott/eb36478cf63fd63d0e73" target="_blank">here</a>.</span><br />
<br />
<br />
<h2>
<span style="font-family: Verdana; font-size: 16px;">Proper Attribution is Proper</span></h2>
<ul>
<li><span style="font-family: Verdana; font-size: 14px;">Stephen Owen’s </span><a href="http://foxdeploy.com/resources/ise-snippets/xaml-to-gui/" target="_blank"><span style="font-family: Verdana; font-size: 14px;">XAML to GUI</span></a><span style="font-family: Verdana; font-size: 14px;"> </span></li>
<li><span style="font-family: Verdana; font-size: 14px;">The Scripting Guys’ </span><span style="font-family: Verdana; font-size: 14px;"><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2014/08/01/i-39-ve-got-a-powershell-secret-adding-a-gui-to-scripts.aspx" target="_blank">I've Got a PowerShell Secret: Adding a GUI to Scripts</a></span></li>
</ul>
<div>
<br /></div>
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-26378224318028772082015-09-17T22:59:00.001-04:002015-09-26T16:09:40.611-04:00Musings of an Infrequent Blogger<strong><span style="font-family: Verdana, sans-serif;">Writing is hard.</span></strong><br />
<span style="font-family: Verdana, sans-serif;">That's not the case for everyone, of course, but it holds true for me. If you know me on a personal or professional level you've heard me say this before. The odd thing is, I enjoy writing. And because of that I tend to focus on this topic.<br /><br />I have reasons not to write.</span>
<br /><br />
<h3>
<span style="font-family: Verdana, sans-serif; font-size: large;">It's a silly idea/topic/thought</span></h3>
<span style="font-family: Verdana, sans-serif;">This is a powerful one for me and stops me the most often. It's also the quickest way out. I question myself by nature, so there's no surprise here. I'm still not certain that I'll hit publish on this post!<br /><br />Suck it up and write anyway.</span>
<br /><br />
<h3>
<span style="font-family: Verdana, sans-serif; font-size: large;">It's never quite right</span></h3>
<span style="font-family: Verdana, sans-serif;">One of the things that I enjoy most in the writings of others is the multitude of ways to say the same thing. The simplicity of some, the eloquence of others. Let's not even talk about grammar, misspellings, etc. Whether I'm writing here or within the corporate walls, I can tell you that I've reworked virtually every paragraph multiple times.<br /><br />Practice makes perfect? No, but it certainly improves.</span>
<br /><br />
<h3>
<span style="font-family: Verdana, sans-serif; font-size: large;">Others have already written about this</span></h3>
<span style="font-family: Verdana, sans-serif;">Why bother covering a topic that so many others already have? Fear of getting lost among similar technical articles and not managing to stand out.<br /><br />Not to be glib, but meh--one more can't hurt.</span>
<br /><br />
<h3>
<span style="font-family: Verdana, sans-serif; font-size: large;">Time</span></h3>
<span style="font-family: Verdana, sans-serif;">How do others find the time? I'm up early and put in long days. There is often weekend work. Around it all I must find time for family. There needs to be wind-down time and sleep in there somewhere.<br /><br />Others do it. There are ways. Give up a little time that's normally spent by myself anyway.</span><br /><br />
<hr /><br />
<span style="font-family: Verdana, sans-serif;">Why have I shared this? Certainly it is therapeutic to a degree and I can refer to it in the future to push me forward. </span><br />
<span style="font-family: Verdana, sans-serif;">But that's not my hope.</span><br /><br />
<span style="font-family: Verdana, sans-serif;">I want to reach someone else and push them forward. I'm an avid reader of blogs, sometimes churning through dozens a day. I make it part of my daily routine. I thoroughly enjoy reading what others have to say.<br /><br />If you are like me, I'd like you to write--or write more. </span><br /><br />
<strong><em><span style="font-family: Verdana, sans-serif;">Because I'd like to read what you have to say.</span></em></strong>Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com3tag:blogger.com,1999:blog-8787590853725489207.post-50952529228366181682015-02-14T15:19:00.000-05:002015-02-14T15:19:21.006-05:00HonoredThis year, after years of deliberation and encouragement from friends, I finally submitted a vExpert application.<div>
<br /></div>
<div>
I am honored and humbled to have been awarded vExpert for 2015 by VMware. To be fair, I'm also rather ecstatic!</div>
<div>
<br /></div>
<div>
See the full list of stellar individuals at the official <a href="http://blogs.vmware.com/vmtn/2015/02/vexpert-2014-announcement-2.html">vExpert 2015 Announcement</a>.</div>
<div>
<div>
<br /></div>
</div>
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-89213961941068092472014-11-09T18:21:00.000-05:002015-01-02T14:27:40.043-05:00vSphere Claim Rules with PowerCLIWe’ve been implementing HP 3PAR 7000 series into our environment. During this task we’ve tryied to be good admins by following the <a href="http://www8.hp.com/h20195/v2/GetDocument.aspx?docname=4AA4-3286ENW">HP 3PAR StoreServ Storage and VMware vSphere 5 best practices</a>.<br />
<br />
Within this excellent resource there is a section for automating round robin policy for all 3PAR LUNs with a custom SATP rule. That’s great, but it involves an esxcli command that must be run on each host:<br />
<br />
<script src="https://gist.github.com/TScalzott/180d4341099f85045af9.js"></script>
<br />
For a small number of hosts that’s not too terrible--until you realize that you must either reboot each host or modify the policy for each LUN currently presented. That’s not something that I’m likely to do. <br />
<br />
With my aid of my technology buddy Google, I discovered several tidbits online:<br />
<br />
<ul>
<li><a href="https://twitter.com/pbsellers">Philip Sellers</a> has a <a href="http://www.techazine.com/2013/04/22/3par-storserv-7000-series-best-practices-for-vsphere-5-1/">blog</a> that works through much of this in PowerCLI.</li>
<li><a href="https://twitter.com/CormacJHogan">Cormac Hogan</a> has a <a href="http://cormachogan.com/2013/07/08/automating-the-iops-setting-in-the-round-robin-psp/">blog</a> that re-iterates the above, along with the commands required to unload each already claimed device (LUN), reload the claim rules, and rescan the HBAs.</li>
</ul>
Most of what I needed was out there already, of course. But I wanted to reload the claim rules in order to test the custom rule and without setting the policy individually on each LUN. I also didn’t want to impact every iSCSI LUN—just 3PAR—and there’s no need to reclaim a LUN that is already configured for round robin. <br />
<br />
Here’s how I did it for each host:<br />
<br />
<script src="https://gist.github.com/TScalzott/34da32b0f06bffc8109a.js"></script>
<br />
Of course, I wrapped all of this around more PowerCLI that obtained a list of hosts in each cluster and managed the connections for esxcli. <br />
<br />
If you receive any errors during the unclaim, make sure that your HA configuration is not using those LUNs as heartbeat datastores. I experienced that problem which was easy to remedy in our environment. <br />
<br />
<br />Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-75089441904305918532014-06-30T14:43:00.000-04:002015-01-05T14:51:30.045-05:00Office 365 Staged Migrations with PowerShellI have a love-hate relationship with PowerShell. I want to love it and often do--except when my knowledge is lacking or it acts mysteriously (to me).
<br />
To aid my memory and perhaps help others, I've decided to post snippets as I continue my journey toward improving my PowerShell skills (I hear that shaking <a href="http://twitter.com/LucD22">Luc Dekens</a>' and <a href="http://twitter.com/alanrenouf">Alan Renouf</a>'s hand at the same time increases one's PS Mojo).
<br />
With that out of the way, onward and upward.<br />
<hr />
We are in the midst of migrating from Exchange Server 2003 to Office 365 as a Staged Migration. While not a particularly arduous task, it does involve pulling mailbox statistics and email addresses and using that information for the planning and creation of migration batches. It's tedious and error-prone.
<br />
Given a set of Exchange Servers, Domain Controllers, and a Universal Security Group, Get-MailboxSizes.ps1 generates a CSV containing mailbox names, server, size, number of items, office location, department, active mailbox flag, and string suitable for directly pasting into a Staged Migration CSV file.
<br />
<a href="http://lh4.ggpht.com/-TC08OEIz-rY/U5oRxDrp-sI/AAAAAAAARHo/G-lCbMyZU3E/s1600-h/2014-06-12%25252016_09_48-MailboxSizes%25255B3%25255D.png"><img alt="2014-06-12 16_09_48-MailboxSizes" border="0" src="http://lh6.ggpht.com/-64vWyqc2yu0/U5oRzXdKHvI/AAAAAAAARHs/JFzdaiy7mq4/2014-06-12%25252016_09_48-MailboxSizes_thumb%25255B1%25255D.png?imgmax=800" height="78" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="2014-06-12 16_09_48-MailboxSizes" width="529" /></a><br />
<br />
The ActiveMbx column is TRUE if the user is not enabled or a member of a Universal Security Group used for tracking progress and automating other things.<br />
<br />
The odd column header at the last column should be directly pasted into your Staged Migration CSV file as row 1. For successive entries, copy that column value in filtered rows as you plan the migration. Please note that this column assumes Active Directory Synchronization with Office 365.<br />
<br />
We've been known to paste entries from the last column into Notepad for a quick Search-Replace of ",,FALSE" with ";". That yields a list that you can paste into the To field of a notification email or add members box of the Universal Security Group. <br />
<br />
I’d like to thank <a href="https://twitter.com/iainbrighton">Iain Brighton</a> who lent a hand when I was stuck with Custom Objects. Yea Twitter!<br />
<br />
<script src="https://gist.github.com/TScalzott/4964af719da46f75cc0e.js"></script>
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-38371849302943150732012-09-04T06:20:00.001-04:002012-09-04T06:20:30.361-04:00Traditional DR…and its Imminent Demise?<p><font size="3"></font> </p> <p><img style="display: inline; float: right" alt="Backhoe Damaging Underground Lines" align="right" src="http://undergrounddetection.com/underground/wp-content/uploads/2010/05/backhoe-cartoon.gif" width="376" height="300"></p> <p><font size="3">My primary focus at VMworld 2012 was Disaster Recovery, which caused me to think a fair amount about the future of DR in general—it’s necessity, utility, and longevity. Have we really escaped “traditional” DR? Will the methods employed today exist as we know them in 10 years, or just be another integral part of the infrastructure?</font></p> <p><font size="3">Each session invariably started off comparing the “traditional” disaster recovery of yesterday against the virtualization-enabled DR of today, where the old machinations are replaced with flipping a software switch.</font></p> <p><font size="3">With the exception of American National Bank’s and Varrow’s Active/Active datacenter (INF-BCO1883), I can’t help but see this as still being traditional DR—only with today’s tools.</font></p> <p><font size="3">Let’s take a look at some of the main points in “traditional” DR versus today’s: </font></p> <ul> <li><font size="3">Before virtualization, restoring to the same hardware used in production was a challenge. If it could not be met, time was wasted. Virtualization gives us a common hardware set, eliminating those hardware compatibility woes. <br><br><em>While a valid point, what if you could always purchase bland hardware, generic x86 servers at Wal-Mart as a commodity, like that which virtualization presents to the OS?</em></font> <li><font size="3">Tapes could not always be restored and took too much time. Virtualization gets us to replication technologies that avoid tape.<br><br><em>Excluding array-based replication, disk-to-disk-to-tape solutions with replication were pitched as disaster recovery aids 10 years ago, specifically to get around the problems of tape.</em></font> <li><font size="3">New systems/applications required new servers.<br><br><em>You got me there. Virtualization wins, and I’m happy with that.</em></font></li></ul> <p><font size="3">Same process, new tools—albeit faster, better, stronger tools. It’s still traditional DR to me.</font></p> <p><font size="3">Now enter Cloud-based DR. With DR in the cloud, there is no need to lease or require that which remains idle. In essence, keep an off-site copy of your data—a Good Thing anyway—and pay for what you need when you need. Disaster Recovery has now moved fully from capex to opex. It’s cloud being used for what cloud is intended. </font></p> <p><font size="3">But not at the application level.</font></p> <p><font size="3">In an application-centric world, everything behaves like the modern applications to which we’ve become accustomed. We are blissfully unaware, yet fully appreciative of Facebook, Google, Twitter, and the like spanning multiple datacenters. We aren’t exposed to datacenter failures that they may encounter and we shouldn’t be. Nor should your customers. </font></p> <p><font size="3">Your line-of-business systems need to be heading this way, today, for it is the key to availability across datacenters and devices (EUC was a big push at VMworld this year). They shouldn’t care any more about what datacenter they occupy than how many instances are deployed.</font></p> <p><font size="3">The pieces are there. We’re seeing the increased popularity of orchestration with the likes of Chef and Puppet (in no particular order). Infrastructure manipulation via APIs such as Amazon provides into their Elastic Load Balancer. Data—big or otherwise—replication, and sharding is becoming commonplace. </font></p> <p><font size="3">The hold-outs are back office systems that won’t get where we need them to be soon enough, yet demonstrate significant movement in this direction when you consider Office 365 and the like. </font></p> <p><font size="3">Once achieved, is expanding from private to public cloud based on increased load any different than contracting from one to the other based on availability?</font></p> <p><font size="3">Private, public, or hybrid the cloud is an extension of your datacenter. It’s the elasticity of your workloads at web-scale, that need not be within one datacenter. If well orchestrated, you have “simple” contractions of your cloud based on not only load, but availability.</font></p> <p><font size="3">I see the agile system encompassing multiple datacenters at any point in time, expanding and contracting as load and availability changes. This, will be the new DR—no DR. Just a well-designed modern system.</font></p> <p><font size="3">What are your thoughts?</font></p> <p><font size="3">Takeaway: Developers need to be aware of infrastructure; this could be interesting.</font></p> <p><font size="3"></font></p> Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com1tag:blogger.com,1999:blog-8787590853725489207.post-66548831891506234582012-02-26T20:27:00.001-05:002012-02-26T20:44:44.543-05:00Tech Field Day Recap – Virtualization Field Day 2<p><font size="3">I’ll have more on an individual session or two in the coming days, but I wanted to take the time to provide a brief recap of Virtualization Field Day 2.</font></p> <p><font size="3">It was great to see the familiar faces of <a href="http://twitter.com/Texiwill" target="_blank">Edward Haletky</a>, <a href="http://twitter.com/Mike_Laverick" target="_blank">Mike Laverick</a>, <a href="http://twitter.com/RogerLund" target="_blank">Roger Lund</a>, <a href="http://twitter.com/VMackem" target="_blank">David Owen</a>, and <a href="http://twitter.com/VMRick" target="_blank">Rick Schlander</a> while meeting <a href="http://twitter.com/Rodos" target="_blank">Rodney Haywood</a>, <a href="http://twitter.com/Virtual_Bill" target="_blank">Bill Hill</a>, <a href="http://twitter.com/Dlink7" target="_blank">Dwayne Lessner</a>, <a href="http://twitter.com/OtherScottLowe" target="_blank">Scott Lowe</a>, <a href="http://twitter.com/Gallifreyan" target="_blank">Robert Novak</a>, <a href="http://twitter.com/BrandonJRiley" target="_blank">Brandon Riley</a>, and <a href="http://twitter.com/ChrisWahl" target="_blank">Chris Wahl</a> for the first time. It’s solid group of people on both personal and professional levels.</font></p> <p><font size="3">Day zero allowed time for all of the delegates to arrive and closed with a welcome dinner at <a href="http://www.zeytoun.com/" target="_blank">Zeytoun</a>. We had great food; our hometown gift exchange; a shrine and webcam chat with Stephen who was not able to make it to TFD for the first time, but for the right reason.</font></p> <p><font size="3">For sponsors on day one we had <a href="http://www.symantec.com/veritas" target="_blank">Symantec</a>, who's competing strategy appeared to PowerPoint overload, <a href="http://www.zerto.com/" target="_blank">Zerto</a> with their solid continuous data protection DNA, and <a href="http://www.xangati.com/" target="_blank">Xangati</a> with their monitoring solutions and perfect bacon execution.</font></p> <p><font size="3">Day one ended with a private tour and mystery theatre at <a href="http://www.winchestermysteryhouse.com/" target="_blank">Winchester Mystery House</a>.</font></p> <p><font size="3">On tap for day two was flashy <a href="http://www.purestorage.com/" target="_blank">Pure Storage</a>, <a href="http://www.pivot3.com/" target="_blank">Pivot3</a> with their integrated storage and compute solution and <a href="http://twitter.com/wcpreston" target="_blank">W. Curtis Preston</a> with <a href="http://www.truthinit.com/" target="_blank">TruthinIT</a> for a “battle of the bloggers.” To be honest, I surprised myself by how much I enjoyed that last session.</font></p> <p><font size="3">There was a lot of good content, but the ones that really appealed to me were Pure Storage, Zerto, Pivot3, and Xangati so I’ll summarize each of those briefly for now. </font></p> <h2>Pure Storage</h2> <p><font size="3">Fast, cool, exciting technology in an environment that matches. Wowed by their space from when we walked in the door to their tech in the presentation and to the lab. And the <a href="http://psycho-donuts.com/" target="_blank">Psycho Donuts</a> seemed to go over well for many. <a href="http://twitter.com/Mike_Laverick/status/173099776051658752" target="_blank">RBaaS</a> (Red Bull as a Service) was saw a trial run as well.</font></p> <h2>Zerto</h2> <p><font size="3">Gil was back for another Tech Field Day and this time with CTO and Co-founder Oded Kedem to talk about the upcoming 2.0 release of their flagship BC/DR product. Zerto visited us at Tech Field Day 8 in Boston and won this year’s <a href="http://www.zerto.com/news-events/press-releases/zerto-wins-best-of-show-and-gold-awards-at-vmworld-2011/" target="_blank">vmworld Best of Show</a>. Each time I’ve seen their tech I have wished that I worked in the segment to which it is marketed. </font></p> <h2>Pivot3</h2> <p><font size="3">They came with an <a href="http://pivot3.com/products/p3/" target="_blank">appliance</a>, out of the box, configured it during the presentation in 40 minutes, and then used it in a demo. How great is that? Pivot3’s tech DNA comes from the likes of Adaptec and Compaq and is branching out from the surveillance industry. Having founder and CTO Bill Galloway present showed their commitment to Tech Field Day.</font></p> <h2>Xangati</h2> <p><font size="3">Bacon, ice cream, and Star Wars references abound is not a bad way to start with this crowd, and Xangati appears to have one of the best monitoring products for your virtual infrastructure. They’ve been concentrating on VDI lately and their focus was on the <a href="http://xangati.com/products/virtual-desktop-infrastructure-vdi-dashboard/" target="_blank">VDI Dashboard</a>.</font></p> <p><font size="3"></font> </p> <p><font size="3">We brought it all to a close at the end of day two with great food and conversation at <a href="http://www.antonellasristorante.com/" target="_blank">Antonella’s</a>. Unfortunately Rodney Haywood could not join us; he needed to start his long journey home.</font></p> <p><em><font size="2"><strong></strong></font></em> </p> <p><em><font size="2"><strong>Disclaimer<br></strong>My travel, accommodations, and meals were paid for by the </font></em><a href="http://techfieldday.com" target="_blank"><em><font size="2">Tech Field Day</font></em></a><em><font size="2"> sponsors. Often there is swag involved as well. Like me, all TFD delegates are independents. We tweet, write, and say whatever we wish at all times, including during the sessions.</font></em></p> <p><font size="3"><a href="http://twitter.com/TechFieldDay/vfd2-delegates" target="_blank">Follow the other delegates!</a></font></p> Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-72328549138751249272012-02-19T09:11:00.000-05:002012-02-19T09:11:55.706-05:00Virtualization Field Day Two<span style="font-family: Arial, Helvetica, sans-serif;">I am honored to have been invited back for another virtualization-themed <a href="http://techfieldday.com/2012/vfd2/" target="_blank">Tech Field Day</a>. For those unfamiliar, Tech Field Day is a great opportunity for vendors to get together on a technical level with independents that represent their target market. It's a great short feedback loop that generates much excitement on both sides.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">This second virtualization-themed event marks a big step for GestaltIT and Tech Field Day as <a href="http://twitter.com/standaloneSA" target="_blank">Matt Simmons</a> will be the primary "show runner", paving the way for expanded Tech Field Day events. As a side note, this frees <a href="http://twitter.com/SFoskett" target="_blank">Stephen Foskett</a> to be with his son as he is presented the award for winning the <a href="http://crc.ohio.gov/" style="background-color: rgba(255, 255, 255, 0.917969); color: #1155cc;" target="_blank">Ohio Civil Rights MLK Essay Contest</a>. Go Grant!</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">This time around <a href="http://www.symantec.com/veritas" target="_blank">Symantec</a> and <a href="http://www.zerto.com/" target="_blank">Zerto</a> return and are joined by <a href="http://www.xangati.com/" target="_blank">Xangati</a>, <a href="http://www.purestorage.com/" target="_blank">PureStorage</a>, and <a href="http://www.pivot3.com/" target="_blank">Pivot3</a> and a blogger event with <a href="http://truebittv.truthinit.com/" target="_blank">truthinIT</a>.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><a href="http://techfieldday.com/2012/vfd2/" target="_blank">Join us, February 23 and 24th</a> and be sure to follow us on Twitter with hashtag <a href="http://twitter.com/#!/search?q=%23VFD2" target="_blank">#VFD2</a>.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">I look forward to seeing many familiar faces among the delegates and the opportunity to meet some new ones. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-91933478356133804852011-09-15T16:54:00.001-04:002011-09-16T10:59:41.522-04:00Capturing CPU Trends with PowerCLI<span style="font-size: small;">Inspired by the </span><a href="http://notscott.blogspot.com/2011/09/linux-guest-cpu-creep.html" target="_blank"><span style="font-size: small;">creeping CPU</span></a><span style="font-size: small;"> that we see in Linux guests and helped greatly by </span><a href="http://twitter.com/BoerLowie" target="_blank"><span style="font-size: small;">@BoerLowie</span></a><span style="font-size: small;"> at his </span><a href="http://boerlowie.wordpress.com/2010/07/01/get-the-trend-of-vm-cpu-usage-over-a-1-year-period/" target="_blank"><span style="font-size: small;">blog</span></a><span style="font-size: small;">, I’ve come up with a little PowerCLI to capture CPU trends of the top consumers per cluster.</span><br />
<span style="font-size: small;">This is my first cut and will likely see changes over time, like any script should. HTML output and emailed results are the most likely candidates.</span><br />
<span style="font-size: small;">The script should be fairly self-explanatory. For each cluster, traverse all VMs and get their OverallCpuUsage (the number that you see in the vSphere Client when selecting a cluster and then the Virtual Machines tab). Take the top X consumers based on that number and get their average CPU usage performance statistic for N days back in time and compare it to today’s.</span><br />
<span style="font-size: small;">The output looks something like this:</span><br />
<a href="http://lh5.ggpht.com/-xZUZGTY9bRo/TnJmCyY38oI/AAAAAAAABPs/bTe3uMLuJlQ/s1600-h/CPU-Trend4.png"><span style="font-size: small;"><img alt="CPU-Trend" border="0" height="177" src="http://lh6.ggpht.com/-RKGUOGlpB80/TnJmDhupAWI/AAAAAAAABPw/aj8c3VlsqnE/CPU-Trend_thumb2.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="CPU-Trend" width="439" /></span></a><br />
<span style="font-size: small;"><br /></span><br />
<span style="font-size: small;">So here you go:</span><br />
<div id="codeSnippetWrapper" style="background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;">
<div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">#</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"># Produce guest CPU trending from a time period back versus a shorter </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"># more immediate time frame. e.g. 30 days ago versus past 2 days.</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">#</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">param(</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> [string] $vCenter</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">)</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">$DaysOld = -30 # compare to full day stats <span style="color: blue;">this</span> many days back</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">$DaysRecent = -1 # get stats <span style="color: blue;">for</span> <span style="color: blue;">this</span> many recent days.</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">$GetTop = 10 # look at top x CPU consumers</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">#if</span> ($vCenter -eq <span style="color: #006080;">""</span>) {</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"># $vCenter = Read-Host <span style="color: #006080;">"VI Server: "</span></pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">#}</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"><span style="color: blue;">#if</span> ($DefaultVIServers.Count) {</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"># Disconnect-VIServer -Server * -Force -Confirm:$false</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">#}</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">#Connect-VIServer $vCenter</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">$AllClusters = Get-Cluster</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">Foreach ($Cluster in $AllClusters) {</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Write-Host <span style="color: #006080;">"`n$($Cluster.Name)"</span></pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $VMs = Get-Cluster $Cluster | Get-VM | `</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Where-Object { $_.PowerState -eq <span style="color: #006080;">"PoweredOn"</span> }</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $NumVMs = $VMs.Count</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # Get the Overall CPU Usage <span style="color: blue;">for</span> each VM in the cluster. Then cap that </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # list at the top $GetTop highest <span style="color: blue;">for</span> Overall CPU Usage</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $vm_list = @()</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $Count = 0</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Foreach ($vm in $VMs)</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> {</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $Count += 1</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Write-Progress -Activity <span style="color: #006080;">"Getting VM views"</span> -Status <span style="color: #006080;">"Progress:"</span> `</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> -PercentComplete ($Count / $NumVMs * 100)</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # the vSphere .Net view object has the OverallCpuUsage </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # (VirtualMachineQuickStats)</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # http:<span style="color: green;">//www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.Summary.QuickStats.html</span></pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $view = Get-View $vm</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput = <span style="color: #006080;">""</span> | Select-Object VMName, CpuMhz</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput.VMName = $view.Name</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput.CpuMhz = $view.Summary.QuickStats.OverallCpuUsage</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $vm_list += $objOutput</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> }</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # Reduce to our Top X</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $vm_list = $vm_list | sort-object CpuMhz -Descending | select -First $GetTop </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> #</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # For each of those VMs, get the statistics <span style="color: blue;">for</span> past and current CPU usage</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $NumVMs = $vm_list.Count</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $Out_List = @()</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $Count = 0</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Foreach ($vm in $vm_list)</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> {</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $Count += 1</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Write-Progress -Activity <span style="color: #006080;">"Compiling CPU stats"</span> -Status <span style="color: #006080;">"Progress:"</span> `</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> -PercentComplete ($Count / $NumVMs * 100)</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> [Double] $ldblPerfAged = (Get-Stat -Entity $vm.VMName -Stat cpu.usage.average `</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> -Start $((Get-Date).AddDays($DaysOld)) `</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> -Finish $((Get-Date).AddDays($DaysOld + 1)) -ErrorAction Continue | `</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Measure-Object -Average Value).Average</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> If ($ldblPerfAged -gt 0) {</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> [Double] $lblPerfNow = (Get-Stat -Entity $vm.VMName -Stat cpu.usage.average `</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> -Start $((Get-Date).AddDays($DaysRecent)) `</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> -ErrorAction Continue | Measure-Object -Average Value).Average</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> [Int] $lintTrend = (($lblPerfNow - $ldblPerfAged) / $ldblPerfAged) * 100</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput = <span style="color: #006080;">""</span> | Select-Object VMName, CpuMhz, PerfAged, PerfNow, Trend</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput.VMName = $vm.VMName</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput.CpuMhz = $vm.CpuMhz</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput.PerfAged = <span style="color: #006080;">"{0:f2}%"</span> -f $ldblPerfAged</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput.PerfNow = <span style="color: #006080;">"{0:f2}%"</span> -f $lblPerfNow</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $objOutput.Trend = <span style="color: #006080;">"{0}%"</span> -f $lintTrend</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $out_list += $objOutput</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> }</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> }</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> </pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> # Spit <span style="color: #006080;">'er out</span></pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> Write-Host "Top CPU Consumers Trending, $($DaysOld) days vs today`n"</pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> $out_list | Format-Table -Property VMName, `</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> @{Expression={$_.CpuMhz};Name='CPU Mhz<span style="color: #006080;">';align='</span>right<span style="color: #006080;">'}, `</span></pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> @{Expression={$_.PerfAged};Name='CPU Aged<span style="color: #006080;">';align='</span>right<span style="color: #006080;">'}, `</span></pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> @{Expression={$_.PerfNow};Name='CPU Now<span style="color: #006080;">';align='</span>right<span style="color: #006080;">'}, `</span></pre>
<pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"> @{Expression={$_.Trend};Name='Trend<span style="color: #006080;">';align='</span>right'}</pre>
<pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; margin-top: 0em; overflow-x: visible; overflow-y: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;">}</pre>
</div>
</div>
Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-70618398859180581422011-09-07T11:01:00.001-04:002011-09-07T11:01:44.982-04:00Linux Guest CPU Creep<p><font size="3">We run a lot of tiny VMs on vSphere 4 in a rather unique environment. The densities are high and the kernel OS is officially unsupported Fedora Core 8 (2.6.26 kernel). This causes us to be more tolerant of aberrations.</font></p> <p><font size="3">The biggest aberration of note has been CPU creep. The tiny guests will run along just fine using 30 - 40 MHz of CPU and then start a slow upward trend. It will creep slowly over the course of a week. No useful perspective can be gained from within the guest using traditional means. More interesting, performing a guest-initiated reboot will reveal a slow crawl all the way through the BIOS at boot and no CPU dip beyond the new baseline. They are stuck, and a reset from the vSphere client resolves the issue. </font></p> <p><font size="3">This has been acceptable so far. The guests are stateless, only a few are impacted at any one time, and no one guest is critical by itself. We automated the remediation, became accustomed, and moved on. The issue has stuck to one functional cluster and persisted across minor vSphere 4 upgrades.</font></p> <p><font size="3">Becoming accustomed caused us to miss another occurrence. </font></p> <p><font size="3">The software architects have been busy troubleshooting the core application running in a separate vSphere cluster on Ubuntu Server 8.04 LTS (2.6.24 kernel). CPU has been creeping slowly up for the past couple of months with a marked recent acceleration. We’ve been attributing it to increased load as we grow. The software was optimized and the CPU remained steady and on its upward path.</font></p> <p><a href="http://lh4.ggpht.com/-JwSITB6HgDI/TmeHVcsflXI/AAAAAAAABPc/TNK8lk9MEHw/s1600-h/MQ-Creeping%25255B6%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="MQ-Creeping" border="0" alt="MQ-Creeping" src="http://lh4.ggpht.com/-PBLsHI2ESjM/TmeHVh2SrcI/AAAAAAAABPg/p1gzR1g2ANU/MQ-Creeping_thumb%25255B4%25255D.png?imgmax=800" width="440" height="232"></a></p> <p><font size="3">The solution:</font></p> <p><font size="3">Stop all running processes, verify a higher than expected CPU load, and reset the VM. We’re down substantially.</font></p> <p><a href="http://lh3.ggpht.com/-nnZXauDazrk/TmeHVwNY_rI/AAAAAAAABPk/QJ5zv58XN-A/s1600-h/MQ-Creeping2%25255B4%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="MQ-Creeping2" border="0" alt="MQ-Creeping2" src="http://lh3.ggpht.com/-X94lUyDIaco/TmeHWO6P2oI/AAAAAAAABPo/q2dvmtzKkCw/MQ-Creeping2_thumb%25255B2%25255D.png?imgmax=800" width="442" height="214"></a></p> <p><font size="3">In a small shop with few resources and too many projects, it’s time to implement trending alerts.</font></p> <p><font size="3">Have you experienced this behavior before?</font></p> Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com1tag:blogger.com,1999:blog-8787590853725489207.post-24970694660934371192011-08-26T20:41:00.001-04:002011-08-26T20:41:38.176-04:00What a Rush<p><font size="3">I’m not even there yet and I’m excited. VMworld 2011 is upon us. </font></p> <p><font size="3">I’ve had the pleasure of attending VMworld since 2007, when I was just getting into virtualization and wanted to learn more. VMware Workstation was it for me, but I wanted to learn and prepare for server virtualization. We had no suitable servers and no shared storage.</font></p> <p><font size="3">Fast forward to this year where my team manages a heavily virtualized environment with very high densities including a unique business case. VMworld was a major destination on the path.</font></p> <p><font size="3">Sure, it was all achievable without. But I’d venture to say that a proper course includes VMworld. </font></p> <p><font size="3">The ability to learn at VMworld hit new highs last year with course content, Solutions Center, and the excellent Hands on Labs. This year can only be better.</font></p> <p><font size="3">That said, one of the biggest opportunities is to network with your peers. I missed out on much of that the first two VMworlds that I attended, and that was a mistake. Get out there and meet your peers. You’ll find a vast pool of great folks that can relate to your virtualization and cloud efforts and others that will blow you away with endless possibilities in real world scenarios.</font></p> <p><font size="3">Will you be there? Please come up, say hello, and forgive me if I can not quickly connect your name to your Twitter handle or the discussion that we had a couple of years back.</font></p> <p><font size="3">I look forward to seeing you there!</font></p> Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-5133626670849465862011-06-10T02:07:00.000-04:002011-06-10T02:19:28.324-04:00Tech Field Day 6, Day 1 - Outsider In<p>Technically it is now day 2 of <a href="http://gestaltit.com/" target="_blank">Gestalt IT</a>’s fantastic <a href="http://techfieldday.com/2011/tfd6/" target="_blank">Tech Field Day</a>—but let’s not split hairs, shall we?</p> <p>If you are unfamiliar with <a href="http://techfieldday.com/about/" target="_blank">Tech Field Day</a>, please follow the links and learn. If you want the short summary: a small group of independent peers afforded the opportunity to talk to vendors in their space while being exposed to internal details and future direction of the their products.</p> <p>Conceived and orchestrated by The Man Who Does Not Sleep, <a href="http://twitter.com/#!/sfoskett" target="_blank">Stephen Foskett</a> and the Uber<sup>1</sup>-Fantastic <a href="http://twitter.com/#!/cchaplais" target="_blank">Claire Chaplais</a>, delegates are elected by their peers. It is an honor to be selected and TFD6 has been my honor.</p> <p>Today brought us VKernel and their vOperations Suite, VMware with Mobile Virtualization Platform, Site Recovery Manager and Student Cloud, and SolarWinds hot off their acquisition of Hyper9. We closed out the day with many of our virtualization peers at Beantown Party as a Service (BPaaS) held at the EMC Club in Fenway Park. What a ride!</p> <p>I’m the verbally quiet camera-shy guy that tries to tweet a lot while consuming all that he can. Please follow along with all of the <a href="http://twitter.com/TechFieldDay/tfd6-delegates" target="_blank">delegates</a>--there’s plenty more to come on day 2.</p> <p><sup>1</sup> “Uber” attribution copyright <a href="http://twitter.com/#!/lynxbat" target="_blank">@lynxbat</a></p> Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com0tag:blogger.com,1999:blog-8787590853725489207.post-11089950294850949342011-05-21T08:35:00.001-04:002011-06-15T04:08:29.802-04:00Three Lines, One Conduit<div><p>This one is a brief food-for-thought post.  I work for an SMB, with the focus on “S” during a large part of my tenure. Things come fast in this environment.  Requirements can be loosely defined and based on confidence in the key individuals, not their experience.  Timelines are short with most implementations starting same-day.</p>
<p>You know that you need connectivity and you know that it needs to be diverse.  If you’re truly SMB, you’ve started with one Internet connection and it has suited you well—until it fails or your need more bandwidth.  Add a 2nd, and you’re sure to choose an alternate provider and an alternate path into your site.  Repeat with the 3rd, throw some <a href="http://www.radware.com/Products/ApplicationDelivery/LinkProof/default.aspx">wonderful hardware</a> at it, and enjoy your resiliency.</p>
<p>Or so you think.  </p>
<p>Do you know where your feeds go after they leave your building?  And if you have this knowledge, how far does it carry?  Around the corner, down the block, or a mile out?  </p>
<p>We found this information hard to obtain and it cost us.  The city relegated some of the routes and they therefore became common.  3 feeds with three entry points over 2 buildings ultimately shared the same conduit a short 4 blocks down the street.</p>
<p>A construction mishap brought this realization to light.  We had wireless at our disposal, but our hardware needed a software upgrade and complete reprogramming under a new paradigm before it could be used. This would take hours, and in the end there was little that we could do. While bad, we fared better than many who waited a week for all of the fiber and copper to be spliced back together.</p>
<p>Know your paths, beyond your site.</p>
</div>Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com1tag:blogger.com,1999:blog-8787590853725489207.post-12563999385450732632011-05-18T21:05:00.000-04:002011-05-18T21:46:25.180-04:00The Great Enabler - Intro<blockquote> <p><font size="2">"Choose a job you love, and you will never have to work a day in your life." –Confucious</font></p></blockquote> <p><font size="3">I am fortunate in my career. I work within a field that started and continued as a hobby—something that I love to do. Driven by an interest and a knack, skill gets to follow along for the ride. I believe that what makes me most fortunate, however, is the continual opportunity to make an <strong><em>impact</em></strong>. To be rewarded with the ability to see thoughts and ideas materialize and change the tools, capabilities, or even manner at which we do business.</font></p> <p><font size="3">My fondest example is virtualization. I’ve had the fortune to see my interest in articles read in 2007 flow from a casual conversation with my manager to relocation of our headquarters and main datacenter. The road was paved with VMworld 2007 through 2010, virtual IT labs, developers’ stations, virtualized tier 3 workloads that soon became tier 1 workloads, first exposure to SANs, and a whole lot of peers, friends, and fun.</font></p> <p><font size="3">We’ve moved from 0% to 98% virtualized. 99% is around the corner with Private Cloud (there, I said it) in sight. </font></p> <p><font size="3">We’re small. Resources are tight. Time has always been tighter. We learned, we stumbled, we learned again. I wanted to capture much of the most recent leg of the journey, so here we are. </font></p> <p><font size="3">I hope that you may find some of this interesting. There’s more to come.</font></p> Todd A. Scalzotthttp://www.blogger.com/profile/02778190081573506117noreply@blogger.com1