Bug 1071791 - [engine-backend] [single-disk-snapshot] snapshot restore to only part of VM's disks will delete all other disks attached to the VM
Summary: [engine-backend] [single-disk-snapshot] snapshot restore to only part of VM's...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.4
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: ---
: 3.4.1
Assignee: Daniel Erez
QA Contact: Elad
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-03 07:41 UTC by Elad
Modified: 2016-02-10 16:43 UTC (History)
8 users (show)

Fixed In Version: av4
Clone Of:
Environment:
Last Closed: 2014-05-08 13:35:49 UTC
oVirt Team: Storage
Embargoed:


Attachments (Terms of Use)
engine and vdsm logs (1.01 MB, application/x-gzip)
2014-03-03 07:41 UTC, Elad
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 25539 0 None MERGED webadmin: custom snapshot preview - default disks selection Never
oVirt gerrit 25696 0 None MERGED webadmin: custom snapshot preview - default disks selection Never

Description Elad 2014-03-03 07:41:08 UTC
Created attachment 869824 [details]
engine and vdsm logs

Description of problem:
Single disk snapshot - 
When previewing and committing a snapshot of only part of VM's disks, all other disks attached to that VM, which weren't selected to be restored from snapshot will be removed from the system.

Version-Release number of selected component (if applicable):
ovirt-engine-3.4.0-0.11.beta3.el6.noarch
vdsm-4.14.3-0.el6.x86_64
libvirt-0.10.2-29.el6_5.4.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.4.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create a VM with 4 disks
2. Create a snapshot to the VM, and pick only one of the disks in the custom selection
3. Preview the new snapshot, pick only the disk snapshot and VM configuration to be pre-viewd. Commit the snapshot

Actual results:
Engine sends DeleteImage commands to vdsm for all other VM disks which their snapshots weren't committed.

Restore snapshot request and destroy/delete to all other images right after:

2014-03-03 09:23:20,772 INFO  [org.ovirt.engine.core.bll.RestoreFromSnapshotCommand] (ajp--127.0.0.1-8702-5) [c311226] Running command: RestoreFromSnapshotCommand internal: true. Entities affected :  ID: 00000000-
0000-0000-0000-000000000000 Type: Storage
2014-03-03 09:23:20,802 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DestroyImageVDSCommand] (ajp--127.0.0.1-8702-5) [c311226] START, DestroyImageVDSCommand( storagePoolId = 00000002-0002-0002-0002-0000000003d
c, ignoreFailoverLimit = false, storageDomainId = c7383dde-28da-4946-81b1-d13dadc795cb, imageGroupId = cc8d093f-e1ac-4136-b567-57b315c58020, imageId = 00000000-0000-0000-0000-000000000000, imageList = [1867ae18-36
20-4853-8354-02cd762bff7e], postZero = false, force = true), log id: 4174636c
2014-03-03 09:23:20,842 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DestroyImageVDSCommand] (ajp--127.0.0.1-8702-5) [c311226] FINISH, DestroyImageVDSCommand, log id: 4174636c
2014-03-03 09:23:20,861 INFO  [org.ovirt.engine.core.bll.CommandAsyncTask] (ajp--127.0.0.1-8702-5) [c311226] CommandAsyncTask::Adding CommandMultiAsyncTasks object for command 8913bf2a-5a02-485f-b6a8-618f548e78a8
2014-03-03 09:23:20,862 INFO  [org.ovirt.engine.core.bll.CommandMultiAsyncTasks] (ajp--127.0.0.1-8702-5) [c311226] CommandMultiAsyncTasks::AttachTask: Attaching task 81f13c3e-a93b-431f-b458-a65a6f3d351a to command
 8913bf2a-5a02-485f-b6a8-618f548e78a8.
2014-03-03 09:23:20,882 INFO  [org.ovirt.engine.core.bll.AsyncTaskManager] (ajp--127.0.0.1-8702-5) [c311226] Adding task 81f13c3e-a93b-431f-b458-a65a6f3d351a (Parent Command RestoreAllSnapshots, Parameters Type or
g.ovirt.engine.core.common.asynctasks.AsyncTaskParameters), polling hasn't started yet..
2014-03-03 09:23:20,896 INFO  [org.ovirt.engine.core.bll.RemoveImageCommand] (ajp--127.0.0.1-8702-5) [b3c6a24] Running command: RemoveImageCommand internal: true. Entities affected :  ID: 00000000-0000-0000-0000-0
00000000000 Type: Storage
2014-03-03 09:23:20,918 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DeleteImageGroupVDSCommand] (ajp--127.0.0.1-8702-5) [b3c6a24] START, DeleteImageGroupVDSCommand( storagePoolId = 00000002-0002-0002-0002-000
0000003dc, ignoreFailoverLimit = false, storageDomainId = c7383dde-28da-4946-81b1-d13dadc795cb, imageGroupId = 8125c6af-7927-45ac-8a5b-8d3a2aa57e85, postZeros = false, forceDelete = false), log id: 71b5f15f
2014-03-03 09:23:24,156 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DeleteImageGroupVDSCommand] (ajp--127.0.0.1-8702-5) [b3c6a24] FINISH, DeleteImageGroupVDSCommand, log id: 71b5f15f
2014-03-03 09:23:24,164 INFO  [org.ovirt.engine.core.bll.CommandMultiAsyncTasks] (ajp--127.0.0.1-8702-5) [b3c6a24] CommandMultiAsyncTasks::AttachTask: Attaching task a6151ea7-279a-4b6e-a1e2-2fd3ac9d8856 to command
 8913bf2a-5a02-485f-b6a8-618f548e78a8.
2014-03-03 09:23:24,177 INFO  [org.ovirt.engine.core.bll.AsyncTaskManager] (ajp--127.0.0.1-8702-5) [b3c6a24] Adding task a6151ea7-279a-4b6e-a1e2-2fd3ac9d8856 (Parent Command RestoreAllSnapshots, Parameters Type org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters), polling hasn't started yet..
2014-03-03 09:23:24,326 INFO  [org.ovirt.engine.core.bll.RemoveImageCommand] (ajp--127.0.0.1-8702-5) [10543639] Running command: RemoveImageCommand internal: true. Entities affected :  ID: 00000000-0000-0000-0000-000000000000 Type: Storage
2014-03-03 09:23:24,335 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DeleteImageGroupVDSCommand] (ajp--127.0.0.1-8702-5) [10543639] START, DeleteImageGroupVDSCommand( storagePoolId = 00000002-0002-0002-0002-0000000003dc, ignoreFailoverLimit = false, storageDomainId = c7383dde-28da-4946-81b1-d13dadc795cb, imageGroupId = e3f6aa01-3004-4dc2-b585-779e212c7466, postZeros = false, forceDelete = false), log id: 3957261e
2014-03-03 09:23:26,812 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DeleteImageGroupVDSCommand] (ajp--127.0.0.1-8702-5) [10543639] FINISH, DeleteImageGroupVDSCommand, log id: 3957261e
2014-03-03 09:23:26,819 INFO  [org.ovirt.engine.core.bll.CommandMultiAsyncTasks] (ajp--127.0.0.1-8702-5) [10543639] CommandMultiAsyncTasks::AttachTask: Attaching task d1a83ea5-4567-4113-86d0-c6be391d4ffa to command 8913bf2a-5a02-485f-b6a8-618f548e78a8.

=============

vdsm.log:

Thread-40619::INFO::2014-03-03 09:23:24,342::logUtils::44::dispatcher::(wrapper) Run and protect: deleteImage(sdUUID='c7383dde-28da-4946-81b1-d13dadc795cb', spUUID='00000002-0002-0002-0002-0000000003dc', imgUUID='
e3f6aa01-3004-4dc2-b585-779e212c7466', postZero='false', force='false')


Expected results:
If only part of the VM's disks are being requested to be restored, other VM's disks should remain attached to that VM without any change to their volumes chain. DeleteImage should not be sent for other VM's disks 

Additional info: engine and vdsm logs

Comment 1 Daniel Erez 2014-03-03 14:34:41 UTC
Hi Elad,

Which disks have been available in the active VM before committing?
If only the one disk selected for preview was presented, then 
this behavior is by design. To preview a snapshot of a single
disk while keeping the others, the disks should be selected in "Active VM" row.

Comment 2 Elad 2014-03-03 14:52:38 UTC
(In reply to Daniel Erez from comment #1)
> Hi Elad,
> 
> Which disks have been available in the active VM before committing?
All disks were available to be selected as 'active vm' in custom preview, but their check-boxes were unchecked as default. So if user decides to take a snapshot of only one of the VM's disks and to restore the VM from that snapshot, as default, only the disk which has a snapshot in that VM-snapshot instance will be selected and restored, all other disks will be deleted.

Comment 3 Daniel Erez 2014-03-03 16:24:32 UTC
(In reply to Elad from comment #2)
> (In reply to Daniel Erez from comment #1)
> > Hi Elad,
> > 
> > Which disks have been available in the active VM before committing?
> All disks were available to be selected as 'active vm' in custom preview,
> but their check-boxes were unchecked as default. So if user decides to take
> a snapshot of only one of the VM's disks and to restore the VM from that
> snapshot, as default, only the disk which has a snapshot in that VM-snapshot
> instance will be selected and restored, all other disks will be deleted.

So, IIUC, the problem is only with the default selection rather than the behavior. We can add logic for selecting the active VM disks in such scenarios

Comment 4 Sandro Bonazzola 2014-03-04 09:25:30 UTC
This is an automated message.
Re-targeting all non-blocker bugs still open on 3.4.0 to 3.4.1.

Comment 5 Elad 2014-04-30 11:07:59 UTC
When custom previewing a snapshot of a VM, all disks have check-box checked by default, even if not all of them are included in a snapshot.

Verified using AV7

Comment 6 Sandro Bonazzola 2014-05-08 13:35:49 UTC
This is an automated message

oVirt 3.4.1 has been released:
 * should fix your issue
 * should be available at your local mirror within two days.

If problems still persist, please make note of it in this bug report.


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