Bug 1421654 - hosted-engine --upgrade-appliance does not show correct the engine version
Summary: hosted-engine --upgrade-appliance does not show correct the engine version
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-hosted-engine-setup
Classification: oVirt
Component: Tools
Version: 2.1.0.2
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ovirt-4.1.1
: 2.1.0.4
Assignee: Simone Tiraboschi
QA Contact: Artyom
URL:
Whiteboard:
Depends On:
Blocks: 1379405
TreeView+ depends on / blocked
 
Reported: 2017-02-13 11:29 UTC by Artyom
Modified: 2017-05-11 09:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-21 09:50:11 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.1+
ylavi: exception+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 73279 0 master MERGED upgrade: fix version check for 4.0 2017-03-01 07:45:18 UTC
oVirt gerrit 73281 0 ovirt-hosted-engine-setup-2.1 MERGED upgrade: fix version check for 4.0 2017-03-01 07:45:40 UTC

Description Artyom 2017-02-13 11:29:48 UTC
Description of problem:
When I run unsupported flow for the --upgrade-appliance from versions 4.0 -> 4.0 and 4.0 -> 4.1, the upgrade process does not show correct the source engine version
Unable to detect engine version
[WARNING] Unsupported upgrade path
          This procedure has been designed and tested only for upgrading the engine VM from ['3.6'] to ['4.0'].
          Any other usage is highly experimental and potentially dangerous:
            Current engine: unknown
            Selected appliance: 20161130.0-1.el7ev
          Do you want to abort the upgrade process? (Yes, No) [Yes]: 

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


How reproducible:
Always

Steps to Reproduce:
1. Run --upgrade-appliance on versions 4.0 -> 4.0 or 4.0 -> 4.1
2.
3.

Actual results:
Upgrade appliance process can not recognize the engine version

Expected results:
Upgrade appliance process can recognize the engine version

Additional info:
I think the problem, that the minor version of the engine 4.0 is 0, so under the code we skip the relevant `if` section
e_major = engine_api.get_product_info().version.major
e_minor = engine_api.get_product_info().version.minor
if not e_major:
    # just for compatibility
    # see: bz#1405386
    e_major = engine_api.get_product_info().get_version().major
    e_minor = engine_api.get_product_info().get_version().minor
if e_major and e_minor:  <= if the e_minor = 0, we will skip the if condition
    self._e_version = '{ma}.{mi}'.format(
        ma=e_major,
        mi=e_minor,
    )

Comment 1 Yedidyah Bar David 2017-02-13 12:15:25 UTC
> if not e_major:
>     # just for compatibility
>     # see: bz#1405386
>     e_major = engine_api.get_product_info().get_version().major
>     e_minor = engine_api.get_product_info().get_version().minor
> if e_major and e_minor:  <= if the e_minor = 0, we will skip the if condition

I guess you are right, nice catch :-) Did you test?

Comment 2 Artyom 2017-02-13 13:54:41 UTC
yes after the change:
if e_major is not None and e_minor is not None:

all works fine:
Unsupported upgrade path
          This procedure has been designed and tested only for upgrading the engine VM from ['3.6'] to ['4.0'].
          Any other usage is highly experimental and potentially dangerous:
            Current engine: 4.0
            Selected appliance: 4.1.20170126.0-1.el7ev
          Do you want to abort the upgrade process? (Yes, No) [Yes]:

Comment 3 Artyom 2017-03-13 08:59:19 UTC
Verified on ovirt-hosted-engine-setup-2.1.0.4-1.el7ev.noarch

Unsupported upgrade path
          This procedure has been designed and tested only for upgrading the engine VM from ['3.6'] to ['4.0'].
          Any other usage is highly experimental and potentially dangerous:
            Current engine: 4.0
            Selected appliance: 4.1.20170221.0-1.el7ev
          Do you want to abort the upgrade process? (Yes, No) [Yes]:


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