I'm trying to create an ext based storage repository:

xe sr-create content-type="local SR" \
   host-uuid=c7030a1f-15e3-7e7d-2932-b30200a15917 type=ext \
   device-config-device=/dev/sdb1 \
   shared=false name-label="Local File SR"

Results in:

There was an SR backend failure.
status: non-zero exit
stderr: Traceback (most recent call last):
  File "/usr/lib/xcp/sm/EXTSR", line 320, in <module>
    SRCommand.run(EXTSR, DRIVER_INFO)
  File "/usr/lib/xcp/sm/SRCommand.py", line 263, in run
    ret = cmd.run(sr)
  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/EXTSR", line 225, in create
  File "/usr/lib/xcp/sm/util.py", line 177, in pread2
    return pread(cmdlist, quiet = quiet)
  File "/usr/lib/xcp/sm/util.py", line 164, in pread
    (rc,stdout,stderr) = doexec(cmdlist_for_exec)
  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=Tru
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Editing util.py

vi /usr/lib/xcp/sm/util.py

and adding a print debug output statement:

def doexec(args, inputtext=None):
    """Execute a subprocess, then return its return code, stdout and stderr"""
    print ', '.join(args)  #  Added print statement for debugging
    proc = subprocess.Popen(args,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE,close_fds=True)
    (stdout,stderr) = proc.communicate(inputtext)
    rc = proc.returncode
    return (rc,stdout,stderr)

returned this output when running the sr-create command:

stdout: sginfo, -s, /dev/sdb1
/lib/udev/scsi_id, -g, -s, /block/sdb
/sbin/vgs, XSLocalEXT-0cee01cd-3f10-9c28-8a0f-dec270e7f37a
dd, if=/dev/zero, of=/dev/sdb1, bs=1M, count=100, oflag=direct
/sbin/pvs, /dev/sdb1
pvcreate, --metadatasize, 10M, /dev/sdb1
vgcreate, XSLocalEXT-0cee01cd-3f10-9c28-8a0f-dec270e7f37a, /dev/sdb1
/sbin/lvdisplay, /dev/XSLocalEXT-0cee01cd-3f10-9c28-8a0f-dec270e7f37a/0cee01cd-3f10-9c28-8a0f-dec270e7f37a
/sbin/vgs, --noheadings, --nosuffix, --units, b, XSLocalEXT-0cee01cd-3f10-9c28-8a0f-dec270e7f37a
lvcreate, -n, 0cee01cd-3f10-9c28-8a0f-dec270e7f37a, -L, 1012, XSLocalEXT-0cee01cd-3f10-9c28-8a0f-dec270e7f37a
lvchange, -ay, /dev/XSLocalEXT-0cee01cd-3f10-9c28-8a0f-dec270e7f37a/0cee01cd-3f10-9c28-8a0f-dec270e7f37a
mkfs.ext3, -F, /dev/XSLocalEXT-0cee01cd-3f10-9c28-8a0f-dec270e7f37a/0cee01cd-3f10-9c28-8a0f-dec270e7f37a
/lib/udev/scsi_id, -g, -s, /block/sdb

From this I could see that lvm tools are being used by sr-create.

Problem Solved

These tools were missing on my system. Installing apt-get install lvm2 resolved the issue for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.