Posts

Newer Processor = Faster Performance? Sometimes...

Summary: We were receiving reports of some developers experiencing a degradation in JVM compile performance and general compiled application performance.  We had just recently vMotion'd these VM's from HP G7 systems w/ Westmere processors to newer Dell M620 blades running Sandy Bridge Processors. Long story short, applications compiled on Westmere don't take advantage of a new AVX CPU extension available on Sandy Bridge, which in turn is only made available in RHEL 6.2 and newer kernels.  I'm not sure if Windows would be affected in the same way, but this was a definite issue in RHEL 5.8. The performance delta was not 'huge' but enough in terms of scale.

Powershell functions and referencing the script that calls that function...

Summary: Lately I've been putting together functions so I can reuse code in my other scripts.  As part of error checking/reporting, I wanted to add a way for my function to reference the script that was making use of it.  I put a question out on twitter and here is what I learned. @Zsoldier did you check this forum ? http://t.co/Rw3YN7texZ /cc @ScriptingGuys — Johan Bijnens (@alzdba) April 15, 2014 Quick and Dirty: function Test-Function { Param ( [ string ] $Weird ) Write-Host " MyInvocation " -ForegroundColor :Green $MyInvocation [ string ] $test = $MyInvocation .ScriptName.split( " \ " ) | select -Last 1 Write-Host $test -ForegroundColor :Green } Hit page break if you want more details and an example of how I used $MyInvocation.

How to null terminate object properties in Powershell

Summary: I was working on a script, which I'll post on later, to insert IPMI/iLO/iDRAC configs into my ESXi hosts.  I would get an error the following error consistently no matter what I put into my IPMI object: Exception calling "UpdateIpmi" with "1" argument(s): "A specified parameter was not correct.  " At line:50 char:2 +     $_this.UpdateIpmi($ipmiInfo) +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException     + FullyQualifiedErrorId : VimException The short answer, I had to ' null terminate ' the properties in my IPMI object.  I don't know 'why' I have to do this, but the vSphere API docs state that this is a requirement.  Quite frankly, I had no idea what this meant. Solution Example: To null terminate an object's property, you can simply do like so: $MyObject = "" | Select Usefulproperty $MyObject.Usefulproperty =  ...

Get iDRAC/ILO (aka Baseboard Management Controller) IP via PowerCLI

[Update: 1 report states issues w/ HP Gen9 systems.  Newer Dell, and older HP systems don't seem to have issues.  If you have a HP Gen9 system, feel free to contact me via google hangouts and/or twitter to start an interactive session and we can work through figuring out a workaround.] Summary: Needed a way to figure out what IP my HP iLO's / Dell iDrac's were configured with.  Ended up using an oldie, but a goodie script put together by Carter Shanklin . PreReqs: Powershell 2+ PowerCLI 4+ Must have Port 443 (https) access to your ESXi hosts. If firewalls are an issue you may have the option of running this from your vCenter if it's still running on Windows.  If it's the vApp, you'll need to open access to port 443. Download Carter's script Short and Sweet: $info = Get-VMHostWSManInstance -VMHost (Get-VMHost myESXiServer) -ignoreCertFailures -class OMC_IPMIIPProtocolEndpoint $info # You can remove the -ignoreCertFailures flags if your syst...

Learning PowerCLI by Robert van den Nieuwendijk

Summary: Don't ask me how to pronounce Robert's last name. Review The great thing about Robert's approach is that he takes the time to point out some basic powershell syntax outside of PowerCLI. You are then soon driven into some very useful cmdlets to extract information from your vSphere environment using Powershell and vSphere's PowerCLI cmdlets. There were a couple of areas of concern where a lack of explanation on certain things lead to a hmmm? moment, but overall an excellent book for a vSphere admin looking to use PowerCLI. For me as a technical person, I like the 'straight to the point' approach. This book is filled w/ little text and more usable script examples for me to get my job done as an admin/engineer. Disclosure For full disclosure, I was given this book to review, but was not compensated beyond this. I also have met Robert before, but that in no way has an affect on my review of this book. The above review reflects my honest opinion. You can...

The server naming convention is dead, long live the server naming convention!

Summary: Get rid of conventions that can be cross-referenced from other data sources in a programmatic fashion.   Consolidate or present those cross-referenced data points into one pane of glass. Rant: In times old, server's had cool names like Ferrari, Robotech, etc.  Although cool, this drove the need for a server naming convention which served useful purpose.  It could tell us a good many things about a server just by looking @ its name.  Some things could be: Location OS Application Etc. Because of limitations in previous technologies, you had to limit your server name to a certain number of characters (coming from a Windows background).  Each of these data points needed to be shortened to acronyms or numbers.  This essentially requires a decoder ring for each section of the server name to understand it's hidden meaning.  When dealing w/ a small environment, not a big deal, but scalability becomes a problem. Using the exa...

Quirkiness of Excel 2011 for Mac, CSV's, and Powershell 3.0 import-csv

Image
Summary: Work on Windows or a Mac, don't cross the streams unless you're up against Gozer. Details: I made a CSV file using Excel 2011 for Mac w/ that looked something like this: HeaderName, HeaderName2, HeaderName3, HeaderName4 Meh, super.meh.local, space, heckling Sigh, super.meh.local, space, bashing Saving this as a "Comma Separated Values" file was my first mistake cause when I tried to import this in Powershell, I would get the following super helpful error: import-csv : The member "super.meh.local" is already present To boil it down, I needed to save the CSV as a "Windows Comma Separated" csv file type.  The other method was that I could have placed quotes around all comma separated values via a text editor.