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:

One thought to “IBM SVC: Copy VDisk Host-Mapping from one host to another”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.