Bug 1171488

Summary: [engine-backend] Disk, attached to a stateless VM, is being deleted once the VM is stopped
Product: Red Hat Enterprise Virtualization Manager Reporter: Elad <ebenahar>
Component: ovirt-engineAssignee: Arik <ahadas>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: ecohen, gklein, iheim, lpeer, lsurette, michal.skrivanek, rbalakri, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.5.1   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: virt
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-08 15:04:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine.log none

Description Elad 2014-12-07 16:56:37 UTC
Created attachment 965598 [details]
engine.log

Description of problem:
I've encountered a scenario in which a disk, which was hotplugged to a stateless VM, got deleted from the setup when the VM was powered-off.


Version-Release number of selected component (if applicable):
rhev 3.5 vt13.1
rhevm-3.5.0-0.23.beta.el6ev.noarch

How reproducible:
Always

Steps to Reproduce:
1) Created a VM with 1 disk attached and started it as stateless
2) Attached a second disk to the VM as active while the VM was running
3) Powered off the VM

Actual results:
Once the VM stopped, the new disk got removed from the system

Destroy for the stateless VM and right after, RemoveImageCommand for the hotplugged disk:

2014-12-07 18:35:57,652 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DestroyImageVDSCommand] (org.ovirt.thread.pool-7-thread-28) [290f86bd] START, DestroyImageVDSCommand( storagePoolId = 00000002-0002-0002-0002-0000000000cd, ignoreFailoverLimit = false, storageDomainId = eb789b25-d780-44a5-9ba4-237e104b9f0f, imageGroupId = 9df3f8b3-ac94-4f98-acfc-65e96cdec95e, imageId = 00000000-0000-0000-0000-000000000000, imageList = [cfb108e4-8222-4558-89f2-4638b131ea6c], postZero = false, force = true), log id: 2a226d1
2014-12-07 18:35:57,745 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DestroyImageVDSCommand] (org.ovirt.thread.pool-7-thread-28) [290f86bd] FINISH, DestroyImageVDSCommand, log id: 2a226d1
2014-12-07 18:35:57,746 INFO  [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (org.ovirt.thread.pool-7-thread-28) [290f86bd] CommandAsyncTask::Adding CommandMultiAsyncTasks object for command 8833dbb4-f682-407b-952c-426a226ce69d
2014-12-07 18:35:57,746 INFO  [org.ovirt.engine.core.bll.CommandMultiAsyncTasks] (org.ovirt.thread.pool-7-thread-28) [290f86bd] CommandMultiAsyncTasks::AttachTask: Attaching task ac63487e-71b3-4ed6-85a3-a74676fac744 to command 8833dbb4-f682-407b-952c-426a226ce69d.
2014-12-07 18:35:57,765 INFO  [org.ovirt.engine.core.bll.tasks.AsyncTaskManager] (org.ovirt.thread.pool-7-thread-28) [290f86bd] Adding task ac63487e-71b3-4ed6-85a3-a74676fac744 (Parent Command RestoreAllSnapshots, Parameters Type org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters), polling hasn't started yet..
2014-12-07 18:35:57,841 INFO  [org.ovirt.engine.core.bll.RemoveImageCommand] (org.ovirt.thread.pool-7-thread-28) [41e0d91a] Running command: RemoveImageCommand internal: true. Entities affected :  ID: 00000000-0000-0000-0000-000000000000 Type: Storage
2014-12-07 18:35:57,912 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DeleteImageGroupVDSCommand] (org.ovirt.thread.pool-7-thread-28) [41e0d91a] START, DeleteImageGroupVDSCommand( storagePoolId = 00000002-0002-0002-0002-0000000000cd, ignoreFailoverLimit = false, storageDomainId = eb789b25-d780-44a5-9ba4-237e104b9f0f, imageGroupId = 71d10b74-1276-4c47-861e-972de6289f9e, postZeros = false, forceDelete = false), log id: 69ca5876
2014-12-07 18:35:58,394 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DeleteImageGroupVDSCommand] (org.ovirt.thread.pool-7-thread-28) [41e0d91a] FINISH, DeleteImageGroupVDSCommand, log id: 69ca5876
2014-12-07 18:35:58,396 INFO  [org.ovirt.engine.core.bll.CommandMultiAsyncTasks] (org.ovirt.thread.pool-7-thread-28) [41e0d91a] CommandMultiAsyncTasks::AttachTask: Attaching task c2881f7a-50d2-4887-9c51-5323695d88f6 to command 8833dbb4-f682-407b-952c-426a226ce69d.


Expected results:
It's a tricky scenario. When a stateless VM is stopped, restore VM from snapshot is executed and all the data written while the VM was up is dicarted. But, regarding the attached disk, it should not be removed from the system, it should be detached from the VM. Engine should inform that the disk will be detached once the VM will be powered off. 


Additional info: engine.log

Comment 1 Michal Skrivanek 2014-12-07 21:52:31 UTC
not a regression, moving to 3.5.1

Comment 2 Arik 2014-12-08 15:04:24 UTC

*** This bug has been marked as a duplicate of bug 1161204 ***