diff --git a/extensions/Servers/Proxmox/Livewire/Storage.php b/extensions/Servers/Proxmox/Livewire/Storage.php index ce529999e..965d4248c 100644 --- a/extensions/Servers/Proxmox/Livewire/Storage.php +++ b/extensions/Servers/Proxmox/Livewire/Storage.php @@ -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';