Ticket #3959 (closed enhancement: fixed)
You can't delete an immutable hard disk because of child disks
|Reported by:||shay||Owned by:|
I need to create a strictly controlled build environment. I want to use a batch file and vboxmanage.exe to create and configure a VM. I also want to be able to completely remove the VM via vboxmanage.exe when I am done. Everything is possible with the exception of removing the hard disk that was added.
The vdi hard disk that I want to use is configured to be immutable. This seems to be the cause of the problem. When you create a VM using an immutable hard disk a differencing vdi child disk is automatically created. Then when it comes time to remove the VM everything can be removed except for the original immutable hard disk. This is because you get an error that the hard disk has child hard disks. The batch file doesn't know the name of these child hard disks.
The "closemedium" option should have an option to remove (and optionally delete) all child hard disks.
Error being experienced:
ERROR: Hard disk '<NULL>' has 28833136 child hard disks Details: code E_FAIL (0x80004005), component HardDisk, interface IHardDisk, call ee IUnknown Context: "Close()" at line 1486 of file VBoxManageDisk.cpp