PowerShell: Removing VMware CPU/Memory resource limits

I recently assisted with a major hardware life cycle. We Migrated from Dell 1950’s to IBM BladeCenter H with H21XM blades. While the processors were comparable the RAM upgrade was tremendous. Going from 8/16GB to 32GB. This increase enabled much greater consolidation ratios, and with such we found ourselves with an abundance of hardware. After shutting down several hosts, and collapsing a few clusters we still weren’t driving our infrastructure. Shortly thereafter we realized that the resource limitations we had previously set. Were no longer necessary, and in some cases where decreasing performance (memory ballooning). A few minutes with the VI Toolkit for Windows, and we were screaming again!


Now all that is left is for Andrew to translate this to perl/rCLI.
~Glenn

PowerShell: Ping-Subnet

A couple a weeks ago I was hanging out in the PowerScripting Ustream waiting for the show to start. There were several of us caring on, when the interview subject Brandon Shell placed a call to scripting. He asked for a script to ping a subnet. There are many select-alive/ping-host scripts why write another one? The answer is simple pinging a target is easy, what Brandon was asking for was a fast way to generate the list of hosts. (Additionally, if you work with Active Directory then you can already see the usefulness in being able to ingest the subnets in sites and services as a parameter.) Shortly after Brandon made the request I opened my big mouth, and commented that the math was easy. The hard part is “threading”, as you know we can’t thread in PowerShell… but there are ways to perform concurrent operations. The PSJobs in V2 were purpose built for such a task. Unfortunately the *-job cmdlets use winrm as a backend, and require WS-MGMT to be installed/configured. As I was carrying on with this line of thought Brandon broke in, and informed me that the Get-WMIObject cmdlet in CTP3/V2 uses its own ‘backend’! He went on to inform me that all I needed was to tack on the –AsJob parameter… After a couple quick tests, I had a draft, and shortly thereafter a script!

Read more

Powershell: Passthru Authentication with OnTap SDK 3.5

This morning I decided to play with the passthru authentication via RPC that the SDK provides, and boy is it easy! To utilize passthru authentication you first you need to install a dll. Assuming the sdk is saved to C:

x86
copy “C:manage-ontap-sdk-3.5libntntapadmin.dll” %windir%System32ntapadmin.dll
x64
copy “C:manage-ontap-sdk-3.5libntx64ntapadmin.dll” %windir%System32ntapadmin.dll
copy “C:manage-ontap-sdk-3.5libntntapadmin.dll” %windir%SysWOW64ntapadmin.dll
ia64
copy “C:manage-ontap-sdk-3.5libntia64ntapadmin.dll” %windir%System32ntapadmin.dll
copy “C:manage-ontap-sdk-3.5libntntapadmin.dll” %windir%SysWOW64ntapadmin.dll

Now that the appropriate DLL is installed connecting to a Filer is as simple as specifiying the style as RPC.

Similar procedures will enable the SLL/encryption capabilities within the SDK only using the ssleay32.dll(SSL)/libeay32.dll(encryption). I’m not yet sure what the zephyr(ZAPI) assemblies do, but hey I’m just admin living in a devs world.

Enjoy
~Glenn

OnTap SDK: Report all Shares and Exports on mixed volumes

This challenge was also thrown down by LucD, he asked for a list of mixed vols and any NFS exports/Cifs shares off the volume.  Well this was a fairly straight forward process. First I would need every NFS export followed shortly by any Cifs shares.   While I could have used my “cli-cheat” for the Cifs shares, I decided to write a function using the proper ZAPI calls.  Finally the volumes… well maybe not, security style is assigned on a Qtree level,  I called an audible…  This script uses my Get-NaCifs , and Get-NaNFSExport scripts which can be found on poshcode.org.

Read more

OnTap SDK: Get all Cifs shares with permissions

Task: Get a list of all Cifs shares on a filer, and their permissions.

I’m going cheat a bit and just say that I spent two days searching through the API for this, before I realized that Filerview was echoing out the output from ‘cifs shares’… This changes the task slightly, the end goal is still the same, but the method will be via the cli. I used the same discovery functions as before. Good thing I wrote them because the API I needed is undocumented!

Read more

Powershell Reflection OnTap Style

I’ve come to love PowerShells ability to perform reflection on any given object (I.e. Get-Member). The way the OnTap SDK was implemented does not support reflection… directly. The problem is the SDK consists of two classes that are able to interact with the ZAPI interfaces. Basically NaServer holds everything needed to connect->execute-> return results. Likewise the NaElement knows how to take input, and format that input into a valid XML request for ZAPI. NaElement also has all the logic needed to navigate, and use the information returned by a request. So what does that mean to us? Neither object has any knowledge of the actual API! This utterly kills the ability to “feel out” a given object. I can’t (new-object something|gm) till I find what I’m looking for, and I wanted that ability.

That small capability is almost a deal breaker for me. I’ve spent hours upon hours with the API on one monitor, and PowerShell on the other… it’s not fun! I sent out an open call during my last post, and was quickly taken up on it. As I sat down last night, and started digging through the API yet again. I decided enough was enough… I sat down and wrote a couple functions that more or less allow me to perform a primitive version of reflection. More accurately I can search the API reference right there from my console. I was so pleased with the outcome I decided to post a quick how to.

Read more

NetApp OnTap SDK 3.5 released with .net support(AKA PowerShell Support)!

Late last night I stumbled upon this post in the NetApp Technology Network (NTN) announcing version 3.5 of the Manage OnTap SDK… My first reaction was that OnTap 7.3.1 might be getting closer to GA, seeing as they finalized the API.  I downloaded the new bits, and was reading through the documentation when I noticed the following:

Supports multiple language interfaces –  C/C++, C#, VB.NET, Java, and Perl

Well that pretty much made my whole PoshOnTap module irrelevant… but it’s still a great source for examples using the SDK.   Speaking of, how about quick intro to the SDK…

Read more

83447d66560267981ac2fd71f377d555GGGGGGGGGGGGGGGGGGGGGGGGGGGGGG