开启多台GuestOS提示无loop设备可用

1、今天在一台机器上clone了5台xen虚拟机,开启至第五台是系统报以下错误
[root@localhost ~]# virsh start CentOS5.6_vm05
error: Failed to start domain CentOS5.6_vm05
error: POST operation failed: xend_post: error from xen daemon: (xend.err 'Device 768 (vbd) could not be connected. Failed to find an unused loop device')

2、使用loseup命令查看发现目前使用了8个loop设备

[root@localhost ~]# losetup -a
/dev/loop0: [fd00]:543358981 (/data/vmware/CentOS/CentOS5.6_vm01.img)
/dev/loop1: [fd00]:543358980 (/data/CentOS-5.6-i386-bin-DVD.iso)
/dev/loop2: [fd00]:543358982 (/data/vmware/CentOS/CentOS5.6_vm02.img)
/dev/loop3: [fd00]:543358980 (/data/CentOS-5.6-i386-bin-DVD.iso)
/dev/loop4: [fd00]:543358980 (/data/CentOS-5.6-i386-bin-DVD.iso)
/dev/loop5: [fd00]:543358984 (/data/vmware/CentOS/CentOS5.6_vm03.img)
/dev/loop6: [fd00]:543358980 (/data/CentOS-5.6-i386-bin-DVD.iso)
/dev/loop7: [fd00]:543358986 (/data/vmware/CentOS/CentOS5.6_vm04.img)

3、系统中默认开启8个loop设备

[root@localhost ~]# ll /dev/loop*
brw-r----- 1 root disk 7, 0 Mar  8 10:36 /dev/loop0
brw-r----- 1 root disk 7, 1 Mar  8 10:36 /dev/loop1
brw-r----- 1 root disk 7, 2 Mar  8 10:36 /dev/loop2
brw-r----- 1 root disk 7, 3 Mar  8 10:36 /dev/loop3
brw-r----- 1 root disk 7, 4 Mar  8 10:36 /dev/loop4
brw-r----- 1 root disk 7, 5 Mar  8 10:36 /dev/loop5
brw-r----- 1 root disk 7, 6 Mar  8 10:36 /dev/loop6
brw-r----- 1 root disk 7, 7 Mar  8 10:36 /dev/loop7

4、编辑/etc/modprobe.conf 文件按需求增加loop设备数量

[root@localhost ~]# echo "options loop max_loop=64" >> /etc/modprobe.conf

5、重新加载loop模块

[root@localhost ~]# rmmod loop
ERROR: Module loop is in use

       直接卸载时提示loop模块正在使用,所以要先把GuestOS停掉才行

[root@localhost ~]# virsh shutdown CentOS5.6_vm01
Domain CentOS5.6_vm01 is being shutdown

[root@localhost ~]# virsh shutdown CentOS5.6_vm02
Domain CentOS5.6_vm02 is being shutdown

[root@localhost ~]# virsh shutdown CentOS5.6_vm03
Domain CentOS5.6_vm03 is being shutdown

[root@localhost ~]# virsh shutdown CentOS5.6_vm04
Domain CentOS5.6_vm04 is being shutdown

[root@localhost ~]# losetup -a
[root@localhost ~]# rmmod loop
[root@localhost ~]# modprobe loop
[root@localhost ~]# ll /dev/loop*

 发现已经有64个loop设备可以使用了(太多了,就不往上贴了)

至此开启多台GuestOS提示无loop设备可用问题解决完毕!:)

你可能感兴趣的:(OS,职场,loop,休闲,guestos)