Chinaunix

标题: 关于KVM在NFS环境下运行的问题 [打印本页]

作者: cardss    时间: 2010-12-02 23:39
标题: 关于KVM在NFS环境下运行的问题
我把NFS服务器的/vps挂载到KVM主机的/mnt上,mnt目录我已经设成了777了,但是使用virt-install 行创建虚拟机,出现这样的错误:
大侠们,能告诉是什么原因造成的吗,如果有这方面经验,可不可发一份配置我看看
[root@kvm002 mnt]#  virt-install
ERROR    A name is required for the virtual machine. (use --prompt to run interactively)
[root@kvm002 mnt]#  virt-install  --prompt
What is the name of your virtual machine? 116.254.191.19
How much RAM should be allocated (in megabytes)? 2048
What would you like to use as the disk (file path)? /mnt/116.254.191.19.s
How large would you like the disk (/mnt/116.254.191.19.s) to be (in gigabytes)? 10
  What is the install CD-ROM/ISO or URL? /vps/isos/win2003sp2.iso


Starting install...
Allocating '116.254.191.19.s'                                                                                |  10 GB     00:00     
ERROR    internal error process exited while connecting to monitor: char device redirected to /dev/pts/5
qemu: could not open disk image /mnt/116.254.191.19.s: Permission denied

Domain installation does not appear to have been
successful.  If it was, you can restart your domain
by running 'virsh start 116.254.191.19'; otherwise, please
restart your installation.
ERROR    internal error process exited while connecting to monitor: char device redirected to /dev/pts/5
qemu: could not open disk image /mnt/116.254.191.19.img: Permission denied
Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 1054, in <module>
    main()
  File "/usr/sbin/virt-install", line 936, in main
    start_time, guest.start_install)
  File "/usr/sbin/virt-install", line 978, in do_install
    dom = install_func(conscb, progresscb, wait=(not wait))
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 973, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1038, in _do_install
    "install")
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 1009, in _create_guest
    dom = self.conn.createLinux(start_xml, 0)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1270, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error process exited while connecting to monitor: char device redirected to /dev/pts/5
qemu: could not open disk image /mnt/116.254.191.19.img: Permission denied

/mnt
作者: cst05001    时间: 2010-12-03 11:50
selinux策略默认禁止kvm使用nfs资源。我初步推测你的问题是由此导致。
1)
# setenforce 0
2)
编辑 /etc/selinux/config
把 SELINUX=enforcing 改为 SELINUX=disabled
3)
确认 /mnt/116.254.191.19.s 是否存在。请给出ls输出
4)
重试安装
作者: cardss    时间: 2010-12-04 01:42
感谢版本,的确是这个问题,困扰我挺久拉
作者: ttvast    时间: 2010-12-14 18:41
还有一种可能,
禁用nfsv4
作者: crafic    时间: 2013-05-21 20:10
I met a similar problem when installing a virtual machine in SUSE12.3 by using interfacial QEMU-KVM, but I could not find a /etc/selinux/config to solve this permission-denied-problem. So I switched to installing it  in console expecting to find an easy way to change authorities, accidentally, the problem never show up. Could anybody tell me what happened?
作者: lanni654321    时间: 2014-07-23 17:26
提示: 作者被禁止或删除 内容自动屏蔽




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2