[libvirt-users] Compiling libvirt-0.8.4 for NFSv4

Osier jyang at redhat.com
Thu Oct 28 03:21:41 UTC 2010


于 2010年10月27日 21:51, paul.worner at thomsonreuters.com 写道:
> Hi all,
>
> Not sure if this will be useful to anyone. Worse, it’s probably not
> complete or correct, but I thought I would throw this out there for comment.
>
> I asked earlier about configuring libvirt for NFSv4 support. I wanted to
> define NFSv4 pool from xml config, but it’s not an option. I decided to
> hack a bit. Added the following to source code:
>
> storage_conf.h(417):
>
> enum virStoragePoolFormatFileSystemNet {
>
> VIR_STORAGE_POOL_NETFS_AUTO = 0,
>
> VIR_STORAGE_POOL_NETFS_NFS,
>
> VIR_STORAGE_POOL_NETFS_NFS4,
>
> VIR_STORAGE_POOL_NETFS_GLUSTERFS,
>
> VIR_STORAGE_POOL_NETFS_CIFS,
>
> VIR_STORAGE_POOL_NETFS_LAST,
>
> };
>
> storage_conf.c(64):
>
> VIR_ENUM_IMPL(virStoragePoolFormatFileSystemNet,
>
> VIR_STORAGE_POOL_NETFS_LAST,
>
> "auto", "nfs", "nfs4", "glusterfs", "cifs")
>
> Compiled libvirt and then created storage pool xml:
>
> <pool type="netfs">
>
> <name>pool2</name>
>
> <source>
>
> <host name="test_filer"/>
>
> <dir path="/libvirt"/>
>
> <format type="nfs4"/>
>
> </source>
>
> <target>
>
> <path>”/usr/local/var/lib/libvirt/images/nfsds2”</path>
>
> </target>
>
> </pool>
>
> ‘Virsh pool-create [above xml]’ works, using ‘mount –t nfs4’.

Think it's fine to create the pool if your host support nfs4,
but not sure if it will work when you want to use the security driver.
, probly the boolean "virt_use_nfs" of selinux will not work
for nfs4.

>
> Again, this seemed too easy, so I won’t be surprised if things break.
> However, I was just trying to demonstrate functionality in lab, so
> failures are fine short term.
>
> Please comment on flaws or improvements to this approach.
>
> Thanks,

have you considered to make a patch and send it to libvir-list?
all of the upstream development of libvirt are discussed there. :-)

- Osier
>
> Paul Worner
>
>
>
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users




More information about the libvirt-users mailing list