Bug 837247

Summary: RHEV-M can't list all RHEV-H images in upgrade drop-down list.
Product: Red Hat Enterprise Virtualization Manager Reporter: cshao <cshao>
Component: ovirt-engineAssignee: Barak <bazulay>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: urgent    
Version: 3.0.5CC: chchen, dyasny, ecohen, gouyang, hadong, iheim, leiwang, lpeer, masayag, mburns, mkalinin, oramraz, Rhev-m-bugs, sgrinber, ycui, yeylon, ykaul
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-23 06:56:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
upgrade drop-down list
none
A script to generate missing .txt files none

Description cshao 2012-07-03 10:01:34 UTC
Created attachment 595922 [details]
upgrade drop-down list

Description of problem:
RHEV-M can't list all RHEV-H images in upgrade drop-down list.
In actually, there are some rhev-h images store in folder /usr/share/rhev-hypervisor.

Version-Release number of selected component (if applicable):
rhev-hypervisor6-6.3-20120702.0.el6_3
rhevm IC 156.2 (rhevm-setup-3.0.5_0001-4.el6_3.x86_64)

How reproducible:
100%

Steps to Reproduce:
1. Install RHEV-M IC 156.2 version.
2. Register RHEV-H to RHEV-M and set it to UP.
3. Maintain RHEV-H.
4. Upgrade RHEV-H via RHEV-M.
5. Focus on upgrade drop-down list.
  
Actual results:
1. Only "6.3" can be choose in the upgrade drop-down list even if there are some rhev-h images store in folder /usr/share/rhev-hypervisor.

Expected results:
All rhev-h images which store in folder /usr/share/rhev-hypervisor can show in rhev-m upgrade drop-down list

Additional info:
No such issue in old RHEVM IC 155.1 version.

Comment 2 Simon Grinberg 2012-07-03 13:52:35 UTC
Can you please list all the other version that currently exist in /usr/share/rhev-hypervisor ?

Comment 3 Einav Cohen 2012-07-03 14:00:28 UTC
To explain Simon's reason for his question in comment #2: The versions that will appear in the "RHEV-H ISO Name" drop-down are only available versions that their "major" part is the same as the "major" part of the current RHEV-H version.
E.g. if the RHEV-H Host current version is "6.3" and I have RHEV-H ISOs of versions 5.8, 5.9, 6.2, 6.3, 6.4 in "/usr/share/rhev-hypervisor", I will see in the drop down only versions that begin with "6", i.e., 6.2, 6.3, 6.4.

Comment 4 Mike Burns 2012-07-03 17:16:12 UTC
(In reply to comment #3)
> To explain Simon's reason for his question in comment #2: The versions that
> will appear in the "RHEV-H ISO Name" drop-down are only available versions
> that their "major" part is the same as the "major" part of the current
> RHEV-H version.
> E.g. if the RHEV-H Host current version is "6.3" and I have RHEV-H ISOs of
> versions 5.8, 5.9, 6.2, 6.3, 6.4 in "/usr/share/rhev-hypervisor", I will see
> in the drop down only versions that begin with "6", i.e., 6.2, 6.3, 6.4.

Why, exactly, are we suppressing the minor part of the version?  That's a fairly crucial bit of information.  IMO, we should be showing all versions that are available under /usr/share/rhev-hypervisor.  There may be cases where just the latest version of 6.3 is not the one that is desired, but there is no longer any way to select latest-1

Comment 7 Itamar Heim 2012-07-03 19:26:37 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > To explain Simon's reason for his question in comment #2: The versions that
> > will appear in the "RHEV-H ISO Name" drop-down are only available versions
> > that their "major" part is the same as the "major" part of the current
> > RHEV-H version.
> > E.g. if the RHEV-H Host current version is "6.3" and I have RHEV-H ISOs of
> > versions 5.8, 5.9, 6.2, 6.3, 6.4 in "/usr/share/rhev-hypervisor", I will see
> > in the drop down only versions that begin with "6", i.e., 6.2, 6.3, 6.4.
> 
> Why, exactly, are we suppressing the minor part of the version?  That's a
> fairly crucial bit of information.  IMO, we should be showing all versions
> that are available under /usr/share/rhev-hypervisor.  There may be cases
> where just the latest version of 6.3 is not the one that is desired, but
> there is no longer any way to select latest-1

i may be missing here, but einav comment was that the filter is based on the major version matching the version of the node to be upgraded (since upgrade isn't supported between major versions)?

Comment 8 Mike Burns 2012-07-03 19:35:00 UTC
(In reply to comment #7)

> 
> i may be missing here, but einav comment was that the filter is based on the
> major version matching the version of the node to be upgraded (since upgrade
> isn't supported between major versions)?

I misread the explanation.  My complaint is more in line with bug 835841.

Comment 9 cshao 2012-07-05 01:11:37 UTC
(In reply to comment #2)
> Can you please list all the other version that currently exist in
> /usr/share/rhev-hypervisor ?

# ll /usr/share/rhev-hypervisor/
total 790428
-rw-r--r--. 1 root root 140509184 Jul  5 09:04 rhevh-6.1-20120607.0.iso
-rw-r--r--. 1 root root 132120576 Jul  5 09:04 rhevh-6.2-20111117.1.el6.iso
-rw-r--r--. 1 root root 180355072 Jul  5 09:05 rhevh-6.3-20120621.0.el6_3.iso
-rw-r--r--. 1 root root 180355072 Jul  3 02:56 rhevh-6.3-20120702.0.el6_3.iso
lrwxrwxrwx. 1 root root        57 Jul  3 10:58 rhevh-latest-6.iso -> /usr/share/rhev-hypervisor/rhevh-6.3-20120702.0.el6_3.iso
-rw-r--r--. 1 root root 176043624 Jul  3 10:57 rhev-hypervisor6-6.3-20120702.0.el6_3.noarch.rpm
lrwxrwxrwx. 1 root root        57 Jul  3 10:58 rhev-hypervisor6.iso -> /usr/share/rhev-hypervisor/rhevh-6.3-20120702.0.el6_3.iso
lrwxrwxrwx. 1 root root        57 Jul  3 10:58 rhev-hypervisor.iso -> /usr/share/rhev-hypervisor/rhevh-6.3-20120702.0.el6_3.iso
-rw-r--r--. 1 root root        21 Jul  3 03:01 version-6.3-20120702.0.el6_3.txt
lrwxrwxrwx. 1 root root        59 Jul  3 10:58 version.txt -> /usr/share/rhev-hypervisor/version-6.3-20120702.0.el6_3.txt

There are 3 versions(6.1, 6.2, 6.3) in /usr/share/rhev-hypervisor, but only the "6.3" shows in the upgrade drop-down list.
According comment 3, it should show as 6.1, 6.2, 6.3.

Comment 10 Einav Cohen 2012-07-05 04:19:14 UTC
(In reply to comment #9)
> ...
> According comment 3, it should show as 6.1, 6.2, 6.3.

Indeed; however, I gave only a partial explanation: I am not sure about it (therefore, setting needinfo on masayag to verify), but I believe that only iso files that has a matching ".txt" file are being taken into consideration when building the list of available RHEV-H ISOs in the backend, and it seems here that there is only one ".txt" file, which is: version-6.3-20120702.0.el6_3.txt.

Comment 11 Itamar Heim 2012-07-05 06:19:03 UTC
mike - since which rhev-h 6.x and 5.x do we have the .txt which were the base for this feature?
maybe we need to give a simple script to generate the .txt files for older versions of rhev-h?

Comment 12 Moti Asayag 2012-07-05 08:10:50 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > ...
> > According comment 3, it should show as 6.1, 6.2, 6.3.
> 
> Indeed; however, I gave only a partial explanation: I am not sure about it
> (therefore, setting needinfo on masayag to verify), but I believe that only
> iso files that has a matching ".txt" file are being taken into consideration
> when building the list of available RHEV-H ISOs in the backend, and it seems
> here that there is only one ".txt" file, which is:
> version-6.3-20120702.0.el6_3.txt.

The commit message of 93b5ed9c65384929c15a5fc1c0f5f563affb0568 (and the patch content) supports what you described:

    The patch modifies the way RHEV-H images were retrieved to the user:
    Start from rhevh 6.2 for beta-3, the installation of ovirt-rpm on engine
    server will add additional versions of iso files and a text file for
    each iso which contains the iso version, in the same folder
    (/usr/share/rhev-hypervisor/)

    The patch will retrieve the list of available isos by parsing the
    version files, resolving the iso file, validate its existence and its
    version (should be greater than 5.7, where the isos folder used to
    contain a single file in unsupported naming convention).

Therefore each iso file should have a compliant .txt file containing the image version. The creation of supported list is created according to the major version of the host os.

Comment 15 Mike Burns 2012-07-05 11:41:06 UTC
(In reply to comment #11)
> mike - since which rhev-h 6.x and 5.x do we have the .txt which were the
> base for this feature?
> maybe we need to give a simple script to generate the .txt files for older
> versions of rhev-h?

5.8 GA version added this version.txt file for each install.  Prior to that version, we did not support side-by-side installation.  

It may make sense to have some form of fallback in the case where version.txt is not available.  Users *could* just upload isos to that directory themselves.  With the plugin feature that is coming in the near future, there could be plain iso files there without corresponding version files.  Maybe list out file names for the iso's that don't have corresponding version.txt files?

Comment 16 Itamar Heim 2012-07-09 12:54:29 UTC
iiuc, plan here is to provide a script to fix creation of these .txt files?

Comment 17 Doron Fediuck 2012-07-23 06:47:58 UTC
Created attachment 599696 [details]
A script to generate missing .txt files

Attaching a script which generates the missing version-xxx.txt files.

The way to use it is:
gentxt4iso rhevh-iso-folder [-l|--link]

where:
* rhevh-iso-folder is where the rpm puts the iso files
* otional -l or --link: generate for sym-links as well (avoid if possible).

Note that the script assumes a correct iso file name format, which is:
rhevh-RELEASE-VERSION.iso
Malformed file names will fail.

This is the output of the script on a setup which reproduces the BZ:
$ ./gentxt4iso /tmp/bz-837247
Processing file: /tmp/bz-837247/rhevh-6.1-20120607.0.iso
>>> Generating: version-6.1-20120607.0.txt
Processing file: /tmp/bz-837247/rhevh-6.2-20111117.1.el6.iso
>>> Generating: version-6.2-20111117.1.el6.txt
Processing file: /tmp/bz-837247/rhevh-6.3-20120621.0.el6_3.iso
>>> Generating: version-6.3-20120621.0.el6_3.txt
Processing file: /tmp/bz-837247/rhevh-6.3-20120702.0.el6_3.iso
    Skipping existing TXT file.
Processing file: /tmp/bz-837247/rhevh-latest-6.iso
    Skipping /tmp/bz-837247/rhevh-latest-6.iso symbolic link file.

Comment 18 Doron Fediuck 2012-07-23 06:56:06 UTC
In this case, the system behaves as expected.

In standard RHEV-H RPM installations, a matching .txt file is provided,
and the backend handles it properly. ISO file manipulation (cp / mv)
outside the official RPM install is unsupported.

Still, in order to assist users adjust, a script is given to generate
the missing .txt files. With this we conclude the resolution of this BZ.

Comment 19 Marina Kalinin 2012-08-01 01:14:05 UTC
Doron, 
Thank you for the script, but I would readdress Mike's question on comment 15.
Could you please explain the logic behind using the txt file for each ISO and how do we plan treat scenarios when txt file does not exit?

Comment 21 Marina Kalinin 2012-08-02 18:37:00 UTC
Doron, canceling the need info.
Talked to Simon.
I understand that if we want to support upgrades from RHEV-M, we need to trust the source (the iso file) we are going to use.

Comment 22 Doron Fediuck 2012-08-04 09:25:31 UTC
(In reply to comment #21)
> Doron, canceling the need info.
> Talked to Simon.
> I understand that if we want to support upgrades from RHEV-M, we need to
> trust the source (the iso file) we are going to use.

Marina,
the whole mechanism engine is using for rhev-h upgrades, is based
upon rhev-h methodology. Basically it means every iso comes with
its own version text file. So this is what the engine is looking
for.