Page 1 of 1
problem deleting hdds
Posted: 13. Dec 2012, 19:19
by edstevens
Vbox 4.2.4 on Win7 Pro.
Created a vm running oracle linux 5.6
After machine was created and OS installed, guest additions installed, etc. I ran a script that uses vboxmanage to create additional hhds. All that works well, and I have used the process up to that point to create dozens of sandbox systems.
Now to add a twist.
I needed to add some additional hdds. Used my script to do it, but forgot to shutdown the vm first. The VB console does not show that the new disks are attached to the vm. vboxmanage showvminfo gives no indication of the new disks. However, vboxmanage list hdds shows them. More importantly, when I launch the VB console, I get a pop-up saying "One or more virtual hard disks ... are not currently accessible ...yada, yada, yada. Selecting 'check' brings up "Virtual Media Manager" and shows the two hdds in question with an alert icon. If I select one of them and click "release", nothing happens. A restart of the VB console results in the same pop-ups and the same status when I select to 'check'.
If I use vboxmanage closemedium I get 'cannot be closed because it is still attached".
Ideas, other than completely deleting the vm and starting over?
Re: problem deleting hdds
Posted: 13. Dec 2012, 21:20
by mpack
It sounds like the media is registered but not mounted (not attached to a controller in the VM). "Release" unmounts the disk - which sounds like you don't need to do. "Remove" unregisters the media and offers you a chance to delete the physical file. I suspect that's what you need to do, and I can't think of anything you could do to make the feature unavailable. If you think otherwise then zip up the .vbox file for that VM and post it here.
Re: problem deleting hdds
Posted: 13. Dec 2012, 23:01
by edstevens
mpack wrote:It sounds like the media is registered but not mounted (not attached to a controller in the VM). "Release" unmounts the disk - which sounds like you don't need to do. "Remove" unregisters the media and offers you a chance to delete the physical file. I suspect that's what you need to do, and I can't think of anything you could do to make the feature unavailable. If you think otherwise then zip up the .vbox file for that VM and post it here.
I see the "remove" function on the "Virtual Media Manager" gui. (Which, btw, I'd never seen before it popped up with this issue.) However, it is 'greyed out' even when one of the 'phantom' disks is selected.
On this output of vboxmanage showvminfo vblnxsrv01, note the last 3 disks, named asm1.vdi, asm2.vdi, and asm3.vdi.
Code: Select all
C:\>vboxmanage showvminfo vblnxsrv01
Name: vblnxsrv01
Groups: /
Guest OS: Oracle (64 bit)
UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad
Config file: C:\VMLab\VirtualBoxVMs\vblnxsrv01\vblnxsrv01.vbox
Snapshot folder: C:\VMLab\VirtualBoxVMs\vblnxsrv01\Snapshots
Log folder: C:\VMLab\VirtualBoxVMs\vblnxsrv01\Logs
Hardware UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad
<snip unrelated info>
VT-x VPID: on
Storage Controller Name (0): IDE
Storage Controller Type (0): PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 2
Storage Controller Port Count (0): 2
Storage Controller Bootable (0): on
Storage Controller Name (1): SATA
Storage Controller Type (1): IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1): 30
Storage Controller Port Count (1): 4
Storage Controller Bootable (1): on
IDE (1, 0): C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso (UUID: d44
84bca-5356-49a8-9173-2acdef3609cb)
SATA (0, 0): C:\VMLab\VirtualBoxVMs\vblnxsrv01\Snapshots\{9c38dcba-51c8-41a0-90d
7-cabc20df0c92}.vdi (UUID: 9c38dcba-51c8-41a0-90d7-cabc20df0c92)
SATA (1, 0): C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm1.vdi (UUID: e92e212d-4d8a-4aa
9-9df5-9d1bec8cfecb)
SATA (2, 0): C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm2.vdi (UUID: 480b1132-eca5-431
a-b132-bcdf0e380249)
SATA (3, 0): C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm3.vdi (UUID: 0805eff3-074c-441
b-94f5-bc72281cccda)
NIC 1: MAC: 080027D1A51C, Attachment: NAT, Cable connected: on, Trace:
<snip unrelated info>
But on the follow-up, vboxmanage list hdds, we have an additional two, asm4.vdi and asm5.vdi. These are the two disks in question. They physically do not exist. They do not show on the Virtual Box Manager gui. As said, the "Virtual Media Manager" gui has the 'remove' option greyed out.
Code: Select all
C:\>vboxmanage list hdds
UUID: 46f9249b-29d5-4b74-8eb1-26643a254b9f
Parent UUID: base
Format: VDI
Location: C:\VMLab\VirtualBoxVMs\vblnxsrv01\vblnxsrv01.vdi
State: created
Type: normal
Usage: vblnxsrv01 (UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad) [Snapshot 1
(UUID: 720a76e6-8a11-4bfe-9520-b5f4aebe1543)]
<snip other snapshots>
UUID: 9c38dcba-51c8-41a0-90d7-cabc20df0c92
Parent UUID: b6e1aeaf-b4e7-4d5c-8047-1fc252c2e304
Format: VDI
Location: C:\VMLab\VirtualBoxVMs\vblnxsrv01\Snapshots\{9c38dcba-51c8-41a0-90d
7-cabc20df0c92}.vdi
State: created
Type: normal
Usage: vblnxsrv01 (UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad)
UUID: e92e212d-4d8a-4aa9-9df5-9d1bec8cfecb
Parent UUID: base
Format: VDI
Location: C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm1.vdi
State: created
Type: shareable
Usage: vblnxsrv01 (UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad) [Snapshot 4
(UUID: 399c5fd2-c7af-423a-be0b-eccf2232283f)] [Snapshot 5 (UUID: 4ca0a0a9-1f56-
424b-b16c-6fb629825881)] [Snapshot 6 (UUID: 34a2b8e1-4ade-410b-b92d-e6ffa2e9f3b8
)]
UUID: 480b1132-eca5-431a-b132-bcdf0e380249
Parent UUID: base
Format: VDI
Location: C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm2.vdi
State: created
Type: shareable
Usage: vblnxsrv01 (UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad) [Snapshot 4
(UUID: 399c5fd2-c7af-423a-be0b-eccf2232283f)] [Snapshot 5 (UUID: 4ca0a0a9-1f56-
424b-b16c-6fb629825881)] [Snapshot 6 (UUID: 34a2b8e1-4ade-410b-b92d-e6ffa2e9f3b8
)]
UUID: 0805eff3-074c-441b-94f5-bc72281cccda
Parent UUID: base
Format: VDI
Location: C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm3.vdi
State: created
Type: shareable
Usage: vblnxsrv01 (UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad) [Snapshot 4
(UUID: 399c5fd2-c7af-423a-be0b-eccf2232283f)] [Snapshot 5 (UUID: 4ca0a0a9-1f56-
424b-b16c-6fb629825881)] [Snapshot 6 (UUID: 34a2b8e1-4ade-410b-b92d-e6ffa2e9f3b8
)]
UUID: 085308f7-6bbe-4132-ae50-fc1cfc26bd64
Parent UUID: base
Format: VDI
Location: C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm4.vdi
State: inaccessible
Type: shareable
Usage: vblnxsrv01 (UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad)
UUID: f0e31107-f578-45a4-8b3f-230f50f7f848
Parent UUID: base
Format: VDI
Location: C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm5.vdi
State: inaccessible
Type: shareable
Usage: vblnxsrv01 (UUID: d5fce4ee-ae8b-4319-a64a-10ce26a186ad)
And when I try to get rid of them with vboxmanage:
Code: Select all
C:\>vboxmanage closemedium disk C:\VMLab\VirtualBoxV
Ms\vblnxsrv01\asm5.vdi
VBoxManage.exe: error: Medium 'C:\VMLab\VirtualBoxVMs\vblnxsrv01\asm5.vdi' canno
t be closed because it is still attached to 1 virtual machines
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), componen
t Medium, interface IMedium, callee IUnknown
VBoxManage.exe: error: Context: "Close()" at line 1238 of file VBoxManageDisk.cp
p
Re: problem deleting hdds
Posted: 14. Dec 2012, 06:31
by ChipMcK
Before a disk can be removed, it must first be released
Re: problem deleting hdds
Posted: 14. Dec 2012, 11:58
by mpack
The only other reason why those buttons would be grayed out is because the VM is still running. E.g. suspended instead of shut down. It may also happen if the VM has been snapshotted since the disks were added.
Re: problem deleting hdds
Posted: 14. Dec 2012, 17:21
by edstevens
ChipMcK wrote:Before a disk can be removed, it must first be released
I tried that.
"Virtual Media Manager" and shows the two hdds in question with an alert icon. If I select one of them and click "release", nothing happens.
In other words, selecting to 'release' a selected hdd results in no direct feedback and no change in the status quo.
Re: problem deleting hdds
Posted: 14. Dec 2012, 17:23
by edstevens
mpack wrote:The only other reason why those buttons would be grayed out is because the VM is still running. E.g. suspended instead of shut down. It may also happen if the VM has been snapshotted since the disks were added.
It's not running but very well could have been snapshotted after the disks were added.
Re: problem deleting hdds
Posted: 15. Dec 2012, 09:42
by mpack
You can't delete a disk that is needed to restore a snapshot - you need to delete the snapshot(s) first. Do a backup of the VM folder before you start.
Or, clone the VM, a full clone of the current state only. The clone will have no snapshots, you can then delete the old VM entirely.
Re: problem deleting hdds
Posted: 17. Dec 2012, 16:00
by edstevens
mpack wrote:You can't delete a disk that is needed to restore a snapshot - you need to delete the snapshot(s) first. Do a backup of the VM folder before you start.
Or, clone the VM, a full clone of the current state only. The clone will have no snapshots, you can then delete the old VM entirely.
OK, the snapshot dependency makes sense. And after reading other posts on the web, it appears that VBox has some, um, issues with how it handles snapshots, so had already seen an implemented recommendation to just backup the entire directory of the vm in question.
So, given my current situation with the vm in question, is my only cleanup option to delete the snapshots?
Re: problem deleting hdds
Posted: 17. Dec 2012, 17:27
by mpack
I hate to repeat myself, so see the second line of my previous message.
Re: problem deleting hdds
Posted: 17. Dec 2012, 17:41
by edstevens
mpack wrote:I hate to repeat myself, so see the second line of my previous message.
Got it. thanks.
---
On second thought, I guess I'll play around with cloning by trial and error. Seeing as there doesn't appear to be anything in the online Help concerning it ...

Re: problem deleting hdds
Posted: 17. Dec 2012, 18:24
by noteirak
edstevens wrote:On second thought, I guess I'll play around with cloning by trial and error. Seeing as there doesn't appear to be anything in the online Help concerning it ...

There is
Re: problem deleting hdds
Posted: 17. Dec 2012, 22:07
by edstevens
noteirak wrote:edstevens wrote:On second thought, I guess I'll play around with cloning by trial and error. Seeing as there doesn't appear to be anything in the online Help concerning it ...

There is
So there is. It's a shame the "Help" facility's own search function didn't turn that up.
Ok, after going back and trying a few other searches, it appears the search facility in the Help doesn't find ANYTHING. I even tried some pretty obvious things, like "VBoxManage" and "showhdinfo". Nothing.