SVC: Find WWPN

Today we had (once again) hardware troubles. We ended up replacing a lot of things, but in the end it was a) the HBA and b) apparently some memory DIMMs. Now, that isn’t SVC related. However, we built in another HBA (from our Standby hardware), which apparently already had been assigned to a host.

Now, since you can’t search for a WWPN (at least not that I know of), I ended up writing a little script (yup, AGAIN) in order to do that for me!

SVC: Migrate VDisks off a MDisk Group onto another

Out of necessity, another SVC shell script was just born. If you ever need to migrate a whole MDisk group onto another, you quickly discover the limited application of the SVC GUI. Now, you could query the VDisks using your original MDisk Group and then copy and paste the VDisk’s name (or the VDisk ID) into a command line and simply reuse that svctask migratevdisk command over and over.

Luckily IBM blessed the SVC with an SSH interface. So again, we can write a (kinda) simple shell script which may look like this:

And the execution would look like this:

Or maybe:

IBM SVC: Copy VDisk Host-Mapping from one host to another

As I wrote a few days ago, I started a new job. One of my first (voluntary) tasks was writing a shell script which would copy a VDisk Host-Mapping from a given host to another. This is useful, if you do have a lot of ESX servers for example and a few roaming ones.

Now, if say, you need to do some ESX-Updates and you would like to add the roaming one to a given farm, you would be in a dark an deary place. You would be required to either click through the GUI a dozen times (in my case, it might have needed ~200 clicks) or type svcinfo lshostvdiskmap <examplehosthere> and svctask mkhostvdiskmap <newhosthere> -force (these are incomplete command references) a few times.

Both methods ain’t optimal nor fast. Since the SVCTools (Perl, jikes) don’t really came into consideration, and the SVC SSH interface really doesn’t provide any other method to do a simple cut -d: -f3 (as a hint: if anyone knows a nice method to emulate cut with bash patterns — yeah, I ain’t kidding — please drop me a note!), I ended up writing a simple shell script which is gonna do all the tasks from any Linux system (in possession of the SSH DSA private keys for the SVC of course).

The script looks like this: