diff --git a/PVE/API2/Disks/ZFS.pm b/PVE/API2/Disks/ZFS.pm index 7a633a7..66b26e9 100644 --- a/PVE/API2/Disks/ZFS.pm +++ b/PVE/API2/Disks/ZFS.pm @@ -5,6 +5,7 @@ use warnings; use PVE::Diskmanage; use PVE::JSONSchema qw(get_standard_option); +use PVE::Systemd; use PVE::API2::Storage::Config; use PVE::Storage; use PVE::Tools qw(run_command lock_file trim); @@ -393,6 +394,11 @@ __PACKAGE__->register_method ({ print "# ", join(' ', @$cmd), "\n"; run_command($cmd); + my $importunit = 'zfs-import@'. PVE::Systemd::escape_unit($name, undef) . '.service'; + $cmd = ['systemctl', 'enable', $importunit]; + print "# ", join(' ', @$cmd), "\n"; + run_command($cmd); + if ($param->{add_storage}) { my $storage_params = { type => 'zfspool',