ClusterLabs / ClusterLabs/resource-agents

lio backstore block vs iblock

Open
#834 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
519
Forks
608
Avg merge
6d 1h
Merged PRs (30d)
7

Description

Hi,

I'm not sure if this is a problem with incompatible changes between targetcli versions, but I always got a Traceback
`ERROR: Traceback (most recent call last): File "/usr/bin/targetcli", line 89, in main() File "/usr/bin/targetcli", line 78, in main shell.run_cmdline(" ".join(sys.argv[1:])) File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line 934, in run_cmdline self._execute_command(path, command, pparams, kparams) File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line 899, in _execute_command self.log.error(msg) File "/usr/lib/python2.7/dist-packages/configshell/log.py", line 159, in error self._log('error', msg) File "/usr/lib/python2.7/dist-packages/configshell/log.py", line 112, in _log self.con.display(msg) File "/usr/lib/python2.7/dist-packages/configshell/console.py", line 153, in display self.raw_write(text) File "/usr/lib/python2.7/dist-packages/configshell/console.py", line 141, in raw_write self._stdout.write(text) TypeError: expected a string or other character buffer object`

and after some debugging found out the problem is `targetcli /backstores/block create` vs `targetcli /backstores/iblock create`, and after applying the following diff everything worked fine:

```
--- iSCSILogicalUnit.orig 2016-07-11 15:43:33.324955524 +0000
+++ iSCSILogicalUnit 2016-07-11 15:43:40.884842482 +0000
@@ -362,11 +362,11 @@
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
+ ocf_run targetcli /backstores/iblock 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
+ ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/luns create /backstores/iblock/${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
@@ -444,7 +444,7 @@
# delete the backstore, then something is seriously
# wrong and we need to fail the stop operation
# (potentially causing fencing)
- ocf_run targetcli /backstores/block delete ${OCF_RESOURCE_INSTANCE} || exit $OCF_ERR_GENERIC
+ ocf_run targetcli /backstores/iblock delete ${OCF_RESOURCE_INSTANCE} || exit $OCF_ERR_GENERIC
;;
esac
```

versions:

```
root@hase01b:~# uname -a
Linux hase01b 4.6.0-1-amd64 #1 SMP Debian 4.6.2-2 (2016-06-25) x86_64 GNU/Linux
root@hase01b:~# targetcli version
Using configshell version 1.6.1~g020d540
Using rtslib version 3.0.pre4.1~g1b33ceb
Using targetcli version 3.0.pre4.1~ga55d018
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the iSCSILogicalUnit resource agent and inspect the lio-t branch around the targetcli backstore create, LUN create, and delete commands. Compare those commands with the reported targetcli versions and verify that the iblock paths work consistently; done means the agent no longer triggers the reported traceback during create or cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.