From 34c1236c35ece727ab8a1071db90bd468316f1ee Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 23 Nov 2018 18:35:16 +0100 Subject: [PATCH] api: cephfs: check if SID is free when add_storage is set Signed-off-by: Thomas Lamprecht --- PVE/API2/Ceph/FS.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PVE/API2/Ceph/FS.pm b/PVE/API2/Ceph/FS.pm index dce13e76..a76d6a56 100644 --- a/PVE/API2/Ceph/FS.pm +++ b/PVE/API2/Ceph/FS.pm @@ -8,6 +8,7 @@ use PVE::JSONSchema qw(get_standard_option); use PVE::RADOS; use PVE::RESTHandler; use PVE::RPCEnvironment; +use PVE::Storage; use PVE::API2::Storage::Config; @@ -138,6 +139,8 @@ __PACKAGE__->register_method ({ my $running_mds = PVE::CephTools::get_cluster_mds_state($rados); die "no running Metadata Server (MDS) found!\n" if !scalar(keys %$running_mds); + PVE::Storage::assert_sid_unused($fs_name) if $param->{add_storage}; + my $worker = sub { $rados = PVE::RADOS->new();