From 841fba689b576dc9628770ada72c941c3adcc474 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 8 Nov 2018 14:05:16 +0100 Subject: [PATCH] call map_volume before using volumes. Signed-off-by: Dietmar Maurer Signed-off-by: Thomas Lamprecht --- debian/control | 2 +- src/PVE/LXC.pm | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/debian/control b/debian/control index d1226dd..15f42ad 100644 --- a/debian/control +++ b/debian/control @@ -20,7 +20,7 @@ Architecture: all Depends: file, libpve-common-perl (>= 5.0-39), libpve-guest-common-perl, - libpve-storage-perl (>= 5.0-27), + libpve-storage-perl (>= 5.0-31), lxc-pve, pve-cluster (>= 4.0-8), pve-ha-manager, diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 1e47faf..619f697 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1409,12 +1409,9 @@ sub mountpoint_mount { my $scfg = PVE::Storage::storage_config($storage_cfg, $storage); - # early sanity checks: - # we otherwise call realpath on the rbd url - die "containers on rbd storage without krbd are not supported\n" - if $scfg->{type} eq 'rbd' && !$scfg->{krbd}; + my $path = PVE::Storage::map_volume($storage_cfg, $volid, $snapname); - my $path = PVE::Storage::path($storage_cfg, $volid, $snapname); + $path = PVE::Storage::path($storage_cfg, $volid, $snapname) if !defined($path); my ($vtype, undef, undef, undef, undef, $isBase, $format) = PVE::Storage::parse_volname($storage_cfg, $volid); @@ -1521,7 +1518,9 @@ sub format_disk { PVE::Storage::activate_volumes($storage_cfg, [$volid]); - my $path = PVE::Storage::path($storage_cfg, $volid); + my $path = PVE::Storage::map_volume($storage_cfg, $volid); + + $path = PVE::Storage::path($storage_cfg, $volid) if !defined($path); my ($vtype, undef, undef, undef, undef, $isBase, $format) = PVE::Storage::parse_volname($storage_cfg, $volid); @@ -1574,7 +1573,6 @@ sub alloc_disk { } elsif ($scfg->{type} eq 'rbd') { - die "krbd option must be enabled on storage type '$scfg->{type}'\n" if !$scfg->{krbd}; $volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'raw', undef, $size_kb); $do_format = 1; } else { -- 2.39.2