[GH-ISSUE #56] Feature Requests: ZFS storage #35

Open
opened 2026-02-27 15:57:05 +03:00 by kerem · 6 comments
Owner

Originally created by @varuzam on GitHub (Oct 8, 2015).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/56

libvirt 1.2.8 and above supports ZFS storage

Originally created by @varuzam on GitHub (Oct 8, 2015). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/56 libvirt 1.2.8 and above supports ZFS storage
Author
Owner

@savichev commented on GitHub (Oct 9, 2015):

ZFS pools
This provides a pool based on the ZFS filesystem. It is currently supported on FreeBSD only.

A pool could either be created manually using the zpool create command and its name specified in the source section or since 1.2.9 source devices could be specified to create a pool using libvirt.

https://libvirt.org/storage.html#StorageBackendZFS

<!-- gh-comment-id:146754178 --> @savichev commented on GitHub (Oct 9, 2015): ZFS pools This provides a pool based on the ZFS filesystem. It is currently **supported on FreeBSD only.** A pool could either be created manually using the zpool create command and its name specified in the source section or since **1.2.9** source devices could be specified to create a pool using libvirt. https://libvirt.org/storage.html#StorageBackendZFS
Author
Owner

@varuzam commented on GitHub (Oct 9, 2015):

Libvirt can be compiled on Linux with ZFS support

root@sheldon:~# lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

root@sheldon:~# zfs list
NAME         USED  AVAIL  REFER  MOUNTPOINT
zpool1      2.96G  15.2G    31K  /zpool1

root@sheldon:~# virsh pool-define-as --name zpool1 --source-name zpool1 --type zfs
Pool zpool1 defined

root@sheldon:~# virsh vol-create-as zpool1 vm 1G
Vol vm created

root@sheldon:~# zfs list
NAME         USED  AVAIL  REFER  MOUNTPOINT
zpool1      4.00G  14.2G    31K  /zpool1
zpool1/vm   1.03G  15.2G    16K  -
<!-- gh-comment-id:147003015 --> @varuzam commented on GitHub (Oct 9, 2015): Libvirt can be compiled on Linux with ZFS support ``` root@sheldon:~# lsb_release -a Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty root@sheldon:~# zfs list NAME USED AVAIL REFER MOUNTPOINT zpool1 2.96G 15.2G 31K /zpool1 root@sheldon:~# virsh pool-define-as --name zpool1 --source-name zpool1 --type zfs Pool zpool1 defined root@sheldon:~# virsh vol-create-as zpool1 vm 1G Vol vm created root@sheldon:~# zfs list NAME USED AVAIL REFER MOUNTPOINT zpool1 4.00G 14.2G 31K /zpool1 zpool1/vm 1.03G 15.2G 16K - ```
Author
Owner

@h0tw1r3 commented on GitHub (Oct 16, 2015):

@varuzam can you provide a link to the libvirt patch you used?

<!-- gh-comment-id:148755858 --> @h0tw1r3 commented on GitHub (Oct 16, 2015): @varuzam can you provide a link to the libvirt patch you used?
Author
Owner

@varuzam commented on GitHub (Oct 16, 2015):

diff -Naur libvirt.orig/src/storage/storage_backend_zfs.c libvirt/src/storage/storage_backend_zfs.c
--- libvirt.orig/src/storage/storage_backend_zfs.c      2015-10-16 19:10:36.900652520 +0300
+++ libvirt/src/storage/storage_backend_zfs.c   2015-10-16 19:46:55.947457830 +0300
@@ -274,15 +274,11 @@
         goto cleanup;

     /**
-     * $ zfs create -o volmode=dev -V 10240K test/volname
+     * $ zfs create -V 10240K test/volname
      *
-     * -o volmode=dev -- we want to get volumes exposed as cdev
-     *                   devices. If we don't specify that zfs
-     *                   will lookup vfs.zfs.vol.mode sysctl value
      * -V -- tells to create a volume with the specified size
      */
-    cmd = virCommandNewArgList(ZFS, "create", "-o", "volmode=dev",
-                               "-V", NULL);
+    cmd = virCommandNewArgList(ZFS, "create", "-V", NULL);
     virCommandAddArgFormat(cmd, "%lluK",
                            VIR_DIV_UP(vol->target.capacity, 1024));
     virCommandAddArgFormat(cmd, "%s/%s",
<!-- gh-comment-id:148784068 --> @varuzam commented on GitHub (Oct 16, 2015): ``` diff -Naur libvirt.orig/src/storage/storage_backend_zfs.c libvirt/src/storage/storage_backend_zfs.c --- libvirt.orig/src/storage/storage_backend_zfs.c 2015-10-16 19:10:36.900652520 +0300 +++ libvirt/src/storage/storage_backend_zfs.c 2015-10-16 19:46:55.947457830 +0300 @@ -274,15 +274,11 @@ goto cleanup; /** - * $ zfs create -o volmode=dev -V 10240K test/volname + * $ zfs create -V 10240K test/volname * - * -o volmode=dev -- we want to get volumes exposed as cdev - * devices. If we don't specify that zfs - * will lookup vfs.zfs.vol.mode sysctl value * -V -- tells to create a volume with the specified size */ - cmd = virCommandNewArgList(ZFS, "create", "-o", "volmode=dev", - "-V", NULL); + cmd = virCommandNewArgList(ZFS, "create", "-V", NULL); virCommandAddArgFormat(cmd, "%lluK", VIR_DIV_UP(vol->target.capacity, 1024)); virCommandAddArgFormat(cmd, "%s/%s", ```
Author
Owner

@savichev commented on GitHub (Oct 17, 2015):

No problem to create a support ZFS.
The problem is the presence of a stable version of libvirt with ZFS support.

<!-- gh-comment-id:148894004 --> @savichev commented on GitHub (Oct 17, 2015): No problem to create a support ZFS. The problem is the presence of a stable version of libvirt with ZFS support.
Author
Owner

@varuzam commented on GitHub (Oct 19, 2015):

maybe you mean official ZFS support in libvirt, because it is only the control ZFS by commands , but stability depends on the implementation of ZFS on Linux
I believe that the ZFS support will be in libvirt, as more and more people using it on Linux

<!-- gh-comment-id:149202759 --> @varuzam commented on GitHub (Oct 19, 2015): maybe you mean official ZFS support in libvirt, because it is only the control ZFS by commands , but stability depends on the implementation of ZFS on Linux I believe that the ZFS support will be in libvirt, as more and more people using it on Linux
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#35
No description provided.