我正在尝试将新的 SATA 驱动器 (SSD) 添加为本地 SR。XenServer 可能之前见过该驱动器,但我不记得曾经用它做过任何事情。我正在尝试运行以下命令:
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
一个新的 SR 在 XenCenter 中出现了一瞬间(我没有时间阅读它的内容),然后我收到一个错误:
The SR operation cannot be performed because a device underlying the SR is in use by the host.
以下是来自的日志/var/log/SMlog
,减去时间戳:
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
更新
我全新安装了最新的 XenServer 版本 (6.2.0)。安装期间磁盘不在服务器中。使用了精简配置 (ext3)。
安装完成后,我立即添加磁盘并重新启动服务器。然后我运行以下命令:
xe sr-create name-label='Local SSD 1' device-config:device=/dev/disk/by-id/scsi-SATA_OCZ-VERTEX2_3.5OCZ-9G0363DTJ6JSCBJ1 type=ext
这导致了同样的错误。
答案1
您是否尝试过从 mpathutil 中删除 SCSI ID。请参阅http://support.citrix.com/article/CTX122233了解有关如何执行此任务的说明。
答案2
此时,我要宣布 SSD 已死。全新安装后它无法正常工作。我知道它之前可以正常工作,所以可能不是驱动程序问题。是时候去购买 SSD 了。如果您遇到类似问题,请在另一台机器上测试您的驱动器。
更新(四年后):是的,SSD 坏了。在得到这个答案后不久,几乎所有我插入的东西都无法识别设备的存在。我应该指出,错误消息看起来很普通,所以如果你是从搜索引擎来到这里的,最好不要假设你的情况和我一样。