- PVE::Storage::lock_storage_config(
- sub {
-
- my $cfg = PVE::Storage::config();
-
- if (my $scfg = PVE::Storage::storage_config($cfg, $storeid, 1)) {
- die "storage ID '$storeid' already defined\n";
- }
-
- $cfg->{ids}->{$storeid} = $opts;
-
- $plugin->on_add_hook($storeid, $opts, password => $password);
-
- my $cred_file = undef;
-
- if ($type eq 'lvm' && $opts->{base}) {
-
- my ($baseid, $volname) = PVE::Storage::parse_volume_id($opts->{base});
-
- my $basecfg = PVE::Storage::storage_config ($cfg, $baseid, 1);
- die "base storage ID '$baseid' does not exist\n" if !$basecfg;
-
- # we only support iscsi for now
- if (!($basecfg->{type} eq 'iscsi')) {
- die "unsupported base type '$basecfg->{type}'";
- }
-
- my $path = PVE::Storage::path($cfg, $opts->{base});