
florian.haas at linbit
Jun 23, 2009, 6:01 AM
Views: 316
Permalink
|
|
[PATCH 3 of 3] iSCSILogicalUnit: add support for per-LU parameters
|
|
# HG changeset patch # User Florian Haas <florian.haas[at]linbit.com> # Date 1245761391 -7200 # Node ID 1d94c4de42ede9bfd120d3ca096421db8bee8cc2 # Parent 720e09be75f065024570525f413231b1fd88bcb4 iSCSILogicalUnit: add support for per-LU parameters This patch adds support for parameters at the LU level. This comes in handy if one wishes to assign custom SCSI IDs, serial numbers, and the like. diff -r 720e09be75f0 -r 1d94c4de42ed resources/OCF/iSCSILogicalUnit --- a/resources/OCF/iSCSILogicalUnit Tue Jun 23 14:49:51 2009 +0200 +++ b/resources/OCF/iSCSILogicalUnit Tue Jun 23 14:49:51 2009 +0200 @@ -92,6 +92,17 @@ <content type="string" /> </parameter> +<parameter name="params" required="0" unique="0"> +<longdesc lang="en"> +LU parameters. A space-separated list of "name=value" pairs which +will be passed through to the iSCSI daemon's management interface. The +supported parameters are implementation dependent. Neither the name +nor the value may contain whitespace. +</longdesc> +<shortdesc lang="en">List of iSCSI LU parameters</shortdesc> +<content type="string" /> +</parameter> + </parameters> <actions> @@ -146,18 +157,33 @@ return $OCF_SUCCESS fi + local params + case $OCF_RESKEY_implementation in iet) + # in IET, we have to set LU parameters on creation + params="Path=${OCF_RESKEY_path} ${OCF_RESKEY_params}" do_cmd ietadm --op new \ --tid=${OCF_RESKEY_tid} \ --lun=${OCF_RESKEY_lun} \ - --params Path=${OCF_RESKEY_path} && return $OCF_SUCCESS + --params ${params// /,} && return $OCF_SUCCESS ;; tgt) + # tgt requires that we create the LU first, then set LU + # parameters + params="${OCF_RESKEY_params}" do_cmd tgtadm --lld iscsi --op new --mode logicalunit \ --tid=${OCF_RESKEY_tid} \ --lun=${OCF_RESKEY_lun} \ - --backing-store ${OCF_RESKEY_path} && return $OCF_SUCCESS + --backing-store ${OCF_RESKEY_path} || return $OCF_ERR_GENERIC + if [ -z "$params" ]; then + return $OCF_SUCCESS + else + do_cmd tgtadm --lld iscsi --op update --mode logicalunit \ + --tid=${OCF_RESKEY_tid} \ + --lun=${OCF_RESKEY_lun} \ + --params ${params// /,} && return $OCF_SUCCESS + fi ;; esac return $OCF_ERR_GENERIC diff -r 720e09be75f0 -r 1d94c4de42ed resources/OCF/iSCSITarget --- a/resources/OCF/iSCSITarget Tue Jun 23 14:49:51 2009 +0200 +++ b/resources/OCF/iSCSITarget Tue Jun 23 14:49:51 2009 +0200 @@ -88,7 +88,8 @@ <longdesc lang="en"> Target parameters. A space-separated list of "name=value" pairs which will be passed through to the iSCSI daemon's management interface. The -supported parameters are implementation dependent. +supported parameters are implementation dependent. Neither the name +nor the value may contain whitespace. </longdesc> <shortdesc lang="en">List of iSCSI target parameters</shortdesc> <content type="string" /> _______________________________________________________ Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
|