Created attachment 1288845 [details] engine and vdsm logs Description of problem: When trying to remove a copy of template disk that found on block-based storage domain, the operation failed if the domain is the master storage domain (and the disk copy created before the domain become the master storage domain) and the disk move to 'illegal' state. When trying to create a VM from the template with the illegal disk, the operation succeeds and the disk return to 'ok' state. Engine log: 017-06-18 16:28:00,201+03 ERROR [org.ovirt.engine.core.bll.storage.disk.image.RemoveImageCommand] (org.ovirt.thread.pool-7-thread-3) [765d4dfd-3ec2-469f-ad4e-c25ab29d93ff] Command 'org.ovirt.engine.core.bll.storage.disk.image.RemoveImageCommand' failed: EngineException: org.ovirt.engine.core.vdsbroker.irsbroker.IrsOperationFailedNoFailoverException: IRSGenericException: IRSErrorException: Shared Volume cannot be deleted: ("Cannot delete shared image b01daa49-8919-49b8-bce4-ca083223e8df. volImgs: {'fad4f7fa-7f9e-43ed-94ce-15ae1c4c375d': ImgsPar(imgs=['b01daa49-8919-49b8-bce4-ca083223e8df', '83388a88-e57b-4543-a8cf-a777c2bd632d'], parent='00000000-0000-0000-0000-000000000000')}",) (Failed with error CannotDeleteSharedVolume and code 223) Version-Release number of selected component (if applicable): Engine - 4.2.0-0.0.master.20170612192318.gitf773263.el7.centos VDSM - 4.20.0-1049.gite64d80e.el7.centos.x86_64 How reproducible: 75% Steps to Reproduce: 1. Create 2 block-based storage domains. 2. Create a template from a VM. 3. Copy the template disk to the second storage domain 4. Move the master storage domain to maintenance. 5. Try to remove the disk that found on the new master storage domain Actual results: Failed to remove the copy of the template disk and the disk become 'illegal'. Expected results: The disk should remove successfully Additional info: Engine and VDSM logs attached
Regression?
(In reply to Yaniv Kaul from comment #1) > Regression? In order words - Eyal, does this happen in 4.1.z too?
This bug report has Keywords: Regression or TestBlocker. Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.
@Eyal - CannotDeleteSharedVolume error means that there is an image based on the one you've tried to delete. Have you created a VM from that template?
(In reply to Daniel Erez from comment #4) > @Eyal - CannotDeleteSharedVolume error means that there is an image based on > the one you've tried to delete. Have you created a VM from that template? But shouldn't it be blocked by engine in that case?
(In reply to Allon Mureinik from comment #5) > (In reply to Daniel Erez from comment #4) > > @Eyal - CannotDeleteSharedVolume error means that there is an image based on > > the one you've tried to delete. Have you created a VM from that template? > But shouldn't it be blocked by engine in that case? Should be, but it may be to source of this issue if not.
Couldn't reproduce on latest build following the described scenario. Please re-open if reproduced and provide exact steps.