[pve-devel] applied: [PATCH qemu-server] restore: use correct storage for format check for cloudinit drives

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Apr 29 11:06:22 CEST 2020


On 4/28/20 2:52 PM, Dominik Csapak wrote:
> 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 <d.csapak at proxmox.com>
> ---
>  PVE/QemuServer.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 37c7320..e355810 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} = {
> 

applied with a small cleanup reducing the occurrence of
"$options->{storage} // $storeid" thanks.




More information about the pve-devel mailing list