Thursday, July 26, 2018

Powershell Rest Calls (invoke-restapi) fail with latest versions - Force TLS

If you start experiencing Rest-call failures in PowerShell (Invoke-RestApi, Invoke-WebRequest, ...), you should realize that NetApp has dropped SSL support.

So you must force TLS now.

This is done by adding this code at the beginning :

# Force TLS
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Wednesday, July 25, 2018

Tuning WFA 4.2

My collegue José is working on one of the largest WFA installs I know of and he told me this after migrating from 4.0 to 4.2 :


After a migration from WFA 4.0 to a different server on WFA 4.2 we started to see slowness up to the point where the application was unusable.

The execution log was taking minutes to populate, and when it was populating for one user, the rest could do nothing, get timeout errors and messages about "server busy".

Tuesday, July 24, 2018

Grab WFA execution log with powershell

For logging purposes, you might want the need to grab a WFA execution log.  I initially wrote this to dump those in an OCI database, but for this post, I narrowed it down to just dumping them in CSV-files (jobinfo, input parameters & return parameters).  The original script also updates statuses (for example, when a jobstatus changes from failed => resume => completed), but that compare is only possible when we dump in a database and i can query it again, so for this csv-output method, an update won't work (but I kept the code in comment).

I did make the script incremental.  Job logs can take a while to grab, so I allow a timeout.  I keep the last jobid in a simple text-file.  Original, obviously, I stored this in the database.  I you are interested in the the database version, give me a ping.


Friday, July 20, 2018

Get rid of Get-WfaLogger and override Write-Host

A customer recently asked if it's possible to override write-host, avoiding Get-WfaLogger and thus be able to convert existing PowerShell scripts to Wfa-commands by a simple copy-paste.

I tried it, and yes it's possible.  Well, you would still need to add 2-lines of code, and this doesn't necessarily mean that you can just copy paste any piece of code in there (for example the parameters of your script must be strong-typed and must match the support parameters, there are other native wfa cmdlets like "connect-wfacluster", ...)

Wednesday, June 20, 2018

How to calculate a sum in a repeat row in WFA

Ever needed to add a repeat row and calculate a sum on the fly ?
This is built into wfa already.

For example, you want a user input table, where you add qtrees and their sizes, but you would need a sum at some point so create the volume (where the size is the sum of the qtrees).

Monday, June 18, 2018

Wfa Invoke-NcSsh broken

In WFA4.2 you might have noticed Invoke-NcSsh doesn't work as it used to.  You need putty, and even then there seems to be a memory leak.

WFA has a custom cmdlet called "Invoke-WfaClusterCli", which is
doing the same thing, assuming you wanted to SSH to a Netapp Cluster ofcourse :)

I posted the code below, just for reference.  Obviously in WFA you can just call it, as it's embedded in the WFAWrapper module.

Tuesday, June 5, 2018

Powershell - move ontap cluster lifs between interfacegroups

For a headswap procedure, I had to move lifs from 3 interface groups to 2 interface groups.

So before we had :
a0a, a0b & a0c

After we have :
a0a, a0b

This means all lifs on a0c need to move to a similar vlan port on another interface group.  here is a powershell script to do it automatically

Monday, June 4, 2018

WFA advanced incremental naming

In a previous post, I already explained how incremental naming works.  (http://www.wfaguy.com/2016/12/incremental-naming.html#more)

However, sometimes you need something a bit more advanced.
For example you need this incremental functionality

- myvol50xx
- myvol51yy
- myvol52zz

Wednesday, May 30, 2018

WFA Fixes for vmware 6.5

The Vmware 6.0/6.5 packs from the automation store are unfortunately not 100% failsafe, I discovered today.

These are the fixes I added to make it work with Vmware 6.5.
I have NOT tested it with 6.0, maybe the fix is only needed for 6.5.

I also talked to engineering, if they adapt my fixes, I'll update this post to not add any confusion.



Thursday, May 17, 2018

Invoke WFA workflow with PowerShell

It was brought to my attention that I never really posted the Powershell code to invoke a workflow.  It seemed so elementary, and I tend to use it in many scripts, that I simply forgot.

So here are  2 simple functions to list workflows and to invoke a workflow.