We have exactly same setup so I thought I could share simple scripts I use for automation. You can run it by executing ./script.sh lun_number (script bellow) XIV uses lun numbers is decimal, and zfcp scripts in linux use hex numbers. Script does dec -> hex conversion so you can provide a lun number as it is on the XIV - decimal. I suggest using on every linux host same FCP addresses so these scripts for adding/removing luns will be everywhere exactly the same. I always use 1001,1002,1003,1004. It can be done with a dedicate statement for each VM in the z/vm user directory:
DEDICATE 1001 4001 // where 4001,4002,4003,4004 are real FCP channels defined in IOCP DEDICATE 1002 4002 DEDICATE 1003 4003 DEDICATE 1004 4004 Here script for adding lun (assuming that you have 4 paths via 4 channels for each host) the 0xXXXX... are WWPN on the XIV. Adding lun: #!/bin/bash lun_d=$1 lun_h=$(printf '%02x' $lun_d) /sbin/zfcp_disk_configure '0.0.1001' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '1' /sbin/zfcp_disk_configure '0.0.1002' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '1' /sbin/zfcp_disk_configure '0.0.1003' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '1' /sbin/zfcp_disk_configure '0.0.1004' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '1' Removing lun: #!/bin/bash lun_d=$1 lun_h=$(printf '%02x' $lun_d) /sbin/zfcp_disk_configure '0.0.1001' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '0' /sbin/zfcp_disk_configure '0.0.1002' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '0' /sbin/zfcp_disk_configure '0.0.1003' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '0' /sbin/zfcp_disk_configure '0.0.1004' '0xXXXXXXXXXXXXX' '0x00'$lun_h'000000000000' '0' Gregory Powiedziuk [email protected] 2013-12-09 Karl Kingston <[email protected]>: > We have an XIV connected to 2 switches which in turn is connected to our > z10 through 4 adapters. > > We have defined 5 luns for use under SLES11SP2. > > Right now, we are using YaST to define all of the connections. This > seems to be cumbersome. > > Is there a way for us to to scan and define each lun without having to do > this manually? > > Thanks > > ---------------------------------------------------------------------- > For LINUX-390 subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO LINUX-390 or visit > http://www.marist.edu/htbin/wlvindex?LINUX-390 > ---------------------------------------------------------------------- > For more information on Linux on System z, visit > http://wiki.linuxvm.org/ ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390 ---------------------------------------------------------------------- For more information on Linux on System z, visit http://wiki.linuxvm.org/
