jedi4ever / veewee

Easing the building of vagrant boxes
MIT License
4.29k stars 779 forks source link

veewee deletes wrong disk #713

Open glensc opened 11 years ago

glensc commented 11 years ago

seems after i clone some previous build vm, it now deletes disk from wrong vm, not the one i --force build. i mean i think it started after those actions.

$ veewee vbox build pld32 --force --auto --debug
Downloading vbox guest additions iso v 4.2.10 - http://download.virtualbox.org/virtualbox/4.2.10/VBoxGuestAdditions_4.2.10.iso
Checking if isofile VBoxGuestAdditions_4.2.10.iso already exists.
Full path: /home/glen/veewee/pld32/iso/VBoxGuestAdditions_4.2.10.iso

The isofile VBoxGuestAdditions_4.2.10.iso already exists.
Building Box pld32 with Definition pld32:
- force : true
- debug : true
- nogui : false
- auto : true
- redirectconsole : false
- postinstall_include : []
- postinstall_exclude : []

The isofile RCDx86_13_03_10.iso already exists.
VBoxManage unregistervm  "pld32" --delete
Deleting vm pld32
Deleting disk /home/glen/VirtualBox VMs/pld32-qboot2 Clone/pld32-qboot2 Clone-disk1.vmdk
VBoxManage closemedium disk "/home/glen/VirtualBox VMs/pld32-qboot2 Clone/pld32-qboot2 Clone-disk1.vmdk" --delete
Error: We executed a shell command and the exit status was not 0
- Command :VBoxManage closemedium disk "/home/glen/VirtualBox VMs/pld32-qboot2 Clone/pld32-qboot2 Clone-disk1.vmdk" --delete.
- Exitcode :1.
- Output   :
VBoxManage: error: Cannot delete storage: medium '/home/glen/VirtualBox VMs/pld32-qboot2 Clone/pld32-qboot2 Clone-disk1.vmdk' is still attached to the following 1 virtual machine(s): 87218dcc-a4cf-4102-a8b3-9c4f5b40088c
VBoxManage: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "DeleteStorage(progress.asOutParam())" at line 1166 of file VBoxManageDisk.cpp
VBoxManage: error: Failed to delete medium. Error code Unknown Status 0x80BB000C
VBoxManage: error: Medium '/home/glen/VirtualBox VMs/pld32-qboot2 Clone/pld32-qboot2 Clone-disk1.vmdk' cannot be closed because it is still attached to 1 virtual machines
VBoxManage: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component Medium, interface IMedium, callee nsISupports
VBoxManage: error: Context: "Close()" at line 1175 of file VBoxManageDisk.cpp

Wrong exit code for command VBoxManage closemedium disk "/home/glen/VirtualBox VMs/pld32-qboot2 Clone/pld32-qboot2 Clone-disk1.vmdk" --delete
glensc commented 11 years ago

and listvms |grep pld32 shows:

$ VBoxManage list vms |grep pld32
"pld32-qboot2 Clone" {87218dcc-a4cf-4102-a8b3-9c4f5b40088c}
"pld32-fast Clone" {08354d40-28be-4c67-9713-e44a98fbede6}
"pld32_1370547899" {159d4953-12bd-471c-8e0d-bb049096c30d}

name matches exist, but imho it should not attempt to delete just name matches partially!