mirror of
git://git.proxmox.com/git/qemu-server.git
synced 2025-03-14 00:58:26 +03:00
fix #1829: Cloudinit ignore format parameter
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.
This commit is contained in:
parent
9741526189
commit
64d1a6aedf
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user