mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-05 14:32:46 +00:00
ceph: add add_storage helper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
a0946ccba8
commit
ae672a64ce
@ -12,6 +12,7 @@ use PVE::INotify;
|
|||||||
use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file);
|
use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file);
|
||||||
use PVE::AccessControl;
|
use PVE::AccessControl;
|
||||||
use PVE::Storage;
|
use PVE::Storage;
|
||||||
|
use PVE::API2::Storage::Config;
|
||||||
use PVE::RESTHandler;
|
use PVE::RESTHandler;
|
||||||
use PVE::RPCEnvironment;
|
use PVE::RPCEnvironment;
|
||||||
use PVE::JSONSchema qw(get_standard_option);
|
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 ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'listmon',
|
name => 'listmon',
|
||||||
path => 'mon',
|
path => 'mon',
|
||||||
|
Loading…
Reference in New Issue
Block a user