Cómo crear manualmente una LUN iSCSI y mapearla contra un initiator group
Lo primero vamos a crear un volumen de prueba para añadir sobre él la LUN, lo crearemos con un tamaño de 210 megas y sobre el agregado de prueba que creamos en el anterior artículo, NetApp: cómo crear y añadir discos a un agregado (aggr):
NetApp01> vol create vol_luns aggr_test 210m Creation of volume 'vol_luns' with size 210m on containing aggregate 'aggr_test' has completed.
NetApp01> vol status vol_luns Volume State Status Options vol_luns online raid_dp, flex create_ucode=on, convert_ucode=on Containing aggregate: 'aggr_test'
Una vez creado vamos añadir la LUN en el volumen, le asignamos 100 megas de espacio e indicamos que no lo reserve, de modo que el tamaño usado crezca conforme se va necesitando (-o noreserve), el tipo de OS sobre el que se utilizará será linux (-t linux) y la llamamos lun001:
NetApp01> lun create -s 100m -t linux -o noreserve /vol/vol_luns/lun001
NetApp01> lun show /vol/vol_luns/lun001 100m (104857600) (r/w, online)
Ahora tenemos que crear el initiator group, dentro del cual añadimos los initiator names de las máquinas sobre las que luego se configurará la LUN iSCSI (con -i indicamos que el protocolo a usar es iSCSI, con -f sería FCP), lo llamamos iniciador_01 y añadimos el iniciador iqn.2009-05.com.test:test.1 e iqn.2009-05.com.test:test.2
NetApp01> igroup create -i -t linux iniciador_01 iqn.2009-05.com.test:test.1 iqn.2009-05.com.test:test.2
Finalmente sólo queda mapear la LUN con el initiator group que hemos creado para que las dos máquinas ya puedan utilizar la LUN cuando fuera necesario:
NetApp01> lun map /vol/vol_luns/lun001 iniciador_01 Fri Jul 29 21:26:15 GMT [lun.map:info]: LUN /vol/vol_luns/lun001 was mapped to initiator group iniciador_01=0
NetApp01> lun map /vol/vol_luns/lun001 iniciador_02 Fri Jul 29 21:26:15 GMT [lun.map:info]: LUN /vol/vol_luns/lun001 was mapped to initiator group iniciador_01=0
NetApp01> lun show -m LUN path Mapped to LUN ID Protocol ----------------------------------------------------------------------- /vol/vol_luns/lun001 iniciador_01 0 iSCSI
Ya tendríamos nuestra LUN lista para utilizar en cualquiera de los dos iniciadores.
Crear con un asistente una LUN iSCSI ó FCP y mapearla contra un initiator group
Si la explicación anterior os ha resultado demasiado engorrosa, siempre podéis lanzar el asistente disponible en la CLI para crear nuevas LUN, mapearlas, crear initiator groups, añadirles iniciadores, etc. Aquí podéis ver el proceso completo, en negrita las acciones realizadas:
NetApp01> lun setup This setup will take you through the steps needed to create LUNs and to make them accessible by initiators. You can type ^C (Control-C) at any time to abort the setup and no unconfirmed changes will be made to the system. Do you want to create a LUN? [y]: y Multiprotocol type of LUN (solaris/windows/hpux/aix/linux/netware/vmware/windows_gpt/windows_2008/xen/hyper_v/solaris_efi) [linux]: linux A LUN path must be absolute. A LUN can only reside in a volume or qtree root. For example, to create a LUN with name "lun0" in the qtree root /vol/vol1/q0, specify the path as "/vol/vol1/q0/lun0". Enter LUN path: /vol/vol_luns/lun002 A LUN can be created with or without space reservations being enabled. Space reservation guarantees that data writes to that LUN will never fail. Do you want the LUN to be space reserved? [y]: n Size for a LUN is specified in bytes. You can use single-character multiplier suffixes: b(sectors), k(KB), m(MB), g(GB) or t(TB). Enter LUN size: 50m You can add a comment string to describe the contents of the LUN. Please type a string (without quotes), or hit ENTER if you don't want to supply a comment. Enter comment string: lun test The LUN will be accessible to an initiator group. You can use an existing group name, or supply a new name to create a new initiator group. Enter '?' to see existing initiator group names. Name of initiator group []: ? No existing initiator groups. Name of initiator group []: iniciador_01 Type of initiator group iniciador_01 (FCP/iSCSI) [iSCSI]: iSCSI An iSCSI initiator group is a collection of initiator node names.Each node name can begin with either 'eui.' or 'iqn.' and should be in the following formats: eui.{EUI-64 address} or iqn.yyyy-mm.{reversed domain name}:{optional string composed of alphanumeric characters, '-', '.' and ':'} Eg: iqn.2001-04.com.acme:storage.tape.sys1.xyz or eui.02004567A425678D You can separate node names by commas. Enter '?' to display a list of connected initiators. Hit ENTER when you are done adding node names to this group. Enter comma separated nodenames: iqn.2009-05.com.test:test.1, iqn.2009-05.com.test:test.2 Enter comma separated nodenames: The initiator group has an associated OS type. The following are currently supported: solaris, windows, hpux, aix, linux, netware, vmware, xen or hyper_v. OS type of initiator group "iniciador_01" [linux]: linux The LUN will be accessible to all the initiators in the initiator group. Enter '?' to display LUNs already in use by one or more initiators in group "iniciador_01". LUN ID at which initiator group "iniciador_01" sees "/vol/vol_luns/lun002" [0]: LUN Path : /vol/vol_luns/lun002 OS Type : linux Size : 50m (52428800) Comment : lun test Initiator Group : iniciador_01 Initiator Group Type : iSCSI Initiator Group Members : iqn.2009-05.com.test:test.1 : iqn.2009-05.com.test:test.2 Mapped to LUN-ID : 0 Do you want to accept this configuration? [y]: y Fri Jul 29 21:21:50 GMT [lun.map:info]: LUN /vol/vol_luns/lun002 was mapped to initiator group iniciador_01=0 Do you want to create another LUN? [n]: n