Bug 1739377 - clone VM from snapshot sets to use cloud-init
Summary: clone VM from snapshot sets to use cloud-init
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Frontend.WebAdmin
Version: 4.3.6
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ovirt-4.4.1
: ---
Assignee: Steven Rosenberg
QA Contact: Beni Pelled
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-09 07:59 UTC by Lucie Leistnerova
Modified: 2020-08-17 16:47 UTC (History)
7 users (show)

Fixed In Version: rhv-4.4.0-32
Doc Type: Bug Fix
Doc Text:
Previously, creating a snapshot did not correctly save the Cloud-Init/Sysprep settings for the guest OS. If you tried to clone a virtual machine from the snapshot, it did not have valid values to initialize the guest OS. The current release fixes this issue. Now, creating a snapshot correctly saves the the Cloud-Init/Sysprep configuration for the guest OS.
Clone Of:
Environment:
Last Closed: 2020-07-08 08:27:07 UTC
oVirt Team: Virt
Embargoed:
pm-rhel: ovirt-4.4+
sbonazzo: planning_ack?
sbonazzo: devel_ack?
sbonazzo: testing_ack?


Attachments (Terms of Use)
Initial run tabs (72.09 KB, image/png)
2019-08-09 07:59 UTC, Lucie Leistnerova
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 104794 0 'None' MERGED core: Preserves Snapshot VmInit 2020-12-10 19:03:12 UTC

Description Lucie Leistnerova 2019-08-09 07:59:51 UTC
Created attachment 1602053 [details]
Initial run tabs

Description of problem:
When I have a VM with snapshot and cloud-init is not set, cloning VM from snapshot sets to use cloud-init.

Version-Release number of selected component (if applicable):
ovirt-engine-4.3.6-0.1.el7.noarch

How reproducible:
always


Steps to Reproduce:
1. create new VM, cloud-init in Initial run is not checked
2. create snapshot on that VM
3. clone VM from the snapshot

Actual results: clound-init is checked, see attachment


Expected results: clound-init is not checked

Comment 1 Steven Rosenberg 2019-11-04 11:07:49 UTC
One can easily fix this issue by initializing the VmInit control properly within the VmSnapshotListModel.java's cloneVM function. The larger issue is that when the original VM is actually set, we are not setting the other Vm Init controls as per the original VM and we should do that as well. There are I assume other fields that we are not inheriting properly from the original VM when cloning a snap shot which would require further testing and investigation.

The Snap Shot's information is Stored within the snapshots DB Table. A design question would be if we should add the VM Init fields (as wel as any other missing data) to this DB which may cause some performance issues elsewhere, or attempt to fetch the original VM within the cloneVM function and access the original values directly (although the problem here is if the original was changed, one should clone from the snapshot which is by definition what a snap shot is).

Of cause saving more data to the snapshots DB Table seems to be the most sense, but please advise accordingly.

Comment 2 Martin Tessun 2019-11-13 11:27:41 UTC
(In reply to Steven Rosenberg from comment #1)
> One can easily fix this issue by initializing the VmInit control properly
> within the VmSnapshotListModel.java's cloneVM function. The larger issue is
> that when the original VM is actually set, we are not setting the other Vm
> Init controls as per the original VM and we should do that as well. There
> are I assume other fields that we are not inheriting properly from the
> original VM when cloning a snap shot which would require further testing and
> investigation.
> 
> The Snap Shot's information is Stored within the snapshots DB Table. A
> design question would be if we should add the VM Init fields (as wel as any
> other missing data) to this DB which may cause some performance issues
> elsewhere, or attempt to fetch the original VM within the cloneVM function
> and access the original values directly (although the problem here is if the
> original was changed, one should clone from the snapshot which is by
> definition what a snap shot is).
> 
> Of cause saving more data to the snapshots DB Table seems to be the most
> sense, but please advise accordingly.

I believe you are right here. Please check with developers in that area and test with QE if and what perfomance impacts this might have. I don't expect any serious, but we should be sure.

Thanks!
Martin

Comment 3 Beni Pelled 2020-04-23 09:02:53 UTC
Verified with:
- RHV 4.4.0-0.32.master.el8ev

Verification steps:
2. Create a VM and make sure the cloud-init is unchecked 
3. Create a snapshot
4. Clone a new VM from the snapshot and make sure the cloud-init is unchecked on the new cloned VM

Result:
- The cloud-init is not checked on the new VM cloned from the snapshot.

Comment 4 Sandro Bonazzola 2020-07-08 08:27:07 UTC
This bugzilla is included in oVirt 4.4.1 release, published on July 8th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.1 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.