feat: update drive removal logic to first preserve volume data in an unused slot
This commit is contained in:
@@ -782,14 +782,21 @@ class Storage extends Component
|
||||
$unusedIndex++;
|
||||
}
|
||||
|
||||
// Move the disk to an unused slot instead of deleting it
|
||||
// This preserves the volume data
|
||||
// First, assign the volume to an unused slot to preserve it
|
||||
$proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||
'put',
|
||||
[
|
||||
'unused' . $unusedIndex => $drive['volume'],
|
||||
'delete' => $driveKey,
|
||||
]
|
||||
);
|
||||
|
||||
// Then remove the drive configuration (the volume is already safe in unused)
|
||||
$proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||
'put',
|
||||
[
|
||||
$driveKey => 'none',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user