2012-04-23 18:42:55 CRITICAL nova [-] Unable to allow access for disk path /dev/disk/by-path/ip-192.168.1.14:3260-iscsi-iqn.2010-10.org.openstack:volume-00000002-lun-1: No such file or directory
这会导致nova-conpute无法正常运行,造成错误的原因有2,一是设置了compute在启动的时候自动启动(自动恢复)instance状态;二是使用nova-volume后重启服务(此时compute会自动恢复instance状态),就会出现找不到volume的错误。
解决方案:
修改 /etc/nova.conf,注释两个选项:
#start_guests_on_host_boot = True
#resume_guests_state_on_host_boot =True
以后就手动启动instance比较稳定。
查看/dev/disk/by-path/下的文件
root@Controller:~# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Apr 23 21:17 pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Apr 23 21:17 pci-0000:00:1f.2-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Apr 23 21:17 pci-0000:00:1f.2-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Apr 23 21:17 pci-0000:00:1f.2-scsi-0:0:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Apr 23 21:17 pci-0000:00:1f.2-scsi-0:0:0:0-part6 -> ../../sda6
发现都是符号链接,执行:
root@Controller:~# tgtadm --lld iscsi --op show --mode target
Target 2: iqn.2010-10.org.openstack:volume-00000003
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00020000
SCSI SN: beaf20
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Readonly: No
Backing store type: null
Backing store path: None
Backing store flags:
LUN: 1
Type: disk
SCSI ID: IET 00020001
SCSI SN: beaf21
Size: 10737 MB, Block size: 512
Online: Yes
Removable media: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/nova-volumes/volume-00000003
找到相应确实的东西,手动在by-path下建立链接,重启nova-compute服务即可。