我试图使用virsh和域xml从ubuntu16.04LTS主机启动Centos 7客户机。我在域xml中使用的“文件系统”节点如下所示:
<filesystem type='mount' accessmode='passthrough'>
<driver type='path' wrpolicy='immediate'/>
<source dir='/opt/test'/>
<target dir='testlabel'/>
</filesystem>使用上面的配置,"testlabel“在来宾中是不可见的,因此我无法挂载它。我遗漏了什么吗?
我试图在客户中有9p模块,但它们似乎在centos 7中并不容易使用。需要内核重新编译现在试一试。我听说virtio将来会上市。因此,就目前而言,这不是一种选择。
我也不想使用基于网络的文件共享,比如SSHFS、NFS或glusterfs。
还有其他文件系统驱动程序可以使用libvirt域xml的“文件系统”选项吗?
发布于 2017-03-24 09:27:28
根据libvirt文档,您可能只需调整您的target。
文档提供了以下示例:
<filesystem type='mount' accessmode='passthrough'>
<driver type='path' wrpolicy='immediate'/>
<source dir='/export/to/guest'/>
<target dir='/import/from/host'/>
<readonly/>
</filesystem>
<filesystem type='file' accessmode='passthrough'>
<driver name='loop' type='raw'/>
<driver type='path' wrpolicy='immediate'/>
<source file='/export/to/guest.img'/>
<target dir='/import/from/host'/>
<readonly/>
</filesystem>这似乎是可行的,不需要9p。
然而,对于centos来说,实际上有一个随时可用的9p助手:
Available Packages
Name : nfs-ganesha-mount-9P
Arch : x86_64
Version : 2.3.2
Release : 1.el7
Size : 11 k
Repo : epel/x86_64
Summary : a 9p mount helper
URL : https://github.com/nfs-ganesha/nfs-ganesha/wiki
Licence : LGPLv3+
Description : This package contains the mount.9P script that clients can use
: to simplify mounting to NFS-GANESHA. This is a 9p mount helper.发布于 2017-04-04 09:11:31
此时,9p是libvirt和KVM支持的唯一文件系统共享选项。不幸的是,9p支持在CentOS中是禁用的,因为它在上游多年来基本上没有维护&包含了一些安全缺陷--直到过去几个月,一位新的9p维护人员才开始清理这个问题。如果您确实重新编译了centos内核,或者自己构建了9p模块,那么应该可以让它工作。
在有NFS支持的virtio出现之前,没有其他基于非网络的选项可以使用。
https://serverfault.com/questions/839635
复制相似问题