Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1071912 - Remove VM in preview should be blocked in the CDA phase
Summary: Remove VM in preview should be blocked in the CDA phase
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.5.0
Assignee: Maor
QA Contact: Aharon Canan
URL:
Whiteboard: storage
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-03-03 12:53 UTC by Maor
Modified: 2016-02-10 20:35 UTC (History)
10 users (show)

Fixed In Version: ovirt-engine-3.5.0_alpha1.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-16 19:08:30 UTC
oVirt Team: Storage
Target Upstream Version:


Attachments (Terms of Use)
engine log (deleted)
2014-03-03 12:53 UTC, Maor
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 25176 None None None Never

Description Maor 2014-03-03 12:53:38 UTC
Created attachment 869922 [details]
engine log

Description of problem:
Removing a VM in Preview, might leave garbage in the DB and in the Storage
if the VM had disks on the active volume but not in the snapshot.

Version-Release number of selected component (if applicable):


How reproducible:
100#

Steps to Reproduce:
1. Create a VM with Disk
2. Create a Snapshot
3. Create another Disk
4. Preview the snapshot (Now the second disk should not be present in the VM)
5. Remove the VM

Actual results:
The VM was removed but there was still a redundant data in the DB in images table and also in the Storage

Expected results:
We should block the user to remove a VM if it is in preview mode.

Additional info:
Until now there was a validation only if the user sent force flag as true.
The validation only occured in the Rest but not in the GUI

Comment 1 Maor 2014-03-03 12:57:50 UTC
DB (VM in preview):

engine=# SELECT vm_id,snapshot_id FROM snapshots where vm_id = 'e0c4b270-e445-44ef-a180-c901ad3b0d73';
                vm_id                 |             snapshot_id              
--------------------------------------+--------------------------------------
 e0c4b270-e445-44ef-a180-c901ad3b0d73 | ac2c611c-260e-4eb3-98ca-afbb719d4353
 e0c4b270-e445-44ef-a180-c901ad3b0d73 | 6e856426-1ed8-4af5-961b-3593082a49e5
 e0c4b270-e445-44ef-a180-c901ad3b0d73 | 5df9bb57-c19e-4533-97eb-8cb84afed4a4
(3 rows)


engine=# SELECT image_guid,vm_snapshot_id, image_group_id,active FROM images where vm_snapshot_id in ('ac2c611c-260e-4eb3-98ca-afbb719d4353','6e856426-1ed8-4af5-961b-3593082a49e5','5df9bb57-c19e-4533-97eb-8cb84afed4a4');
              image_guid              |            vm_snapshot_id            |            image_group_id 
           | active 
--------------------------------------+--------------------------------------+---------------------------
-----------+--------
 82807ec6-8a65-4126-a585-3223e09e2a99 | 6e856426-1ed8-4af5-961b-3593082a49e5 | 1db3d731-f22b-4bbe-9191-00
44132d18e6 | f
 77475ba5-eeb9-48cc-b809-48a02ed7a671 | 5df9bb57-c19e-4533-97eb-8cb84afed4a4 | 1db3d731-f22b-4bbe-9191-00
44132d18e6 | t
 e2074648-c8db-497d-abc2-c9a6d41519ad | ac2c611c-260e-4eb3-98ca-afbb719d4353 | 1db3d731-f22b-4bbe-9191-00
44132d18e6 | f
 c56bf091-d0d1-47c2-ac63-baccdaa21254 | 6e856426-1ed8-4af5-961b-3593082a49e5 | 0f101d32-ccd9-4b1f-aa69-e7
c10c1c9da1 | t
(4 rows)








DB (VM after remove):

engine=# SELECT image_guid,vm_snapshot_id, image_group_id,active FROM images where vm_snapshot_id in ('ac2c611c-260e-4eb3-98ca-afbb719d4353','6e856426-1ed8-4af5-961b-3593082a49e5','5df9bb57-c19e-4533-97eb-8cb84afed4a4');
              image_guid              |            vm_snapshot_id            |            image_group_id 
           | active 
--------------------------------------+--------------------------------------+---------------------------
-----------+--------
 c56bf091-d0d1-47c2-ac63-baccdaa21254 | 6e856426-1ed8-4af5-961b-3593082a49e5 | 0f101d32-ccd9-4b1f-aa69-e7
c10c1c9da1 | t
(1 row)

engine=# SELECT vm_id,snapshot_id FROM snapshots where vm_id = 'e0c4b270-e445-44ef-a180-c901ad3b0d73'; vm_id | snapshot_id 
-------+-------------
(0 rows)

Comment 2 Elad 2014-05-28 09:19:57 UTC
Remove VM is now blocked in case the a snapshot of the VM is previewed.

2014-05-28 12:16:41,127 WARN  [org.ovirt.engine.core.bll.RemoveVmCommand] (ajp--127.0.0.1-8702-9) [11d42f46] CanDoAction of action RemoveVm failed. Reasons:VAR__ACTION__REMOVE,VAR__TYPE__VM,ACTION_TYPE_FAILED_VM_IN_PREVIEW


Verified using  ovirt-engine-3.5.0_alpha1.1:
ovirt-engine-3.5.0-0.0.master.20140519181229.gitc6324d4.el6.noarch

Against RHEV-3.4-AV9.2

Comment 3 Allon Mureinik 2015-02-16 19:08:30 UTC
RHEV-M 3.5.0 has been released, closing this bug.


Note You need to log in before you can comment on or make changes to this bug.