diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index 2b4ff9c..f208374 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -79,6 +79,19 @@ my $rados_cmd = sub { return $cmd; }; +# needed for volumes created using ceph jewel (or higher) +my $krdb_feature_disable = sub { + my ($scfg, $storeid, $name) = @_; + + return 1 if !$scfg->{krbd}; + + my ($major, undef, undef, undef) = ceph_version(); + return 1 if $major < 10; + + my $feature_cmd = &$rbd_cmd($scfg, $storeid, 'feature', 'disable', $name, 'deep-flatten,fast-diff,object-map,exclusive-lock'); + run_rbd_command($feature_cmd, errmsg => "could not disable krbd-incompatible image features of rbd volume $name"); +}; + my $ceph_version_parser = sub { my $line = shift; if ($line =~ m/^ceph version ((\d+)\.(\d+)\.(\d+))(?: \([a-fA-F0-9]+\))?$/) { @@ -404,6 +417,8 @@ sub clone_image { run_rbd_command($cmd, errmsg => "rbd clone '$basename' error"); + &$krdb_feature_disable($scfg, $storeid, $name); + return $newvol; } @@ -419,6 +434,8 @@ sub alloc_image { my $cmd = &$rbd_cmd($scfg, $storeid, 'create', '--image-format' , 2, '--size', int(($size+1023)/1024), $name); run_rbd_command($cmd, errmsg => "rbd create $name' error"); + &$krdb_feature_disable($scfg, $storeid, $name); + return $name; }