[pve-devel] applied: [PATCH qemu-server] fix #1829: Cloudinit ignore format parameter

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Apr 24 15:45:05 CEST 2019


Am 4/16/19 um 9:58 AM schrieb Wolfgang Link:
> When a Cloudinit image is created, we allow choosing
> the format as parameter.
> So, the parameter should also be taken into account.
> 
> The default for Cloudinit will stay qcow2 on directory storages.

applied, thanks! 

> ---
>  PVE/API2/Qemu.pm | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index 651f64f..be25510 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -149,13 +149,15 @@ my $create_disks = sub {
>  	    die "no storage ID specified (and no default storage)\n" if !$storeid;
>  	    my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
>  	    my $name = "vm-$vmid-cloudinit";
> +
>  	    my $fmt = undef;
>  	    if ($scfg->{path}) {
> -		$name .= ".qcow2";
> -		$fmt = 'qcow2';
> -	    }else{
> -		$fmt = 'raw';
> +		$fmt = $disk->{format} ? $disk->{format} : "qcow2";
> +		$name .= ".$fmt";
> +	    } else {
> +		$fmt = $disk->{format};
>  	    }
> +
>  	    # Initial disk created with 4MB, every time it is regenerated the disk is aligned to 4MB again.
>  	    my $cloudinit_iso_size = 4; # in MB
>  	    my $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, 
> 





More information about the pve-devel mailing list