----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/7660/#review16639 -----------------------------------------------------------
I just see this issue. I had some test about DetachISO at the beginn of this year. I did not add a jira ticket because I think it is not the bug of CloudStack. I was using Ubuntu 12.04, and the qemu version is 1.0+noroms-0ubuntu14.3. Here is the result of my test. (1) If the Guest OS is CentOS 5.5, it works well! ISO can be Attached successfully. ISO can be detached successfully if it is not mounted in Guest OS. ISO cannot be detached if it is mounted in Guest OS (even if DetachISO many times). (mount /dev/cdrom /mnt) ISO can be detached successfully after “umount” the ISO in Guest OS (umount /mnt) ISO will be detached successfully when I add -- force flag, even if it is mounted in Guest OS. (it may be a problem) (2) If the Guest OS is Ubuntu 12.04 I create two XML files to attach and eject ISO. attach.xml <disk type='file' device='cdrom'> <source file='/root/KNOPPIX_V7.0.4bootonly-2012-08-20-EN.iso'/> <target dev='hdc' bus='ide'/> </disk> eject.xml <disk type='file' device='cdrom'> <target dev='hdc' bus='ide'/> <readonly/> </disk> a) the result of attachISO looks like random. But it does not matter, as attachISO always works well after the ISO is ejected successfully. root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml Device updated successfully root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml error: Failed to update device from attach.xml error: internal error unable to execute QEMU command 'change': Device 'drive-ide0-1-0' is locked root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml error: Failed to update device from attach.xml error: internal error unable to execute QEMU command 'change': Device 'drive-ide0-1-0' is locked root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml error: Failed to update device from attach.xml error: internal error unable to execute QEMU command 'change': Device 'drive-ide0-1-0' is locked root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml Device updated successfully b) the ISO can be detached after being ejected some times( sometimes 1, sometimes 2, sometimes N…), no matter whether ISO is mounted or not in Guest OS. root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml Device updated successfully root@cs-kvm002:~# virsh update-device i-2-17-VM eject.xml error: Failed to update device from eject.xml error: internal error unable to execute QEMU command 'eject': Device 'drive-ide0-1-0' is locked root@cs-kvm002:~# virsh update-device i-2-17-VM eject.xml error: Failed to update device from eject.xml error: internal error unable to execute QEMU command 'eject': Device 'drive-ide0-1-0' is locked root@cs-kvm002:~# virsh update-device i-2-17-VM eject.xml Device updated successfully c) if I add --force flag when DetachISO, it works. root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml Device updated successfully root@cs-kvm002:~# virsh update-device i-2-17-VM eject.xml --force Device updated successfully root@cs-kvm002:~# virsh update-device i-2-17-VM attach.xml Device updated successfully root@cs-kvm002:~# virsh update-device i-2-17-VM eject.xml --force Device updated successfully - Wei Zhou On Feb. 15, 2013, 5:02 a.m., deepti dohare wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/7660/ > ----------------------------------------------------------- > > (Updated Feb. 15, 2013, 5:02 a.m.) > > > Review request for cloudstack. > > > Description > ------- > > Currently no warning or confirmation is given or required to delete an iso > which is attached to a virtual machine. > > Fixing this issue using “force” delete option. > If an admin or a user deletes an ISO which is attached to a vm: > 1. Without force option; gives a warning that ISO is attached to vm “Failed > to delete iso. It is currently attached to virtual machine. Please detach it > before deleting”. > 2. With force option: first detach the ISO from all vms and then deletes the > ISO. > > > This addresses bug CLOUDSTACK-357. > > > Diffs > ----- > > api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java > c821775 > server/src/com/cloud/template/TemplateManagerImpl.java f9cf277 > server/src/com/cloud/vm/dao/UserVmDao.java 9fbcde3 > server/src/com/cloud/vm/dao/UserVmDaoImpl.java f2fc10b > ui/scripts/templates.js 040ce4a > > Diff: https://reviews.apache.org/r/7660/diff/ > > > Testing > ------- > > Verified locally. Tested for some cases: > > 1. Deleting iso(not attached to any vm) > 2. Deleting iso(attached to multiple vms in same domain) > 3. Deleting iso(attached to multiple vms in different domains) > > For admin/user > > > Thanks, > > deepti dohare > >