Bug 1959141 - Export to data domain of a VM that isn't running creates a snapshot that isn't removed
Summary: Export to data domain of a VM that isn't running creates a snapshot that isn'...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backup-Restore.VMs
Version: 4.4.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.5.0
: 4.5.0
Assignee: Mark Kemel
QA Contact: sshmulev
bugs@ovirt.org
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-10 18:52 UTC by Gordon Watson
Modified: 2022-04-20 06:33 UTC (History)
6 users (show)

Fixed In Version: ovirt-engine-4.5.0
Doc Type: Bug Fix
Doc Text:
Cause: When performing "Export VM to data domain, no snapshot collapse", a snapshot "Auto-generated for Clone VM" is created on source VM, copied to the destination data domain and not removed Consequence: The destination VM is created with an additional snapshot Fix: Creating the snapshot on the source VM is used for Live Clone VM, it is not necessary for Export VM to data domain. Thus, creating the snapshot on source VM is now skipped during this action, which fixes this issue Result: No additional snapshot on the destination VM after the action.
Clone Of:
Environment:
Last Closed: 2022-04-20 06:33:59 UTC
oVirt Team: Storage
Embargoed:
ahadas: ovirt-4.5?
ahadas: devel_ack+


Attachments (Terms of Use)
triggering export twice (128.82 KB, image/png)
2021-05-25 16:06 UTC, Arik
no flags Details
All snapshots are removed (57.36 KB, image/png)
2021-05-25 16:06 UTC, Arik
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 116083 0 master MERGED core: skip snapshot creation for Export VM to SD 2021-08-25 14:31:39 UTC

Description Gordon Watson 2021-05-10 18:52:56 UTC
Description of problem:

If a VM that is not running is exported to a data domain;

  1) a snapshot is unnecessarily created, "Auto-generated for Clone Live VM"
  2) the snapshot is not removed


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

RHVM 4.4.5


How reproducible:

100%


Steps to Reproduce:
1. Export a VM that is down to a data domain
2. Check snapshot in GUI or database


Actual results:


Expected results:


Additional info:

Comment 5 Arik 2021-05-25 16:06:13 UTC
Created attachment 1786916 [details]
triggering export twice

triggering export twice

Comment 6 Arik 2021-05-25 16:06:43 UTC
Created attachment 1786917 [details]
All snapshots are removed

All snapshots are removed

Comment 7 Arik 2021-05-25 18:15:55 UTC
Let me elaborate on that - 
We indeed create a snapshot also when the VM is down. It may seem redundant but the idea behind this is that this way the clone-VM operation doesn't operate on the active volume(s) but rather on a snapshot. This allows us to do things like running the VM while it is cloned.

So we create the snapshot by design during clone-VM even when the VM is down and export to data domain appears to use clone-VM - that explains why the snapshot is created also in this case.
I think that it makes sense to create the snapshot also in case of export to data domain for the same reason, but I'll let the storage team to decide on that - thus moving this bz back to the storage team.

As for the inability to remove the snapshot - I didn't manage to reproduce it.
I exported a VM twice to a data domain and afterwards the auto-generated snapshots were removed (see the attached screenshots).
We also didn't get any report about this problem for clone VM (note that it may take some time for the snapshot to be removes as the cloning needs to finish, the engine needs to detect it and only then removes the snapshot).
If there're logs that cover the failure to remove the snapshot, please share them.

Comment 8 Eyal Shenitzky 2021-05-26 06:04:14 UTC
I agree that using the clone VM flow and creating a snapshot is good behaviour also for export VM.

Regards to the snapshot removal, Gordon can you reproduce this issue?

Comment 9 Arik 2021-05-26 15:27:23 UTC
BTW, posted https://gerrit.ovirt.org/#/c/ovirt-engine/+/114959 to change the description of the snapshot from "Auto-generated for Clone Live VM" to "Auto-generated for Clone VM"

Comment 17 Arik 2021-12-13 07:48:30 UTC
Mark, please fill the "Doc Text" field

Comment 20 sshmulev 2022-03-03 15:05:58 UTC
Verified successfully.

Versions:
vdsm-4.50.0.7-1.el8ev
ovirt-engine-vdsm-4.50.0.7-1.el8ev

Steps to reproduce:
Check for two cases: VM with existing snapshot, VM without any snapshots

1. Export VM to Storage Domain, "Collapse snapshots" unchecked.
2. Verify that the target VM does not have an "Auto-generated" snapshot, but only the same snapshots that the source VM has

Actual results:
As expected - After the VM was exported to data SD, the source VM didn't have any generated snapshot and both VMs(source and exported) could run without any issues.
Could reproduce it on the previous version before the fix (ovirt-engine-vdsm-4.4.10-6) and on the latest version it doesn't reproduce anymore.

Comment 22 Sandro Bonazzola 2022-04-20 06:33:59 UTC
This bugzilla is included in oVirt 4.5.0 release, published on April 20th 2022.

Since the problem described in this bug report should be resolved in oVirt 4.5.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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