Description of problem: Snapshot preview removes VM's origin disks. After performing a snapshot preview, the VM's origin disks are gone Version-Release number of selected component (if applicable): 4.2.0-0.0.master.20171024223752.gite85d7f2.el7.centos How reproducible: 100% Steps to Reproduce: 1. Create snapshot for VM with disk/s 2. Preview snapshot Actual results: The disk/s are removed Expected results: Disks to remain
After undo, the VM remains with no disks and non-operational
Created attachment 1343095 [details] engine log
The root issue here is that the snapshot created without the VM's disks and without the VM's network interfaces. In the bottom line, when creating a snaphsot, it contains no disks and no networks cards. Doing undo will leave the VM completely non-operational.
Maor, this bug was introduced here: https://gerrit.ovirt.org/#/c/82429/18/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotsManager.java (see line 616) You're creating an empty ArrayList, and then iterate it, which of course does nothing, whereas the original implementation of ovfManager.importVm before the patch received this List and populated it before iterating it. Please address this ASAP.
Note that the same problem exists here: https://gerrit.ovirt.org/#/c/82429/18/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/ImagesHandler.java (line 765) Line 766 should be changed to fullEntityOvfData.setDiskImages(fullEntityOvfData.getDiskImages());
(In reply to Tal Nisan from comment #5) > Note that the same problem exists here: > > https://gerrit.ovirt.org/#/c/82429/18/backend/manager/modules/bll/src/main/ > java/org/ovirt/engine/core/bll/storage/disk/image/ImagesHandler.java (line > 765) > > Line 766 should be changed to > fullEntityOvfData.setDiskImages(fullEntityOvfData.getDiskImages()); That is not a bug since we already set this list in line 766: fullEntityOvfData.setDiskImages(snapshotImages);
I published a patch which fix the issue and also make the code a bit more clear in ImagesHandler.java (line 765)
Verified on ovirt-engine-4.2.0-0.0.master.20171027213842.gitded437c.el7.centos After preview/preview + undo the VM's disks/network interfaces still exists
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.