Bug 1149575

Summary: engine-setup accepts an answer file with an invalid value for applicationMode
Product: Red Hat Enterprise Virtualization Manager Reporter: Ulhas Surse <usurse>
Component: ovirt-engineAssignee: Simone Tiraboschi <stirabos>
Status: CLOSED ERRATA QA Contact: Gonza <grafuls>
Severity: medium Docs Contact:
Priority: high    
Version: 3.4.0CC: amureini, bazulay, didi, iheim, juwu, kmayilsa, lpeer, lsurette, lveyde, oourfali, pstehlik, rbalakri, Rhev-m-bugs, sabose, sbonazzo, stirabos, tnisan, usurse, yeylon, ykaul, ylavi
Target Milestone: ovirt-3.6.0-rcKeywords: ZStream
Target Release: 3.6.0   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, when running engine-setup with an already generated answer file that included invalid values, the setup process did not return errors but some options were missing from the GUI after the setup. This bug fix adds in error validation so appropriate options are available in the GUI after setup.
Story Points: ---
Clone Of:
: 1208440 (view as bug list) Environment:
Last Closed: 2016-03-09 20:40:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1208440    

Description Ulhas Surse 2014-10-06 06:56:32 UTC
Description of problem:
Install RHEVM with kikstart or with a configuration file, in RHEVM GUI under cluster edit options  "Enable Virt Service" & "Enable Gluster Service"  are not available. 

Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization 3.4

How reproducible:

Steps to Reproduce:
1. Install RHEVM with answer-file
# engine-setup --generate-answer=/tmp/answer_file
after changing options:
# engine-setup --config-append=/tmp/answer_file

2. Go to clusters --> edit cluster

Actual results:
"Enable Virt Service" & "Enable Gluster Service" not available.

Expected results:
3. "Enable Virt Service" & "Enable Gluster Service" should be shown.

Additional info:
What could be the answer file setting or options to tweak the options in GUI? 
Tried following but didn't worked:

1_ In answer file:

Virt Engine Configuration:
Select Gluster, Virt, or Both:
Application mode (Both, Virt, Gluster) [Both]:

OVESETUP_CONFIG/applicationMode=str:(virt/Gluster/Both)  <<=====

2_ From rhevm-shell:
[RHEVM shell (connected)]# update cluster Default --virt_service false --gluster_service true
[RHEVM shell (connected)]# update cluster Default --virt_service true --gluster_service false

both can't be true at the same time. Also it does not show GUI option instead enables that service only.So the second option could be a workaround.

Comment 6 Kanagaraj 2014-10-13 09:49:46 UTC
'AllowClusterWithVirtGlusterEnabled' is used to decide whether the user is allowed to create a hybrid(virt+gluster) cluster or not. There is backend validation which checks for this. In this UI, if this option is true 'checkbox' will be shown else 'radiobutton' will be shown. But this doesn't hide the options itself.

- ApplicationMode is virt then, 
 both the options will be hidden but assumed 
 virt=true and gluster=false while creating a cluster. 

- Application mode is gluster then, 
 both the options will be hidden but assumed 
 virt=false and gluster=true while creating a new cluster. 

- Application mode is Both then,
 both the options are visible, user can select whatever required while creating a new cluster.

Comment 8 Kanagaraj 2014-10-27 11:16:09 UTC
'ApplicationMode' value in the configuration database needs to be changed to 255. This will enable both Virt and Gluster features.

Comment 9 Sahina Bose 2014-11-21 12:47:49 UTC
Is there anything to do on gluster side? This seems to be an issue with the value stored for 'ApplicationMode' in vdc_options on upgrade.

Comment 10 Sahina Bose 2015-01-16 12:53:18 UTC
Any update on the info requested?

Comment 11 Allon Mureinik 2015-02-12 09:46:37 UTC
Tal? Sandro? Can you please address comment #9?

Comment 12 Sandro Bonazzola 2015-02-20 11:21:47 UTC
Allon, not sure about what happens there. we'll try to reproduce.

Comment 13 Yaniv Lavi 2015-03-23 11:03:55 UTC
Can you please investigate this?

Comment 14 Oved Ourfali 2015-03-23 11:41:08 UTC
This one is integration.

Comment 15 Sandro Bonazzola 2015-03-24 13:25:33 UTC
Simone, please check if setting

OVESETUP_CONFIG/applicationMode=str:(virt/Gluster/Both)  <<=====

reproduce the issue.
Looks like an error in the configuration file.
Maybe we're missing a validation on this.

Comment 16 Simone Tiraboschi 2015-03-24 14:53:56 UTC
It was treating any invalid string like '(virt/Gluster/Both)' as 'virt' without reporting any explicit error or exception.

 select fn_db_update_config_value('ApplicationMode', '255', 'general')
directly on the DB and restarting the engine should be enough to recover a broken deployment.

Comment 17 Sandro Bonazzola 2015-03-31 13:42:02 UTC
hi Ulhas,
can you provide solution from comment #16 to the customer?

On the engine host:

 . /etc/ovirt-engine/engine.conf.d/10-setup-database.conf
    -U ${ENGINE_DB_USER} \
    -h "${ENGINE_DB_HOST}" \
    -p "${ENGINE_DB_PORT}" \
    -c "select fn_db_update_config_value('ApplicationMode', '255', 'general')"

should solve the issue.
On  the code side the fix will be available in 3.5.3

Comment 20 Gonza 2015-04-20 09:01:01 UTC
Verified with:

Both options "Enable Virt Service" & "Enable Gluster Service" are available after re-running engine-setup with the already generated answer_file.

Comment 22 errata-xmlrpc 2016-03-09 20:40:51 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.