VirtualBox

Opened 8 years ago

Closed 8 years ago

#14936 closed defect (wontfix)

Cannot add disks while machine is running

Reported by: clintonskitson Owned by:
Component: virtual disk Version: VirtualBox 5.0.10
Keywords: add disk Cc:
Guest type: other Host type: other

Description

Under VirtualBox 4.3.28 I was able to add and remove drives to running VMs. With 5.0.10 I am unable to do the same task. Going through the CLI and through the SOAP API are yielding the same results. Is there an update to the session locking that needs to be noted or locking type to perform the operation?

` dicey1:siomachine clintonkitson$ VBoxManage storageattach ad92d16a-ef7b-4b4a-abb2-31903dde203f --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium 4c2a05ee-5a50-4665-9633-2b4530f3cc35 VBoxManage: error: The machine is not mutable (state is Running) VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component SessionMachine, interface IMachine, callee nsISupports VBoxManage: error: Context: "COMSETTER(PortCount)(port + 1)" at line 385 of file VBoxManageStorageController.cpp VBoxManage: error: The port and/or device parameter are out of range: port=1 (must be in range [0, 0]), device=0 (must be in range [0, 0]) VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component StorageControllerWrap, interface IStorageController, callee nsISupports VBoxManage: error: Context: "AttachDevice(Bstr(pszCtl).raw(), port, device, DeviceType_HardDisk, pMedium2Mount)" at line 758 of file VBoxManageStorageController.cpp `

Change History (5)

comment:1 by clintonskitson, 8 years ago

I wanted to also update this to include about the use case. Through a Go API binding we built a VirtualBox driver that works as a Docker Volume Driver. This means you run can boot2docker and include Volume Driver functionality. If you are running multiple VMs with Docker, then the orchestration of attaching and detaching volumes to containers is all handled under the covers.

https://github.com/emccode/rexray

comment:2 by aeichner, 8 years ago

To me this looks like you created a SATA controller which has only one port (according to the out of range error message). You have to set the port count of the SATA controller to a higher value to be able to hotplug devices.

comment:3 by clintonskitson, 8 years ago

Thanks for taking a look. Indeed if the port count is set to the correct number then the attachment works. The problem now however is tha the port count cannot be modified while the machine is running as compared to the previous version.

dicey1:siomachine clintonkitson$ VBoxManage storagectl ad92d16a-ef7b-4b4a-abb2-31903dde203f --controller "IntelAhci" --portcount 2 VBoxManage: error: The machine 'test_default_1450239585141_2524' is already locked for a session (or being unlocked) VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 1030 of file VBoxManageStorageController.cpp

It looks like the LockType is incorrect here?

Running from SOAP with the shared lock type an error is still thrown.

The machine is not mutable (state is Running) (0x80bb0002) volumeID=110e7e00-7b5e-4b63-871d-be4ef72eb823

comment:4 by Klaus Espenlaub, 8 years ago

The port count could never be changed while the VM is running. If it ever worked it was a bug, and totally unsafe. 4.3 handled disk hot-plugging very differently (and far less controlled) than 5.0, which allows to explicitly mark even initially connected devices as hot-pluggable, without assuming that everything can be ripped out. Several OSes don't particularly like if they run off a disk which was marked as hot-pluggable (which every disk in 4.3 was).

comment:5 by Frank Mehnert, 8 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use