From 30a1155658fe24ec2762dd701210c5851540c60e Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 28 Apr 2020 14:52:29 +0200 Subject: [PATCH] restore: use correct storage for format check for cloudinit drives when a backup includes a cloudinit disk on a non-existent storage, the restore fails with 'storage' does not exist this happens because we want to get the format of the disk, by checking the source storage we fix this by using the target storage first and only the source as fallback this will still fail if neither storage exists (which is ok, since we cannot restore then anyway) Signed-off-by: Dominik Csapak --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 37c73208..e3558107 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -5739,7 +5739,7 @@ my $parse_backup_hints = sub { my $drive = parse_drive($virtdev, $2); if (drive_is_cloudinit($drive)) { my ($storeid, $volname) = PVE::Storage::parse_volume_id($drive->{file}); - my $scfg = PVE::Storage::storage_config($storecfg, $storeid); + my $scfg = PVE::Storage::storage_config($storecfg, $options->{storage} // $storeid); my $format = qemu_img_format($scfg, $volname); # has 'raw' fallback $virtdev_hash->{$virtdev} = {