[pve-devel] [PATCH LXC] Add support for CT using ZFS plugin and Comstar

Michael Rasmussen mir at datanom.net
Mon Oct 24 18:09:49 CEST 2016


Signed-off-by: Michael Rasmussen <mir at datanom.net>
---
 src/PVE/LXC.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 535147f..c86a153 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1250,7 +1250,8 @@ sub mountpoint_mount {
 		$mounted_dev = run_with_loopdev($domount, $path);
 		$use_loopdev = 1;
 	    } elsif ($scfg->{type} eq 'drbd' || $scfg->{type} eq 'lvm' ||
-		     $scfg->{type} eq 'rbd' || $scfg->{type} eq 'lvmthin') {
+                 $scfg->{type} eq 'rbd' || $scfg->{type} eq 'lvmthin' ||
+                 $scfg->{type} eq 'zfs') {
 		$mounted_dev = $path;
 		&$domount($path);
 	    } else {
@@ -1369,6 +1370,13 @@ sub create_disks {
 		    die "krbd option must be enabled on storage type '$scfg->{type}'\n" if !$scfg->{krbd};
 		    $volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'raw', undef, $size_kb);
 		    format_disk($storecfg, $volid, $rootuid, $rootgid);
+		} elsif ($scfg->{type} eq 'zfs') {
+			if ($scfg->{iscsiprovider} eq 'comstar') {
+				$volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'raw', undef, $size_kb);
+				format_disk($storecfg, $volid, $rootuid, $rootgid);
+			} else {
+				die "unable to create containers on iSCSI provider '$scfg->{iscsiprovider}'\n";
+			}
 		} else {
 		    die "unable to create containers on storage type '$scfg->{type}'\n";
 		}
-- 
2.1.4


----

This mail was virus scanned and spam checked before delivery.
This mail is also DKIM signed. See header dkim-signature.




More information about the pve-devel mailing list