Posts

Showing posts from April, 2014

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 =  ("Something"

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