Bug 834436 - installer should verify the java version used
Summary: installer should verify the java version used
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-setup
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Juan Hernández
QA Contact: Ilanit Stein
URL:
Whiteboard: integration
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-21 21:21 UTC by Itamar Heim
Modified: 2015-09-22 13:09 UTC (History)
7 users (show)

Fixed In Version: si-20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-04 20:03:28 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:
istein: needinfo+


Attachments (Terms of Use)

Description Itamar Heim 2012-06-21 21:21:30 UTC
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 09:32:48 UTC
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 09:41:51 UTC
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 10:06:37 UTC
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 12:35:01 UTC
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 22:31:20 UTC
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 16:05:09 UTC
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 19:53:14 UTC
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 22:04:38 UTC
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 14:47:34 UTC
Juan, how can I verify this bug please?

Comment 11 Juan Hernández 2012-11-12 08:40:42 UTC
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 21:54:49 UTC
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.