mirror of
				https://git.proxmox.com/git/qemu-server
				synced 2025-11-04 11:04:35 +00:00 
			
		
		
		
	fix #2217: don't copy cloudinit disk on clone
This removes the cloudinit disk from the list of drives to clone. As the cloudinit disk is recreated on every VM start, it's not necessary to clone it. Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
This commit is contained in:
		
							parent
							
								
									f1619a3b42
								
							
						
					
					
						commit
						7d6c99f0a0
					
				@ -2840,10 +2840,10 @@ __PACKAGE__->register_method({
 | 
			
		||||
		} elsif (PVE::QemuServer::is_valid_drivename($opt)) {
 | 
			
		||||
		    my $drive = PVE::QemuServer::parse_drive($opt, $value);
 | 
			
		||||
		    die "unable to parse drive options for '$opt'\n" if !$drive;
 | 
			
		||||
		    if (PVE::QemuServer::drive_is_cdrom($drive, 1)) {
 | 
			
		||||
		    if (PVE::QemuServer::drive_is_cdrom($drive)) {
 | 
			
		||||
			$newconf->{$opt} = $value; # simply copy configuration
 | 
			
		||||
		    } else {
 | 
			
		||||
			if ($full || PVE::QemuServer::drive_is_cloudinit($drive)) {
 | 
			
		||||
			if ($full) {
 | 
			
		||||
			    die "Full clone feature is not supported for drive '$opt'\n"
 | 
			
		||||
				if !PVE::Storage::volume_has_feature($storecfg, 'copy', $drive->{file}, $snapname, $running);
 | 
			
		||||
			    $fullclone->{$opt} = 1;
 | 
			
		||||
 | 
			
		||||
@ -7152,14 +7152,6 @@ sub clone_disk {
 | 
			
		||||
 | 
			
		||||
	print "create full clone of drive $drivename ($drive->{file})\n";
 | 
			
		||||
	my $name = undef;
 | 
			
		||||
	if (drive_is_cloudinit($drive)) {
 | 
			
		||||
	    $name = "vm-$newvmid-cloudinit";
 | 
			
		||||
	    $snapname = undef;
 | 
			
		||||
	    # we only get here if it's supported by QEMU_FORMAT_RE, so just accept
 | 
			
		||||
	    if ($dst_format ne 'raw') {
 | 
			
		||||
		$name .= ".$dst_format";
 | 
			
		||||
	    }
 | 
			
		||||
	}
 | 
			
		||||
	$newvolid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $newvmid, $dst_format, $name, ($size/1024));
 | 
			
		||||
	push @$newvollist, $newvolid;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user