歡迎您光臨本站 註冊首頁

關於KVM在NFS環境下運行的問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

關於KVM在NFS環境下運行的問題

我把NFS伺服器的/vps掛載到KVM主機的/mnt上,mnt目錄我已經設成了777了,但是使用virt-install 行創建虛擬機,出現這樣的錯誤:
大俠們,能告訴是什麼原因造成的嗎,如果有這方面經驗,可不可發一份配置我看看
#  virt-install
ERROR    A name is required for the virtual machine. (use --prompt to run interactively)
#  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
《解決方案》

selinux策略默認禁止kvm使用nfs資源。我初步推測你的問題是由此導致。
1)
# setenforce 0
2)
編輯 /etc/selinux/config
把 SELINUX=enforcing 改為 SELINUX=disabled
3)
確認 /mnt/116.254.191.19.s 是否存在。請給出ls輸出
4)
重試安裝
《解決方案》

感謝版本,的確是這個問題,困擾我挺久拉
《解決方案》

還有一種可能,
禁用nfsv4
《解決方案》

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?

[火星人 ] 關於KVM在NFS環境下運行的問題已經有1029次圍觀

http://coctec.com/docs/service/show-post-4054.html