zfs: auto import after reboot

this is necessary, because after a reboot all pools except rpool are gone

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
This commit is contained in:
Wolfgang Link
2015-02-03 12:59:08 +01:00
committed by Dietmar Maurer
parent 90a11abe78
commit 86d472394a
2 changed files with 14 additions and 1 deletions

View File

@ -350,4 +350,9 @@ sub volume_has_feature {
return undef;
}
sub activate_storage {
my ($class, $storeid, $scfg, $cache) = @_;
return 1;
}
1;

View File

@ -150,7 +150,7 @@ sub zfs_request {
my $cmd = [];
if ($method eq 'zpool_list') {
push @$cmd = 'zpool', 'list';
push @$cmd, 'zpool', 'list';
} else {
push @$cmd, 'zfs', $method;
}
@ -422,6 +422,14 @@ sub volume_snapshot_rollback {
sub activate_storage {
my ($class, $storeid, $scfg, $cache) = @_;
my @param = ('-o', 'name', '-H');
my $text = zfs_request($class, $scfg, undef, 'zpool_list', @param);
if ($text !~ $scfg->{pool}) {
run_command("zpool import -d /dev/disk/by-id/ -a");
}
return 1;
}