I'm trying to add a new SATA drive (SSD) as a local SR. XenServer may have seen the drive before, but I don't recall every doing anything with it. I'm attempting to run this command:

xe sr-create content-type=user device-config:device=/dev/disk/by-id/scsi-SATA_OCZ-VERTEX2_3.5OCZ-9G0363DTJ6JSCBJ1 name-label="Local Storage SSD 1" type=ext

A new SR appears in XenCenter for a split second (I don't have time to read what it says), then I receive an error:

The SR operation cannot be performed because a device underlying the SR is in use by the host.

Here's the log from /var/log/SMlog, minus the timestamps:

lock: creating lock file /var/lock/sm/20d58608-bebb-64a8-0cae-d3d36b3f2d7d/sr
lock: acquired /var/lock/sm/20d58608-bebb-64a8-0cae-d3d36b3f2d7d/sr
sr_create {'sr_uuid': '20d58608-bebb-64a8-0cae-d3d36b3f2d7d', 'subtask_of': 'DummyRef:|7f60f5ae-9a40-6550-f587-c28cbe4c4926|SR.create', 'args': ['0'], 'host_ref': 'OpaqueRef:3d304cee-dac2-2eb3-80d9-6e8a166c1135', 'session_ref': 'OpaqueRef:c5a8fc26-cec6-eeb9-09ed-f36604bdfc77', 'device_config': {'device': '/dev/disk/by-id/scsi-SATA_OCZ-VERTEX2_3.5OCZ-9G0363DTJ6JSCBJ1', 'SRmaster': 'true'}, 'command': 'sr_create', 'sr_ref': 'OpaqueRef:7dd401ca-b41d-b606-6612-3dd3919b0773', 'local_cache_sr': '16cbaddd-05db-11b9-d5f9-5933d3192243'}
['sginfo', '-s', '/dev/sdb']
  pread SUCCESS
['scsi_id', '-g', '-s', '/block/sdb']
  pread SUCCESS
['/usr/sbin/vgs', 'XSLocalEXT-20d58608-bebb-64a8-0cae-d3d36b3f2d7d']
FAILED in util.pread: (rc 5) stdout: '', stderr: '  Volume group "XSLocalEXT-20d58608-bebb-64a8-0cae-d3d36b3f2d7d" not found
Raising exception [16, The SR device is currently in use [opterr=Device /dev/disk/by-id/scsi-SATA_OCZ-VERTEX2_3.5OCZ-9G0363DTJ6JSCBJ1 in use, please check your existing SRs for an instance of this device]]
lock: released /var/lock/sm/20d58608-bebb-64a8-0cae-d3d36b3f2d7d/sr
***** generic exception: sr_create: EXCEPTION SR.SROSError, The SR device is currently in use [opterr=Device /dev/disk/by-id/scsi-SATA_OCZ-VERTEX2_3.5OCZ-9G0363DTJ6JSCBJ1 in use, please check your existing SRs for an instance of this device]
  File "/opt/xensource/sm/SRCommand.py", line 106, in run
    return self._run_locked(sr)
  File "/opt/xensource/sm/SRCommand.py", line 153, in _run_locked
    return self._run(sr, target)
  File "/opt/xensource/sm/SRCommand.py", line 278, in _run
    return sr.create(self.params['sr_uuid'], long(self.params['args'][0]))
  File "/opt/xensource/sm/EXTSR", line 188, in create
    lvutil.createVG(self.root, self.vgname)
  File "/opt/xensource/sm/lvutil.py", line 302, in createVG
    opterr=('Device %s in use, please check your existing ' \
  File "/opt/xensource/sm/xs_errors.py", line 49, in __init__
    raise SR.SROSError(errorcode, errormessage)

lock: closed /var/lock/sm/20d58608-bebb-64a8-0cae-d3d36b3f2d7d/sr


I did a fresh install of the latest XenServer release (6.2.0). The disk was not in the server during the installation. Thin provisioning (ext3) was used.

After the installation completed, I immediately added the disk and rebooted the server. I then ran the following command:

xe sr-create name-label='Local SSD 1' device-config:device=/dev/disk/by-id/scsi-SATA_OCZ-VERTEX2_3.5OCZ-9G0363DTJ6JSCBJ1 type=ext

This resulted in the same error.

  • How about the output from pvdisplay; vgdisplay; lvdisplay; xe pbd-list; xe sr-list; ls -al /dev/disk/by-id; mount – Steven K Dec 31 '13 at 22:13

Have you tried removing the SCSI id from mpathutil. See http://support.citrix.com/article/CTX122233 for instructions on how to perform this task.

  • Yeah, I did that; no luck. I even did a fresh install. – Zenexer Jan 4 '14 at 11:46

At this point, I'm just going to declare the SSD dead. It's not working with a fresh install. I know it was working previously, so it's probably not a driver issue. Time to go SSD shopping. If you're having a similar problem, test your drive in another machine.

Update (4 years later): Yes, the SSD was dead. Shortly after this answer, pretty much everything I plugged it into wouldn't even acknowledge that there was a device present. I should note that the error message seems very generic, so if you're coming here from a search engine, it's probably best not to assume that you're in the same situation that I was.

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.