mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-09 08:44:43 +00:00
disk reassign: add unused disks directly to config
Using $update_vm_api for unused disks will cause them to end up as a pending change if the VM is running. Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
parent
f4e4c77984
commit
bf67da2bf7
@ -3607,6 +3607,11 @@ __PACKAGE__->register_method({
|
||||
PVE::QemuConfig->write_config($vmid, $source_conf);
|
||||
|
||||
my $drive_string = PVE::QemuServer::print_drive($drive);
|
||||
|
||||
if ($target_disk =~ /^unused\d+$/) {
|
||||
$target_conf->{$target_disk} = $drive_string;
|
||||
PVE::QemuConfig->write_config($target_vmid, $target_conf);
|
||||
} else {
|
||||
&$update_vm_api(
|
||||
{
|
||||
node => $node,
|
||||
@ -3616,6 +3621,7 @@ __PACKAGE__->register_method({
|
||||
},
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
||||
# remove possible replication snapshots
|
||||
if (PVE::Storage::volume_has_feature(
|
||||
|
Loading…
Reference in New Issue
Block a user