Bug 834436 - installer should verify the java version used
installer should verify the java version used
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup (Show other bugs)
3.1.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Juan Hernández
Ilanit Stein
integration
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-21 17:21 EDT by Itamar Heim
Modified: 2015-09-22 09 EDT (History)
7 users (show)

See Also:
Fixed In Version: si-20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:03:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
istein: needinfo+


Attachments (Terms of Use)

  None (edit)
Description Itamar Heim 2012-06-21 17:21:30 EDT
need to make sure we only work with a single version of java.
plan is for openjdk 7.
but in any case, installer needs to verify we use the version we expect.
Comment 1 Itamar Heim 2012-06-24 05:32:48 EDT
note: this isn't about rpm being deployed only, since java allows co-existence of several versions.
need to make sure our code for engine, etl and the various utilities is actually being run on java 1.7
Comment 2 Yaniv Kaul 2012-06-24 05:41:51 EDT
I'd argue that the service startup script should perform this check as well - especially as it is so easy to change default JDK.
I wonder if regardless of the default selected, we can use whatever we support.
Comment 3 Itamar Heim 2012-06-24 06:06:37 EDT
i hope/expect we'll only support openjdk 7 for 3.1.
but good point on should we verify this post installation as well (it would probably work with any java version, we just want to certify only one)
Comment 4 Ofer Schreiber 2012-08-07 08:35:01 EDT
Small update:
service is currently using Java7 explicitly, so there's no chance of any error (service wise)

Itamar- is it enough? or we should take care of external utilities as well?
We can add an alternatives check in the setup, but I'm not sure it's enough
Comment 5 Itamar Heim 2012-08-07 18:31:20 EDT
yes, some may be sensitive to it (manage domains utility relying on kerberos code/behavior, etc.)

so to KISS, we should use V7 always.
Comment 6 Juan Hernández 2012-08-28 12:05:09 EDT
The following change implements the checking of the Java version during setup:

http://gerrit.ovirt.org/7549

The engine-setup tool will find a suitable version of the Java virtual machine (OpenJDK 7 at the moment) and write its location to the service configuration file.

The service will also perform a check of the version prior to running, as things can change after engine-setup runs:

http://gerrit.ovirt.org/5894

Still need to implement the check in the tools, so this bug won't be completely fixed even if these two changes are merged.
Comment 7 Juan Hernández 2012-08-28 15:53:14 EDT
The following change makes sure that the tools and the notifier use the JVM version selected by engine-setup:

http://gerrit.ovirt.org/7556
Comment 8 Juan Hernández 2012-09-02 18:04:38 EDT
The changes required to fix this bug have been merged upstream:

http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=0cffa2f9a628eb87d492716e0b2ead3cd31dade8

http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=0965366fc29920a4ed1e6aa96a38b3846ca9ffba

Note that change 5894 (check of the JVM during startup) is no longer required as the check is already performed during installation, so it has been abandoned.
Comment 10 Ilanit Stein 2012-11-11 09:47:34 EST
Juan, how can I verify this bug please?
Comment 11 Juan Hernández 2012-11-12 03:40:42 EST
Before starting the installation make sure that you have alternative JDKs installed, in particular please test with IBM JDK:

yum install java-1.7.0-ibm-devel

Also make sure it is selected as the default using the alternatives command:

[root@r6 ~]# alternatives --config java

There are 4 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
 + 2           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   3           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
*  4           /usr/lib/jvm/java-1.7.0-ibm-1.7.0.0.0.x86_64/jre/bin/java

Enter to keep the current selection[+], or type selection number: 4

During the execution of engine-setup the following message should be displayed:

Configuring JVM...

Once installation is finished the /etc/sysconfig/ovirt-engine file should contain the JAVA_HOME and it should point to the installation directory of OpenJDK:

JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64

Make sure the ovirt-engine service is started and check that it is using OpenJDK even if the IBM JDK is selected with alternatives:

# service ovirt-engine start
# ps -u ovirt
  PID TTY          TIME CMD
 2395 ?        00:00:15 java
# pmap 2395 | grep jre
0000000000400000      4K r-x--  /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.3.x86_64/jre/bin/java

Check also that the engine-config and engine-manage-domains tools work correctly.
Comment 12 Yaniv Kaul 2012-11-12 16:54:49 EST
Ilanit and I have performed exactly the above, moving to VERIFIED.

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