From 3932390b1104ff80dcdc1352c36d8bc71c1b34f8 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 27 Aug 2015 14:53:12 +0200 Subject: [PATCH] allow subvolume selection in ZPool storage --- PVE/Storage.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 23780d0..9a313b0 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -986,17 +986,17 @@ sub scan_nfs { sub scan_zfs { - my $cmd = ['zpool', 'list', '-H', '-o', 'name,size,free']; + my $cmd = ['zfs', 'list', '-t', 'filesystem', '-H', '-o', 'name,avail,used']; my $res = []; run_command($cmd, outfunc => sub { my $line = shift; if ($line =~m/^(\S+)\s+(\S+)\s+(\S+)$/) { - my ($pool, $size_str, $free_str) = ($1, $2, $3); + my ($pool, $size_str, $used_str) = ($1, $2, $3); my $size = PVE::Storage::ZFSPoolPlugin::zfs_parse_size($size_str); - my $free = PVE::Storage::ZFSPoolPlugin::zfs_parse_size($free_str); - push @$res, { pool => $pool, size => $size, free => $free }; + my $used = PVE::Storage::ZFSPoolPlugin::zfs_parse_size($used_str); + push @$res, { pool => $pool, size => $size, free => $size-$used }; } }); -- 2.39.2