Bug#691808: xcp-storage-managers: Another wrong binary path + wrong parameter in storage managers backend

2012-10-29 Thread Leonardo Bruno Lopes
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= content-type=user name-label="LVM over 
iSCSI SR"> shared=true device-config:target=192.168.10.100 
device-config:targetIQN= device-config:SCSIid= 
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/14945540031f4d7f7ba60cab0e5a94fd0c894f027
[4168] 2012-10-29 23:25:50.150610   Setting LVM_DEVICE to 
/dev/disk/by-scsid/14945540031f4d7f7ba60cab0e5a94fd0c894f027
[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-

Bug#691806: xcp-storage-managers: Missing dependency

2012-10-29 Thread Leonardo Bruno Lopes
Package: xcp-storage-managers
Version: 0.1.1-2
Severity: important


The xcp-storage-managers seems to depends on sg3-utils package which contains 
the 'sginfo' (/usr/bin/sginfo)  binary called by /usr/lib/xcp/sm/scsiutil.py  
script twice (lines 105 and 107).

A simple 'apt-get install sg3-utils' solved this issue so I believe that 
xcp-storage-managers dependency list needs to include the sg3-utils package.


--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-utils2.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-runtime2.20.1-5.2

Versions of packages xcp-storage-managers recommends:
ii  lvm22.02.95-4
ii  nfs-common  1:1.2.6-3

xcp-storage-managers suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#691805: xcp-storage-managers: Wrong path in iSCSI storage driver script

2012-10-29 Thread Leonardo Bruno Lopes
Package: xcp-storage-managers
Version: 0.1.1-2
Severity: important

Dear Maintainer,

I can not create an iSCSI storage resource using the following command:

xe sr-create host-uuid= content-type=user name-label="LVM over 
iSCSI SR"> shared=true device-config:target=192.168.10.100 
device-config:targetIQN= device-config:SCSIid= 
type=lvhdoiscsi

(Note that I created a symlink 
  ln -s /usr/lib/xcp/sm/LVHDoISCSISR.py /usr/lib/xcp/sm/LVHDoISCSISR
so the driver 'lvhdoiscsi' could be recognised.)

This command should print the UUID of the new SR in STDOUT if it has created 
the SR successfully, but It failed with these messages, among others:

There was an SR backend failure.
status: non-zero exit
stdout: 
stderr: Traceback (most recent call last):
  File "/usr/lib/xcp/sm/LVHDoISCSISR", line 384, in 
SRCommand.run(LVHDoISCSISR, DRIVER_INFO)
  File "/usr/lib/xcp/sm/SRCommand.py", line 261, in run
sr = driver(cmd, cmd.sr_uuid)
  File "/usr/lib/xcp/sm/SR.py", line 136, in __init__
self.load(sr_uuid)
  File "/usr/lib/xcp/sm/LVHDoISCSISR", line 153, in load
self._LUNprint(sr_uuid)
  File "/usr/lib/xcp/sm/LVHDoISCSISR", line 183, in _LUNprint
self.iscsi.attach(sr_uuid)
  File "/usr/lib/xcp/sm/ISCSISR.py", line 274, in attach
iscsilib.ensure_daemon_running_ok(self.localIQN)
  File "/usr/lib/xcp/sm/iscsilib.py", line 315, in ensure_daemon_running_ok
if not is_iscsi_daemon_running():
File "/usr/lib/xcp/sm/iscsilib.py", line 198, in is_iscsi_daemon_running
(rc,stdout,stderr) = util.doexec(cmd)
  File "/usr/lib/xcp/sm/util.py", line 129, in doexec
proc = 
subprocess.Popen(args,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE,close_fds=True)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory


So I figured out that the SR creator script was trying to execute some binary 
using a wrongpath.

Comparing the /usr/lib/xcp/sm/iscsilib.py script from the xcp-storage-managers 
Debian package with its equivalent script shipped with XCP CentOS-based distro 
I could confirm that they are the same.

What I did was to alter line 198 of the /usr/lib/xcp/sm/iscsilib.py file from 
  cmd = ["/sbin/pidof", "-s", "/sbin/iscsid"]
to
  cmd = ["/bin/pidof", "-s", "/usr/sbin/iscsid"]
to reflect the actual path of the 'iscsid' binary in Debian.

However, I think it's more 'debianistic' to get this path each time the script 
runs (something like 'which iscsid') or make it configurable by some variable 
or config file.

Thanks in advance!


-- 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-utils2.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-runtime2.20.1-5.2

Versions of packages xcp-storage-managers recommends:
ii  lvm22.02.95-4
ii  nfs-common  1:1.2.6-3

xcp-storage-managers suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org