feat: update drive reattachment logic to first set the disk on the new bus before clearing the unused slot
This commit is contained in:
@@ -1023,13 +1023,21 @@ class Storage extends Component
|
|||||||
|
|
||||||
$diskConfig = implode(',', $configParts);
|
$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(
|
$proxmox->request(
|
||||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||||
'put',
|
'put',
|
||||||
[
|
[
|
||||||
$targetKey => $diskConfig,
|
$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 => '',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user