#9725 closed defect (invalid)
hotplug sata drive
Reported by: | Geoff Nordli | Owned by: | |
---|---|---|---|
Component: | virtual disk | Version: | VirtualBox 4.1.4 |
Keywords: | sata hotplug | Cc: | |
Guest type: | Linux | Host type: | Linux |
Description
When trying to hotplug a disk for the first time it gives the error:
BoxManage storageattach debian --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium iscsi --server 192.168.2.14 --target iqn.1986-03.com.sun:02:a374c091-c4e9-e7dc-822b-b43e6ee544f0 --lun 10 iSCSI disk created. UUID: 4d02f92c-0f49-46e2-9924-4957f7722501 VBoxManage: error: Could not unmount the currently mounted media/drive (VERR_PDM_LUN_NOT_FOUND) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Console, interface IConsole, callee nsISupports Context: "AttachDevice(Bstr(pszCtl).raw(), port, device, DeviceType_HardDisk, pMedium2Mount)" at line 713 of file VBoxManageStorageController.cpp
The associated error in the vm log looks like:
00:01:52.814 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={1968b7d3-e3bf-4ceb-99e0-cb7c913317bb} aComponent={Console} aText={Could not unmount the currently mounted media/drive (VERR_PDM_LUN_NOT_FOUND)}, preserve=false
But there was nothing in the drive to start with.
When I look at the drive it thinks it is connected to the VM:
VBoxManage showhdinfo 4d02f92c-0f49-46e2-9924-4957f7722501 UUID: 4d02f92c-0f49-46e2-9924-4957f7722501 Accessible: yes Logical size: 8192 MBytes Current size on disk: 8192 MBytes Type: normal (base) Storage format: iSCSI Format variant: fixed default In use by VMs: debian (UUID: d37d30d7-ba43-4f92-b838-8edb88265617) Location: 192.168.2.14|iqn.1986-03.com.sun:02:a374c091-c4e9-e7dc-822b-b43e6ee544f0|10
If I try to remove the drive using the Virtual Media Manager, it errors out with the following:
"Failed to save the settings of the virtual machine to ."
I have tried on a Windows Server 2008 R2 VM as well and it fails, unless I have previously mounted a drive on that port, then it seems to work OK.
Attachments (1)
Change History (4)
by , 13 years ago
Attachment: | debian-2011-10-08-21-42-36.log added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
That is expected because the SATA controller in your VM has only one port configured (port number 0). The port has to available to make hotplugging work which can be done with:
VBoxManage storagectl <VM name> --name <Storage ctl name> --sataportcount <required number of ports>
This has to be done when the VM is powered off.
comment:3 by , 13 years ago
Thanks, that fixed it.
I thought the port count was dynamic up to the max number of ports.
This could be another hint. If I do vboxmanage showvminfo --machinereadable it only shows the ports that have either been used or have something attached:
If I try to attach a disk to a port that is listed, then it works:
And it shows up in the vboxmanage listing
If I try to add a disk to a port that isn't listed there then it fails: