目录
VolumeDeviceNotFound
实例Hard Reboot后,出现VolumeDeviceNotFound的错误。
查看计算节点上,nova-compute的日志。
1 | nova.compute.manager [req-1c2e36df-c5ff-49aa-9893-6046cd0cbfeb b29311c34edb4f179092e81cbee10682 8e4be2cb25084defb5a9f0128afd5291 - default default] [instance: d17a8b0f-759c-4f54-b265-64fc16986710] Cannot reboot instance: Volume device not found at .: os_brick.exception.VolumeDeviceNotFound: Volume device not found at . |
解决方法
确定实例挂载卷的ID。
1
2
3
4
5
6
7openstack server show d17a8b0f-759c-4f54-b265-64fc16986710 -c volumes_attached
+------------------+-------------------------------------------+
| Field | Value |
+------------------+-------------------------------------------+
| volumes_attached | id='f870fcdb-209c-4877-8de4-1b7683b98548' |
+------------------+-------------------------------------------+存储节点查看对应的物理设备是否被创建。
1
2
3
4# f870fcdb-209c-4877-8de4-1b7683b98548是volume的ID。
lsblk | grep f870fcdb--209c--4877--8de4--1b7683b98548
├─cinder--volumes-volume--f870fcdb--209c--4877--8de4--1b7683b98548 252:101 0 150G 0 lvm
├─cinder--volumes-volume--f870fcdb--209c--4877--8de4--1b7683b98548 252:101 0 150G 0 lvm卷对应物理设备就是。
1
ls /dev/cinder-volumes/volume-f870fcdb-209c-4877-8de4-1b7683b98548
在存储节点上查看iSCSI资源。
1
targetcli ls
得到下面的结果。
1
2
3
4
5
6
7
8| o- iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548 ... [TPGs: 1]
| | o- tpg1 ................................................ [no-gen-acls, auth per-acl]
| | o- acls ................................................................ [ACLs: 1]
| | | o- iqn.2020-08.org.openanolis:8a5ea81155a ......... [1-way auth, Mapped LUNs: 0]
| | o- luns ................................................................ [LUNs: 0]
| | o- portals .......................................................... [Portals: 1]
| | o- 10.10.15.14:3260 ....................................................... [OK]从上面的结果可以看到acls(ACL,Access Control Lists,访问控制列表)是正常的,但luns(LUN,Logical Unit Number,逻辑单元号)中没有数据。
新建backstores
1
2
3
4targetcli \
/backstores/block create \
name=iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548 \
dev=/dev/cinder-volumes/volume-f870fcdb-209c-4877-8de4-1b7683b98548新建lun
1
2
3
4targetcli \
/iscsi/iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548/tpg1/luns \
create \
/backstores/block/iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548也可以使用cinder-rtstool,更加方便。
1
cinder-rtstool create /backstores/block/iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548
再次查看,已经正常。
1
2
3
4
5
6
7
8
9| o- iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548 ............................... [TPGs: 1]
| | o- tpg1 ............................................................................ [no-gen-acls, auth per-acl]
| | o- acls ............................................................................................ [ACLs: 1]
| | | o- iqn.2020-08.org.openanolis:8a5ea81155a ..................................... [1-way auth, Mapped LUNs: 1]
| | | o- mapped_lun0 ... [lun0 block/iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548 (rw)]
| | o- luns ............................................................................................ [LUNs: 1]
| | | o- lun0 [block/iqn.2010-10.org.openstack:volume-f870fcdb-209c-4877-8de4-1b7683b98548 (/dev/cinder-volumes/volume-f870fcdb-209c-4877-8de4-1b7683b98548) (default_tg_pt_gp)]
| | o- portals ...................................................................................... [Portals: 1]
| | o- 10.10.15.14:3260 ................................................................................... [OK]最后重启实例。
1
openstack server reboot --hard ce979e29-198d-498b-b2e3-c0cab6c82c98
简单脚本
1 | volume=$1 |
iSCSI Login negotiation failed
volume删除后,存储节点的日志里依旧会报错。
1 | Jan 17 10:14:22 compute3 kernel: Unable to locate Target IQN: iqn.2010-10.org.openstack:volume-c6774132-65f2-47a0-a65b-9a5d06a4accb in Storage Node |
解决方法
到各个节点中执行iscsiadm命令,查看是否存在相应的session。
1 | [root@compute2 ~] iscsiadm -m session -P 3 | grep c6774132 |
1 | set -x -e |
1 | iscsiadm -m discovery -t sendtargets -p 10.10.15.14 |
编辑/var/lib/iscsi/nodes/iqn.2010-10.org.openstack:volume-9ef6d658-104a-4b59-9c20-3046dd8dfc9a/10.10.15.14,3260,1/default
1 | node.session.auth.authmethod = CHAP |
1 | systemctl restart iscsi.service |