[ClusterLabs] Resource Agent ocf:heartbeat:iSCSILogicalUnit

Jason A Ramsey jason at eramsey.org
Fri Jul 22 10:43:00 EDT 2016


I’m struggling to understand how to fully exploit the capabilities of targetcli using the Pacemaker resource agent for iSCSILogicalUnit. From this block of code:

lio-t)
	# For lio, we first have to create a target device, then
	# add it to the Target Portal Group as an LU.
	ocf_run targetcli /backstores/block create name=${OCF_RESOURCE_INSTANCE} dev=${OCF_RESKEY_path} || exit $OCF_ERR_GENERIC
	if [ -n "${OCF_RESKEY_scsi_sn}" ]; then
		echo ${OCF_RESKEY_scsi_sn} > /sys/kernel/config/target/core/iblock_${OCF_RESKEY_lio_iblock}/${OCF_RESOURCE_INSTANCE}/wwn/vpd_unit_serial
	fi
		ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/luns create /backstores/block/${OCF_RESOURCE_INSTANCE} ${OCF_RESKEY_lun} || exit $OCF_ERR_GENERIC

	if [ -n "${OCF_RESKEY_allowed_initiators}" ]; then
		for initiator in ${OCF_RESKEY_allowed_initiators}; do
			ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/acls create ${initiator} add_mapped_luns=False || exit $OCF_ERR_GENERIC
			ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/acls/${initiator} create ${OCF_RESKEY_lun} ${OCF_RESKEY_lun} || exit $OCF_ERR_GENERIC
		done
	fi
;;

it looks like I’m only permitted to create a block backstore. Critically missing, in this scenario, is the ability to create fileio backstores on things like mounted filesystems abstracted by things like drbd. Additionally (and this is just a failing on my part), I’m unclear as to where the resource agent is fed the value for “${OCF_RESOURCE_INSTANCE}” given the limited number of parameters one is permitted to supply with “pcs resource create…”

Can anyone provide any insight please? Thank you in advance!


--
 
[ jR ]
  @: jason at eramsey.org
 
  there is no path to greatness; greatness is the path



More information about the Users mailing list