FS#58914 - [libvirt] ZFS pool support missing (build time dependency?)
Attached to Project:
Community Packages
Opened by Uwe Sauter (UweSauter) - Thursday, 07 June 2018, 20:37 GMT
Last edited by Christian Rebischke (Shibumi) - Sunday, 19 August 2018, 02:16 GMT
Opened by Uwe Sauter (UweSauter) - Thursday, 07 June 2018, 20:37 GMT
Last edited by Christian Rebischke (Shibumi) - Sunday, 19 August 2018, 02:16 GMT
|
Details
libvirt is missing ZFS pool support, possibly a build time
dependency (see this old Debian bug [1]).
This is tested with libvirt 4.3.0-1 and 4.4.0-1. If I try to create a storage pool based on ZFS I get the following error: ### snip ### virsh # pool-define-as --name ZFS --source-name hpcnsauter --type zfs error: Failed to define pool ZFS error: internal error: missing backend for pool type 11 (zfs) ### snap ### [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=827245 |
This task depends upon
Closed by Christian Rebischke (Shibumi)
Sunday, 19 August 2018, 02:16 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented. Checkout the newest libvirt version in [community]
Sunday, 19 August 2018, 02:16 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented. Checkout the newest libvirt version in [community]
Looking at the code, this is detected in https://github.com/libvirt/libvirt/blob/e64f2fab920fe8a08e97b790cb5d959f3566aea3/m4/virt-storage-zfs.m4
Which builds this backend: https://github.com/libvirt/libvirt/blob/31869efe2a8059356559cebc3b18c7dfab438a46/src/storage/storage_backend_zfs.c
Since all it is doing is calling the zfs and zpool binaries, I guess there's no reason we couldn't manually pass define the AC_PATH_PROG for zfs/zpool, and build the backend on the off chance that users installed the AUR packages which provide these filesystem kernel modules (and the executables which drive them).
It's not an unreasonable request -- that being said, it's really up to Shibumi whether he wishes to do so.
FS#56677?The glusterfs plugin (despite them not really being plugins in the most important way) uses #include <glusterfs/api/glfs.h>
The zfs plugin does not link any foreign libraries. So there's no interaction with other packages to consider -- either it builds or it doesn't. If the plugin simply fails to work and no one notices then 1) upstream is broken, 2) we're no worse off than before.
Usually such optional support would be indicated by an optdepends but as the package is in AUR that can not be done.
A question on the binary issue how is zfs any different from nvidia or wl which are packaged. wl is now on the live media so combined with the kernel as distributed.
The zfs and zpool binaries are both installed in /usr/bin.
And ZFS itself is not a problem, the licensing is. But I'm not asking you to ship a package with problematic licening, I'm asking that libvirt supports ZFS if the ZFS binaries are installed.
I understand the subject about testing but there is a solution to that, too. Some friendly fellow runs the ArchZFS repository from where you can install prebuild ZFS packages, independently distributed from the GPL'd kernel. [1]
Shibumi: could you elaborate on your comment that ZFS support would not work with a merged libvirt / libvirt-glusterfs?
[1] https://wiki.archlinux.org/index.php/Unofficial_user_repositories#archzfs
Ok I have checked this. And it seems that I would need to push ZFS and zpool into community as build dependencies (that I will not). I don't think zfs will be ever in our repositories as long there are licensing issues with ZFS and Linux:
checking for zfs... no
checking for zpool... no
configure: error: We need zfs and zpool for ZFS storage driver
We can leave this bug ticket open for tracking the demand.
I told you exactly how you could do it, a month ago. If you're going to turn this down, how about it not be for completely incorrect reasons?
In fact, here's the PKGBUILD I used to successfully build a package that helpfully contains the file usr/lib/libvirt/storage-backend/libvirt_storage_backend_zfs.so as reported by checkpkg, so it is definitively possible. Just override the executable command detection by explicitly telling it where $ZFS and $ZPOOL are...
(It also fixes some jarring use of "two spaces for first-level indent, one tab for second-level indent"??? as well as removing ancient comments and duplicated makedepends/base-devel.)
I have build the package. Please test the package: http://pkgbuild.com/~shibumi/libvirt-4.5.0-2-x86_64.pkg.tar.xz
Thanks.