Ticket #9608 (closed defect: obsolete)
VBoxManage storageattach fails when using the same filename again after delete and restarting VirtualBox fixes it)
|Reported by:||virtualboxbug||Owned by:|
|Version:||VirtualBox 4.1.2||Keywords:||VBoxManage, storageattach, vdi|
Description (last modified by frank) (diff)
I create a VM with VBoxManage using a batch. I copy an empty VDI to a filename of the VM. I attach the VDI with
VBoxManage storageattach "%variable%" --storagectl "IDE Controller" --port 1 --device 0 --type hdd --medium "%variable.vdi" --setuuid %variable
This works the first time.
I delete the VM and repeat the process above, but when attaching the VDI file I get
VBoxManage.exe: error: Storage for the medium 'C:\Program Files\Oracle\VirtualBox\data\.VirtualBox\HardDisks\secondtimefails.vdi' is not created VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Medium, interface IMedium, callee IUnknown Context: "SetIDs(fSetNewUuid, bstrNewUuid.raw(), fSetNewParentUuid, bstrNewParentUuid.raw())" at line 637 of file VBoxManageStorageControlle r.cpp VBoxManage.exe: error: Failed to set the medium/parent medium UUID
If delete the VM, and try it again, the same result. But here's the thing: When I exit VirtualBox (all of its processes) and launch it again, everything works like on the first time, and the problem repeats on the second.
Any name I try reusing fails until restart of VirtualBox.
(%variable is not a real variable, it's a placeholder)
This worked in 3.x. (And I'm probably going to have to go back to it and try 4 later; you've broken quite a few things between 3 and 4.)