mirror of
				https://git.proxmox.com/git/qemu-server
				synced 2025-11-04 03:06:53 +00:00 
			
		
		
		
	api: create disks: also convert tpmstate and efidisk to base image for templates
The commit37a1f42aintroduced a conversion step for newly allocated volume disks to base volumes for VM templates. This wrongly excluded efidisk and tmpstate volumes from this conversion, even though those should be converted to base volumes too. Therefore, include efidisks and tpmstate volumes to be converted to base volumes when newly allocating them. Suggested-by: Fiona Ebner <f.ebner@proxmox.com> Fixes:37a1f42a("fix #5301: convert added volume disks to base images for templates") Signed-off-by: Daniel Kral <d.kral@proxmox.com>
This commit is contained in:
		
							parent
							
								
									6b2091da7f
								
							
						
					
					
						commit
						3aa377c9fe
					
				@ -554,11 +554,12 @@ my sub create_disks : prototype($$$$$$$$$$$) {
 | 
			
		||||
		    $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, "raw", undef, $size);
 | 
			
		||||
		} else {
 | 
			
		||||
		    $volid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $fmt, undef, $size);
 | 
			
		||||
 | 
			
		||||
		    # change created disk to a base volume in case the VM is a template
 | 
			
		||||
		    $volid = PVE::Storage::vdisk_create_base($storecfg, $volid)
 | 
			
		||||
			if PVE::QemuConfig->is_template($conf);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		# change created disk to a base volume in case the VM is a template
 | 
			
		||||
		$volid = PVE::Storage::vdisk_create_base($storecfg, $volid)
 | 
			
		||||
		    if PVE::QemuConfig->is_template($conf);
 | 
			
		||||
 | 
			
		||||
		push @$vollist, $volid;
 | 
			
		||||
		$disk->{file} = $volid;
 | 
			
		||||
		$disk->{size} = PVE::Tools::convert_size($size, 'kb' => 'b');
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user