VirtualBox

Ticket #9725 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

hotplug sata drive

Reported by: gnordli Owned by:
Priority: major 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

debian-2011-10-08-21-42-36.log Download (58.0 KB) - added by gnordli 3 years ago.

Change History

Changed 3 years ago by gnordli

comment:1 Changed 3 years ago by gnordli

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:

VBoxManage 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 11
iSCSI disk created. UUID: 3beb1154-d3df-46fe-99c1-98f4bd99fdeb

And it shows up in the vboxmanage listing

storagecontrollername1="SATA Controller"
storagecontrollertype1="IntelAhci"
storagecontrollerinstance1="0"
storagecontrollermaxportcount1="30"
storagecontrollerportcount1="4"
storagecontrollerbootable1="on"
"SATA Controller-0-0"="192.168.2.14|iqn.1986-03.com.sun:02:a374c091-c4e9-e7dc-822b-b43e6ee544f0|9"
"SATA Controller-ImageUUID-0-0"="d57ddb79-f89d-4c5c-8305-02462c51ba89"
"SATA Controller-1-0"="192.168.2.14|iqn.1986-03.com.sun:02:a374c091-c4e9-e7dc-822b-b43e6ee544f0|11"
"SATA Controller-ImageUUID-1-0"="3beb1154-d3df-46fe-99c1-98f4bd99fdeb"
"SATA Controller-2-0"="none"
"SATA Controller-3-0"="none"

If I try to add a disk to a port that isn't listed there then it fails:

VBoxManage storageattach debian --storagectl "SATA Controller" --port 5 --device 0 --type hdd --medium iscsi --server 192.168.2.14 --target iqn.1986-03.com.sun:02:a374c091-c4e9-e7dc-822b-b43e6ee544f0 --lun 12
iSCSI disk created. UUID: 49a2a968-0b19-4d6c-8ca9-e7da79271a68
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

comment:2 Changed 3 years ago by aeichner

  • Status changed from new to closed
  • Resolution set to invalid

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 Changed 3 years ago by gnordli

Thanks, that fixed it.

I thought the port count was dynamic up to the max number of ports.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use