Bug 1530223 - Template Seal option is not triggered via rest api in 4.1
Summary: Template Seal option is not triggered via rest api in 4.1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.1.9
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ovirt-4.1.10
: ---
Assignee: Shmuel Melamud
QA Contact: Israel Pinto
URL:
Whiteboard:
Depends On:
Blocks: 1525242
TreeView+ depends on / blocked
 
Reported: 2018-01-02 10:09 UTC by Ilanit Stein
Modified: 2019-05-16 13:08 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-20 16:37:08 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0562 0 None None None 2018-03-20 16:37:55 UTC
oVirt gerrit 87540 0 ovirt-engine-4.1 MERGED restapi: Implement 'seal' parameter for creation of a template 2020-08-12 14:08:05 UTC

Description Ilanit Stein 2018-01-02 10:09:37 UTC
Description of problem:
masayag investigated this CFME/RHV bug:
Bug 1525242 - [RHV] Template Seal option, chosen as part of Publish VM to a template dialog is not working.

and found the following:
  
"
When tested against ovirt-engine-4.2.0, a sealed RHEL template was created successfully.

However, I tested just the creation of template via rest-client,
against ovirt-engine-4.1.8, and the sealing option wasn't triggered. 

It indicates ovirt-engine restapi or virt issue why that option isn't working anymore.

I sent via POST to the following url:
https://istein-rhv40.scl.lab.tlv.redhat.com/ovirt-engine/api/templates?seal=true

this body:
<template>
  <name>mysealedtemplate</name>
  <vm>
    <name>rhel_pass</name>
  </vm>
</template>

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

"

How reproducible:
100% , via REST PAI. 


Additional info:
This bug seem to be a ovirt-engine restapi or virt issue.

Comment 1 Michal Skrivanek 2018-01-02 12:26:35 UTC
seems nothing was invoked yet the task went well in vdsm - Shmuel, where are the logs for virt-sysprep?

Comment 4 Shmuel Melamud 2018-01-04 19:37:52 UTC
Seems like debug logging is not turned on in VDSM - there are no debug messages in the log. virt-sysprep output is logged on debug level. 

Other messages in the logs show that the option actually works - the whole sequence of creating a sealed template have been executed. So REST API and the Engine are working correctly and the issue is likely on the host side.

Comment 5 Ilanit Stein 2018-01-15 10:13:10 UTC
This bug is blocking verification of CFME/RHV bug 1525242.

The CF-4.6 (Major version) GA date is Feb 20.

Can we have this bug targeted to RHV-4.1.9 please, 
so we'll be able to verify that CFME bug on time for CFME GA?

Comment 8 Shmuel Melamud 2018-01-21 16:02:42 UTC
I see that the disk you're testing on is located on iSCSI domain. So it is the same issue as in bug 1516689.

*** This bug has been marked as a duplicate of bug 1516689 ***

Comment 9 Ilanit Stein 2018-01-29 15:07:52 UTC
I tested CFME-5.9.0.18/RHV-4.1.8 - That has only NFS storage included.

For a RHEL-7.4 VM, that had /root/.ssh/known_hosts file, with content,
from CFME side, I've run publish VM to a template, and marked the sealing option.

Then I created a VM from this new template, and run it.
This VM contained the original /root/.ssh/known_hosts.
So the seal template didn't work,
and this flow is for VM with NFS disk, and not ISCSI.

Shmuel,

Would you please take a look?
I can provide all required details offline.

Thanks.

Comment 10 Shmuel Melamud 2018-02-12 20:25:30 UTC
I see that REST API support of template sealing wasn't backported to 4.1 branch.

Comment 11 Shmuel Melamud 2018-02-12 21:05:34 UTC
Please, set the Target Release/Milestone as needed.

Comment 12 Ilanit Stein 2018-02-15 08:58:56 UTC
Add need info on michal.skrivanek per comment 11.

Comment 16 RHV bug bot 2018-02-22 16:01:58 UTC
WARN: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.1.z': '?'}', ]

For more info please contact: rhv-devops: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.1.z': '?'}', ]

For more info please contact: rhv-devops

Comment 17 RHV bug bot 2018-02-22 16:07:40 UTC
WARN: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.1.z': '?'}', ]

For more info please contact: rhv-devops: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.1.z': '?'}', ]

For more info please contact: rhv-devops

Comment 18 Israel Pinto 2018-02-25 14:38:49 UTC
Verify with:
Red Hat Virtualization Manager Version: 4.1.10.1-0.1.el7

Test with POST to the following url:
https://<engine-fqdn>/ovirt-engine/api/templates?seal=true
this body:
<template>
   <name>sealed_template</name>
     <vm id=<VM_ID>>
         <disk_attachments>
             <disk_attachment>
                 <disk id=<DISK_ID>>
                     <alias>"DISK_ALIAS"</alias>
                     <format>cow</format>
                     <sparse>true</sparse>
                 </disk>
             </disk_attachment>
         </disk_attachments>
     </vm>
</template>

engine log:
2018-02-25 16:03:26,895+02 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-62) [11b6c344-8d33-4f8c-b861-a252c24e2376] EVENT_ID: USER_ADD_VM_TEMPLATE(48), Correlation ID: 11b6c344-8d33-4f8c-b861-a252c24e2376, Job ID: e585f5a2-8cb6-4d96-9c28-a1ed4af81769, Call Stack: null, Custom ID: null, Custom Event ID: -1, Message: Creation of Template sealed_template from VM golden_env_mixed_virtio_5 was initiated by admin@internal-authz.
...
...
2018-02-25 16:06:06,569+02 INFO  [org.ovirt.engine.core.bll.AddVmTemplateCommand] (DefaultQuartzScheduler1) [11b6c344-8d33-4f8c-b861-a252c24e2376] Lock freed to object 'EngineLock:{exclusiveLocks='[sealed_template=TEMPLATE_NAME, 67824c2b-d65f-434f-9438-404f5221fb8b=TEMPLATE, 3515af92-d771-4292-9b6d-f7da573bcb86=DISK]', sharedLocks='[9604896d-cb2c-4eec-98dc-b08d18a0c6aa=VM]'}'
2018-02-25 16:06:06,583+02 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (DefaultQuartzScheduler1) [11b6c344-8d33-4f8c-b861-a252c24e2376] EVENT_ID: USER_ADD_VM_TEMPLATE_FINISHED_SUCCESS(51), Correlation ID: 11b6c344-8d33-4f8c-b861-a252c24e2376, Job ID: e585f5a2-8cb6-4d96-9c28-a1ed4af81769, Call Stack: null, Custom ID: null, Custom Event ID: -1, Message: Creation of Template sealed_template from VM golden_env_mixed_virtio_5 has been completed.

Comment 23 errata-xmlrpc 2018-03-20 16:37:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHBA-2018:0562

Comment 24 Franta Kust 2019-05-16 12:54:29 UTC
BZ<2>Jira re-sync

Comment 25 Franta Kust 2019-05-16 13:08:16 UTC
BZ<2>Jira Resync


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