feat: update drive reattachment logic to first set the disk on the new bus before clearing the unused slot

This commit is contained in:
2025-12-05 04:46:55 -05:00
parent e765a87fa4
commit 9f8c4eef04

View File

@@ -1023,13 +1023,21 @@ class Storage extends Component
$diskConfig = implode(',', $configParts);
// Set the disk on the new bus and delete the unused reference
// First, set the disk on the new bus
$proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
'put',
[
$targetKey => $diskConfig,
'delete' => $this->reattachingDriveKey,
]
);
// Then clear the unused slot (set to empty/none to remove the reference without deleting volume)
$proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
'put',
[
$this->reattachingDriveKey => '',
]
);