Bug 1098638

Summary: smartcard entries are duplicated every time a template is saved, resulting in unbootable VMs
Product: Red Hat Enterprise Virtualization Manager Reporter: James W. Mills <jamills>
Component: ovirt-engine-webadmin-portalAssignee: Omer Frenkel <ofrenkel>
Status: CLOSED ERRATA QA Contact: Lukas Svaty <lsvaty>
Severity: high Docs Contact:
Priority: high    
Version: 3.3.0CC: ecohen, iheim, juwu, lsvaty, mavital, michal.skrivanek, pbandark, rbalakri, Rhev-m-bugs, sherold, yeylon
Target Milestone: ---Keywords: ZStream
Target Release: 3.5.0   
Hardware: All   
OS: Linux   
Whiteboard: virt
Fixed In Version: 3.5.0-0.2.master Doc Type: Bug Fix
Doc Text:
Previously, if smartcard support was enabled on a template, every time when the template was edited and saved, a new smartcard entry was created. This eventually caused virtual machines to fail to boot. With this update, only one smartcard device is available for templates that have smartcard support enabled.
Story Points: ---
Clone Of:
: 1101447 (view as bug list) Environment:
Last Closed: 2015-02-11 18:02:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1101447, 1142923, 1156165    
Attachments:
Description Flags
vdsm log with multiple failures due to duplicate smartcard entries none

Description James W. Mills 2014-05-16 19:12:35 UTC
Description of problem:

If smartcard support is enabled in a template, every time the "Edit" window is opened and "OK" is pressed a new smartcard entry is created.

Even if no changes were made to the template, if "OK" is pressed, a duplicate is added.

Since qemu does not handle multiple smartcards, any VM created from a template with more than one smartcard will fail to boot.


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

rhevm-3.3.2-0.50

How reproducible:

100%

Steps to Reproduce:
1. Create a template (I used win2k8)
2. Enable smartcard support in the template
3. Edit the template, make no changes, and press "OK"

Actual results:

Duplicate smartcard entrries are created

Expected results:

The single smartcard device is persisted, but no new ones are added.

Additional info:

* Initial template with no smartcard(ID a11f8bb7-529f-472e-8296-052e689ae0d7)

engine=# select count(*) from vm_device where type = 'smartcard' and vm_id = 'a11f8bb7-529f-472e-8296-052e689ae0d7';
 count 
-------
     0

* Edit the template, add smartcard support ("Show Advanced Options" -> Console -> Smartcard Enabled)

engine=# select count(*) from vm_device where type = 'smartcard' and vm_id = 'a11f8bb7-529f-472e-8296-052e689ae0d7';
 count 
-------
     1
* Edit the template again, but make no changes.  Just click "OK"

engine=# select count(*) from vm_device where type = 'smartcard' and vm_id = 'a11f8bb7-529f-472e-8296-052e689ae0d7';
 count 
-------
     2


* Repeat 4 more times

engine=# select count(*) from vm_device where type = 'smartcard' and vm_id = 'a11f8bb7-529f-472e-8296-052e689ae0d7';
 count 
-------
     6

Comment 1 James W. Mills 2014-05-16 19:16:59 UTC
Created attachment 896504 [details]
vdsm log with multiple failures due to duplicate smartcard entries

Comment 3 Omer Frenkel 2014-08-28 07:48:09 UTC
*** Bug 1134072 has been marked as a duplicate of this bug. ***

Comment 4 Lukas Svaty 2014-09-16 13:52:41 UTC
verified in vt3

Comment 6 errata-xmlrpc 2015-02-11 18:02:06 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://rhn.redhat.com/errata/RHSA-2015-0158.html