- 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});
-
- PVE::Storage::activate_storage($cfg, $baseid);
-
- PVE::Storage::LVMPlugin::lvm_create_volume_group($path, $opts->{vgname}, $opts->{shared});
- } elsif ($type eq 'rbd' && !defined($opts->{monhost})) {
- my $ceph_admin_keyring = '/etc/pve/priv/ceph.client.admin.keyring';
- my $ceph_storage_keyring = "/etc/pve/priv/ceph/${storeid}.keyring";
-
- die "ceph authx keyring file for storage '$storeid' already exists!\n"
- if -e $ceph_storage_keyring;
-
- eval {
- mkdir '/etc/pve/priv/ceph';
- PVE::Tools::file_copy($ceph_admin_keyring, $ceph_storage_keyring);
- };
- if (my $err = $@) {
- unlink $ceph_storage_keyring;
- die "failed to copy ceph authx keyring for storage '$storeid': $err\n";
- }
- }
- # create a password file in /etc/pve/priv,
- # this file is used as a cert_file at mount time.
- my $cred_file = &$set_cifs_credentials($password, $storeid)
- if defined($password);