[libvirt-users] Compiling libvirt-0.8.4 for NFSv4
by paul.worner@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'.
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,
Paul Worner