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:
committed by
Dietmar Maurer
parent
90a11abe78
commit
86d472394a
@ -350,4 +350,9 @@ sub volume_has_feature {
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub activate_storage {
|
||||
my ($class, $storeid, $scfg, $cache) = @_;
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user