feat: improve unused drive handling by retrieving exact disk value before reattachment
This commit is contained in:
@@ -973,8 +973,20 @@ class Storage extends Component
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
|
||||
// Build the disk configuration
|
||||
$configParts = [$unusedDrive['volume']];
|
||||
// First, get the current config to retrieve the exact unused disk value
|
||||
$config = $proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config'
|
||||
);
|
||||
|
||||
$unusedValue = $config['data'][$this->reattachingDriveKey] ?? null;
|
||||
if (!$unusedValue) {
|
||||
$this->notify('Unused drive no longer exists. Please refresh the page.', 'error');
|
||||
$this->loadStorageConfiguration(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Build the disk configuration using the exact volume from the unused entry
|
||||
$configParts = [$unusedValue];
|
||||
|
||||
// Add default settings for the bus type
|
||||
$configParts[] = 'cache=none';
|
||||
|
||||
Reference in New Issue
Block a user