[Pkg-xen-devel] Bug#691808: xcp-storage-managers: Another wrong binary path + wrong parameter in storage managers backend
Leonardo Bruno Lopes
leobruno at gmail.com
Tue Oct 30 01:39:31 UTC 2012
Package: xcp-storage-managers
Version: 0.1.1-2
Severity: important
I still am not able to create iSCSI storage repositories using this command
xe sr-create host-uuid=<my-host-uuid> content-type=user name-label="LVM over iSCSI SR"> shared=true device-config:target=192.168.10.100 device-config:targetIQN=<here-target-iqn> device-config:SCSIid=<my-scsi-id> type=lvhdoiscsi
The corrections in bugs reports #691805 and #691806 seems to solve not all problems. Now I get this error message on STDOUT:
Error code: SR_BACKEND_FAILURE_202
Error parameters: , General backend error [opterr=rc: 21, stdout: , stderr: iscsiadm: No active sessions.
],
Log messages in syslog and in /var/log/SMlog did not helped. So I passed to analyze the Python scripts in the /usr/lib/xcp/sm/ directory and found the following problems and the respective possible solutions:
1. In /usr/lib/xcp/sm/lvutil.py there are two calls (lines 302 and 344) to 'vgchange' with the unknown parameter '--master'. I simply removed the strange parameter and the line 302 became
cmd = [CMD_VGCHANGE, "-an", "", vgname]
Line 345 became:
cmd = [CMD_VGCHANGE, "-a" + val, "", path]
2. Second problem. Line 86 in /usr/lib/xcp/sm/scsiutil.py calls the 'scsi_id' binary but it is not in the system path. According to Debian manpage, "scsi_id is primarily for use by other utilities such as udev that require a unique SCSI identifier." It is located in /lib/udev directory and uses a different set of parameters. Again, according to the manpages, the command on line 86 should be
cmd = ["/lib/udev/scsi_id", "--whitelisted", "--device=/dev/%s" % dev]
These changes caused different messages to appear in /var/log/SMlog logfile, even the command still do not work. Take a look:
[4168] 2012-10-29 23:25:50.145457 Setting LVM_DEVICE to /dev/disk/by-scsid/1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027
[4168] 2012-10-29 23:25:50.150610 Setting LVM_DEVICE to /dev/disk/by-scsid/1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027
[4168] 2012-10-29 23:25:50.192240 lock: acquired /var/lock/sm/iscsiadm/running
[4168] 2012-10-29 23:25:50.217735 lock: released /var/lock/sm/iscsiadm/running
[4168] 2012-10-29 23:25:50.252525 Raising exception [202, General backend error [opterr=rc: 21, stdout: , stderr: iscsiadm: No active sessions.
]]
[4168] 2012-10-29 23:25:50.252936 ['ls', '/sys/class/scsi_host', '-1', '--color=never']
[4168] 2012-10-29 23:25:50.272770 SUCCESS
[4168] 2012-10-29 23:25:50.273471 []
[4168] 2012-10-29 23:25:50.273993 PATHDICT: key 192.168.10.100:3260: {'path': '/dev/iscsi/iqn.2012-10.localdomain.storage:lun0/192.168.10.100:3260', 'ipaddr': '192.168.10.100', 'port': 3260}
[4168] 2012-10-29 23:25:50.278164 lock: closed /var/lock/sm/iscsiadm/running
[4168] 2012-10-29 23:25:50.285797 lock: creating lock file /var/lock/sm/4bc38254-5e28-4cb6-4566-067fd46ab0b2/sr
[4168] 2012-10-29 23:25:50.286136 LVMCache created for VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2
[4168] 2012-10-29 23:25:50.295899 ['/sbin/vgs', 'VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2']
[4168] 2012-10-29 23:25:50.434364 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2" not found
'
[4168] 2012-10-29 23:25:50.444184 LVMCache: will initialize now
[4168] 2012-10-29 23:25:50.444388 LVMCache: refreshing
[4168] 2012-10-29 23:25:50.444548 ['/sbin/lvs', '--noheadings', '--units', 'b', '-o', '+lv_tags', '/dev/VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2']
[4168] 2012-10-29 23:25:50.507808 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2" not found
Skipping volume group VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2
'
[4168] 2012-10-29 23:25:50.513466 lock: closed /var/lock/sm/4bc38254-5e28-4cb6-4566-067fd46ab0b2/sr
[4168] 2012-10-29 23:25:50.519660 LVMCache created for VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2
[4168] 2012-10-29 23:25:50.531273 ['/sbin/vgs', 'VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2']
[4168] 2012-10-29 23:25:50.578752 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2" not found
'
[4168] 2012-10-29 23:25:50.579953 LVMCache: will initialize now
[4168] 2012-10-29 23:25:50.580127 LVMCache: refreshing
[4168] 2012-10-29 23:25:50.580307 ['/sbin/lvs', '--noheadings', '--units', 'b', '-o', '+lv_tags', '/dev/VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2']
[4168] 2012-10-29 23:25:50.629465 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2" not found
Skipping volume group VG_XenStorage-4bc38254-5e28-4cb6-4566-067fd46ab0b2
'
[4168] 2012-10-29 23:25:50.630480 lock: acquired /var/lock/sm/4bc38254-5e28-4cb6-4566-067fd46ab0b2/sr
[4168] 2012-10-29 23:25:50.630985 sr_create {'sr_uuid': '4bc38254-5e28-4cb6-4566-067fd46ab0b2', 'subtask_of': 'OpaqueRef:62e29547-d256-c4cf-075b-e6ace56c376e', 'args': ['0'], 'host_ref': 'OpaqueRef:60a02436-b01f-5b24-3b97-d2244a276a56', 'session_ref': 'OpaqueRef:56db5a70-051c-db50-672f-15c47d0221be', 'device_config': {'device': '/dev/disk/by-id/scsi-1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027', 'SCSIid': '1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027', 'targetIQN': 'iqn.2012-10.localdomain.storage:lun0', 'SRmaster': 'true', 'target': '192.168.10.100'}, 'command': 'sr_create', 'sr_ref': 'OpaqueRef:58b991dd-c1c4-5409-9bb8-e21e0e4ee192'}
[4168] 2012-10-29 23:25:50.653177 _testHost: Testing host/port: 192.168.10.100,3260
[4168] 2012-10-29 23:25:50.707646 lock: acquired /var/lock/sm/iscsiadm/running
[4168] 2012-10-29 23:25:50.731869 lock: released /var/lock/sm/iscsiadm/running
[4168] 2012-10-29 23:25:50.758093 Raising exception [202, General backend error [opterr=rc: 21, stdout: , stderr: iscsiadm: No active sessions.
]]
[4168] 2012-10-29 23:25:50.758535 lock: released /var/lock/sm/4bc38254-5e28-4cb6-4566-067fd46ab0b2/sr
[4168] 2012-10-29 23:25:50.763597 ***** sr_create: EXCEPTION <class 'SR.SROSError'>, General backend error [opterr=rc: 21, stdout: , stderr: iscsiadm: No active sessions.
]
File "/usr/lib/xcp/sm/SRCommand.py", line 94, in run
return self._run_locked(sr)
File "/usr/lib/xcp/sm/SRCommand.py", line 131, in _run_locked
return self._run(sr, target)
File "/usr/lib/xcp/sm/SRCommand.py", line 214, in _run
return sr.create(self.params['sr_uuid'], long(self.params['args'][0]))
File "/usr/lib/xcp/sm/LVHDoISCSISR", line 235, in create
self.iscsi.attach(sr_uuid)
File "/usr/lib/xcp/sm/ISCSISR.py", line 277, in attach
if not iscsilib._checkTGT(self.targetIQN):
File "/usr/lib/xcp/sm/iscsilib.py", line 284, in _checkTGT
(stdout,stderr) = exn_on_failure(cmd, failuremessage)
File "/usr/lib/xcp/sm/iscsilib.py", line 37, in exn_on_failure
raise xs_errors.XenError('SMGeneral', opterr=msg)
File "/usr/lib/xcp/sm/xs_errors.py", line 49, in __init__
raise SR.SROSError(errorcode, errormessage)
[4168] 2012-10-29 23:25:50.767313 lock: closed /var/lock/sm/iscsiadm/running
[4168] 2012-10-29 23:25:50.769949 lock: closed /var/lock/sm/4bc38254-5e28-4cb6-4566-067fd46ab0b2/sr
If I connect manually the iSCSI target using 'iscsiadm' commands before try the 'xe sr-create' command, the log messages are a bit different:
[4208] 2012-10-29 23:28:09.678795 Setting LVM_DEVICE to /dev/disk/by-scsid/1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027
[4208] 2012-10-29 23:28:09.683936 Setting LVM_DEVICE to /dev/disk/by-scsid/1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027
[4208] 2012-10-29 23:28:09.718951 lock: acquired /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:09.753507 lock: released /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:09.753737 lock: closed /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:09.756613 ['ls', '/sys/class/scsi_host', '-1', '--color=never']
[4208] 2012-10-29 23:28:09.772590 SUCCESS
[4208] 2012-10-29 23:28:09.773284 ['5']
[4208] 2012-10-29 23:28:09.775673 PATHDICT: key 192.168.10.100:3260: {'path': '/dev/iscsi/iqn.2012-10.localdomain.storage:lun0/192.168.10.100:3260', 'ipaddr': '192.168.10.100', 'port': 3260}
[4208] 2012-10-29 23:28:09.785015 lock: creating lock file /var/lock/sm/485b2590-2b6d-0011-1dfa-fb7cf97abe9a/sr
[4208] 2012-10-29 23:28:09.786288 LVMCache created for VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a
[4208] 2012-10-29 23:28:09.794802 ['/sbin/vgs', 'VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:09.860811 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" not found
'
[4208] 2012-10-29 23:28:09.864390 LVMCache: will initialize now
[4208] 2012-10-29 23:28:09.864666 LVMCache: refreshing
[4208] 2012-10-29 23:28:09.864965 ['/sbin/lvs', '--noheadings', '--units', 'b', '-o', '+lv_tags', '/dev/VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:09.939458 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" not found
Skipping volume group VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a
'
[4208] 2012-10-29 23:28:09.945844 lock: closed /var/lock/sm/485b2590-2b6d-0011-1dfa-fb7cf97abe9a/sr
[4208] 2012-10-29 23:28:09.946149 LVMCache created for VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a
[4208] 2012-10-29 23:28:09.962947 ['/sbin/vgs', 'VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:10.005420 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" not found
'
[4208] 2012-10-29 23:28:10.007798 LVMCache: will initialize now
[4208] 2012-10-29 23:28:10.007798 LVMCache: refreshing
[4208] 2012-10-29 23:28:10.007798 ['/sbin/lvs', '--noheadings', '--units', 'b', '-o', '+lv_tags', '/dev/VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:10.057572 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" not found
Skipping volume group VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a
'
[4208] 2012-10-29 23:28:10.060183 lock: acquired /var/lock/sm/485b2590-2b6d-0011-1dfa-fb7cf97abe9a/sr
[4208] 2012-10-29 23:28:10.060363 sr_create {'sr_uuid': '485b2590-2b6d-0011-1dfa-fb7cf97abe9a', 'subtask_of': 'OpaqueRef:bbffc9eb-cd22-5432-038d-0b9c95a4cb4b', 'args': ['0'], 'host_ref': 'OpaqueRef:60a02436-b01f-5b24-3b97-d2244a276a56', 'session_ref': 'OpaqueRef:058c62ea-65bc-07db-8937-e36d8af4b1f6', 'device_config': {'device': '/dev/disk/by-id/scsi-1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027', 'SCSIid': '1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027', 'targetIQN': 'iqn.2012-10.localdomain.storage:lun0', 'SRmaster': 'true', 'target': '192.168.10.100'}, 'command': 'sr_create', 'sr_ref': 'OpaqueRef:271be512-31fe-8b6c-389c-45f848677c88'}
[4208] 2012-10-29 23:28:10.076398 ['ls', '/sys/class/scsi_host', '-1', '--color=never']
[4208] 2012-10-29 23:28:10.099337 SUCCESS
[4208] 2012-10-29 23:28:10.102072 ['5']
[4208] 2012-10-29 23:28:10.102926 PATHDICT: key 192.168.10.100:3260: {'path': '/dev/iscsi/iqn.2012-10.localdomain.storage:lun0/192.168.10.100:3260', 'ipaddr': '192.168.10.100', 'port': 3260}
[4208] 2012-10-29 23:28:10.113373 lock: released /var/lock/sm/485b2590-2b6d-0011-1dfa-fb7cf97abe9a/sr
[4208] 2012-10-29 23:28:10.117213 lock: closed /var/lock/sm/485b2590-2b6d-0011-1dfa-fb7cf97abe9a/sr
[4208] 2012-10-29 23:28:10.118392 LVMCache created for VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a
[4208] 2012-10-29 23:28:10.125216 ['/sbin/vgs', 'VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:10.171685 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" not found
'
[4208] 2012-10-29 23:28:10.174923 LVMCache: will initialize now
[4208] 2012-10-29 23:28:10.174923 LVMCache: refreshing
[4208] 2012-10-29 23:28:10.174923 ['/sbin/lvs', '--noheadings', '--units', 'b', '-o', '+lv_tags', '/dev/VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:10.230728 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" not found
Skipping volume group VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a
'
[4208] 2012-10-29 23:28:10.235755 LVHDSR.create for 485b2590-2b6d-0011-1dfa-fb7cf97abe9a
[4208] 2012-10-29 23:28:10.235755 ['/sbin/vgs', 'VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:10.289540 FAILED: (rc 5) stdout: '', stderr: ' Volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" not found
'
[4208] 2012-10-29 23:28:10.314861 ['sginfo', '-s', '/dev/sdb']
[4208] 2012-10-29 23:28:10.338760 SUCCESS
[4208] 2012-10-29 23:28:10.341913 ['/lib/udev/scsi_id', '--whitelisted', '--device=/dev/sdb']
[4208] 2012-10-29 23:28:10.368309 SUCCESS
[4208] 2012-10-29 23:28:10.384777 ['/bin/dd', 'if=/dev/zero', 'of=/dev/disk/by-id/scsi-1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027', 'bs=1M', 'count=100', 'oflag=direct']
[4208] 2012-10-29 23:28:15.201908 SUCCESS
[4208] 2012-10-29 23:28:15.211984 ['/sbin/pvcreate', '--metadatasize', '10M', '/dev/disk/by-id/scsi-1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027']
[4208] 2012-10-29 23:28:15.285253 SUCCESS
[4208] 2012-10-29 23:28:15.285505 ['/sbin/vgcreate', 'VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a', '/dev/disk/by-id/scsi-1494554000000000031f4d7f7ba60cab0e5a94fd0c894f027']
[4208] 2012-10-29 23:28:15.412608 SUCCESS
[4208] 2012-10-29 23:28:15.413151 ['/sbin/vgchange', '-an', '', 'VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a']
[4208] 2012-10-29 23:28:15.462141 FAILED: (rc 5) stdout: ' 0 logical volume(s) in volume group "VG_XenStorage-485b2590-2b6d-0011-1dfa-fb7cf97abe9a" now active
', stderr: ' Volume group name has invalid characters
'
[4208] 2012-10-29 23:28:15.501187 Raising exception [53, Logical Volume unmount/deactivate error [opterr=errno is 5]]
[4208] 2012-10-29 23:28:15.534998 lock: acquired /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:15.560576 lock: released /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:15.560981 lock: closed /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:15.562333 lock: acquired /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:16.110564 lock: released /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:16.111121 lock: closed /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:16.137654 lock: acquired /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:16.168949 lock: released /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:16.193481 Raising exception [202, General backend error [opterr=rc: 21, stdout: , stderr: iscsiadm: No active sessions.
]]
[4208] 2012-10-29 23:28:16.194638 lock: released /var/lock/sm/485b2590-2b6d-0011-1dfa-fb7cf97abe9a/sr
[4208] 2012-10-29 23:28:16.196964 ***** sr_create: EXCEPTION <class 'SR.SROSError'>, General backend error [opterr=rc: 21, stdout: , stderr: iscsiadm: No active sessions.
]
File "/usr/lib/xcp/sm/SRCommand.py", line 94, in run
return self._run_locked(sr)
File "/usr/lib/xcp/sm/SRCommand.py", line 131, in _run_locked
return self._run(sr, target)
File "/usr/lib/xcp/sm/SRCommand.py", line 214, in _run
return sr.create(self.params['sr_uuid'], long(self.params['args'][0]))
File "/usr/lib/xcp/sm/LVHDoISCSISR", line 279, in create
self.iscsi.detach(sr_uuid)
File "/usr/lib/xcp/sm/ISCSISR.py", line 377, in detach
if iscsilib._checkTGT(self.targetIQN):
File "/usr/lib/xcp/sm/iscsilib.py", line 284, in _checkTGT
(stdout,stderr) = exn_on_failure(cmd, failuremessage)
File "/usr/lib/xcp/sm/iscsilib.py", line 37, in exn_on_failure
raise xs_errors.XenError('SMGeneral', opterr=msg)
File "/usr/lib/xcp/sm/xs_errors.py", line 49, in __init__
raise SR.SROSError(errorcode, errormessage)
[4208] 2012-10-29 23:28:16.197828 lock: closed /var/lock/sm/iscsiadm/running
[4208] 2012-10-29 23:28:16.199091 lock: closed /var/lock/sm/485b2590-2b6d-0011-1dfa-fb7cf97abe9a/sr
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages xcp-storage-managers depends on:
ii blktap-utils 2.0.90-1
ii libc6 2.13-35
ii libxenstore3.0 4.1.3-2
ii python 2.7.3~rc2-1
ii python2.7 2.7.3~rc2-2.1
ii uuid-runtime 2.20.1-5.2
Versions of packages xcp-storage-managers recommends:
ii lvm2 2.02.95-4
ii nfs-common 1:1.2.6-3
xcp-storage-managers suggests no packages.
-- no debconf information
More information about the Pkg-xen-devel
mailing list