Bug 1462684 - Incorrect validation check for HE appliance version while doing HE upgrade
Summary: Incorrect validation check for HE appliance version while doing HE upgrade
Keywords:
Status: CLOSED DUPLICATE of bug 1464866
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-hosted-engine-setup
Version: 4.0.7
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.1.3
: ---
Assignee: Sandro Bonazzola
QA Contact: Nikolai Sednev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-19 09:28 UTC by nijin ashok
Modified: 2020-08-13 09:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-29 07:46:41 UTC
oVirt Team: Integration
Target Upstream Version:
Embargoed:
nsednev: testing_plan_complete-


Attachments (Terms of Use)

Description nijin ashok 2017-06-19 09:28:46 UTC
Description of problem:

As per the bug 1405065, we have a extra validation check to avoid using hosted-engine --upgrade-appliance  script for upgrade from 4.0 to 4.1 . However the validation of the appliance image is wrong.

It took the version info from /etc/ovirt-hosted-engine/10-appliance.conf. The naming pattern for version info in this file is not consistent in different appliance rpm.

I have checked few rpm's and here is the version info recorded in 10-appliance.conf in each rpm.

rhevm-appliance-20170425.0-1.el7ev.noarch.rpm : version=20170425.0-1.el7ev
rhevm-appliance-4.0.20170307.0-1.el7ev.noarch.rpm : version=4.0.20170307.0-1.el7ev
rhevm-appliance-20170106.0-1.el7ev.noarch.rpm : version=20170106.0-1.el7ev

The code is expecting the format as 4.0-20170307.0-1.el7ev

===
    def _check_upgrade_versions(self):
        supported = True
        if not self._e_version:
            self.logger.warning(_('Unable to detect engine version'))
            supported = False
        else:
            if (
                self._e_version not in
                ohostedcons.Const.UPGRADE_SUPPORTED_SOURCES
            ):
                supported = False
        if not self.environment[ohostedcons.VMEnv.APPLIANCE_VERSION]:
            self.logger.warning(_('Unable to detect appliance version'))
            supported = False
        else:
            a_version = self.environment[
                ohostedcons.VMEnv.APPLIANCE_VERSION
            ].split('-')[0]
            if a_version not in ohostedcons.Const.UPGRADE_SUPPORTED_TARGETS:
                supported = False
        if not supported:
            self.logger.warning(_('Unsupported upgrade path'))

constants.py

   UPGRADE_SUPPORTED_SOURCES = ['3.6']
   UPGRADE_SUPPORTED_TARGETS = ['4.0']

===

Because of this, user will get below warning while upgrading.

===
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: 3.6 selected appliance: 4.0.20170307.0-1.el7ev
UPGRADE_ABORT_ON_UNSUPPORTED_VER

Do you want to abort the upgrade process? (Yes, No) [Yes]:
===


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

ovirt-hosted-engine-setup-2.0.4.3-3.el7ev.noarch


How reproducible:

100%

Steps to Reproduce:

1. Run hosted-engine --upgrade-appliance in 3.6 with 4.0 appliance image. 


Actual results:

hosted-engine --upgrade-appliance is showing incorrect warning

Expected results:

hosted-engine --upgrade-appliance should work fine when using 3.6 engine version and 4.0 appliance version.

Additional info:

Comment 1 Sandro Bonazzola 2017-06-29 07:46:41 UTC
Thanks for reporting, this has been already addressed in bug #1464866. Closing this as duplicate.

*** This bug has been marked as a duplicate of bug 1464866 ***


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