From ae672a64ce0fcff8c90d45b2dfc9f5bbcb792b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 5 Sep 2017 14:59:34 +0200 Subject: [PATCH] ceph: add add_storage helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- PVE/API2/Ceph.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm index 7f709f55..52b425f6 100644 --- a/PVE/API2/Ceph.pm +++ b/PVE/API2/Ceph.pm @@ -12,6 +12,7 @@ use PVE::INotify; use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file); use PVE::AccessControl; use PVE::Storage; +use PVE::API2::Storage::Config; use PVE::RESTHandler; use PVE::RPCEnvironment; use PVE::JSONSchema qw(get_standard_option); @@ -699,6 +700,20 @@ __PACKAGE__->register_method ({ }}); +my $add_storage = sub { + my ($pool, $storeid, $krbd) = @_; + + my $storage_params = { + type => 'rbd', + pool => $pool, + storage => $storeid, + krbd => $krbd // 0, + content => $krbd ? 'rootdir' : 'images', + }; + + PVE::API2::Storage::Config->create($storage_params); +}; + __PACKAGE__->register_method ({ name => 'listmon', path => 'mon',