Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1054226 - [rhevm-dwh-setup] rhevm-dwh-setup confusingly informs about doing upgrade when doing clean remote install
Summary: [rhevm-dwh-setup] rhevm-dwh-setup confusingly informs about doing upgrade whe...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-dwh
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 3.4.0
Assignee: Yedidyah Bar David
QA Contact: Jiri Belka
URL:
Whiteboard: integration
Depends On: 1059286 1064962 1066459
Blocks: 1059270 rhev3.4beta 1142926
TreeView+ depends on / blocked
 
Reported: 2014-01-16 13:37 UTC by Jiri Belka
Modified: 2014-09-18 12:24 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The ovirt-engine-dwh-setup command no longer erroneously informs the user that a clean remote database install is an upgrade.
Clone Of:
: 1059270 (view as bug list)
Environment:
Last Closed: 2014-06-09 15:16:50 UTC
oVirt Team: ---
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2014:0601 normal SHIPPED_LIVE rhevm-dwh 3.4 bug fix and enhancement update 2014-06-09 19:15:53 UTC
oVirt gerrit 23124 None None None Never

Description Jiri Belka 2014-01-16 13:37:36 UTC
Description of problem:

During clean remote install, rhevm-dwh-setup when executed on clean install for first time and doing remote install still "thinks" it is doing upgrade...

-%-
# rhevm-dwh-setup 
Welcome to ovirt-engine-dwh setup utility

In order to proceed the installer must stop the ovirt-engine service
Would you like to stop the ovirt-engine service (yes|no): yes
Stopping ovirt-engine...                              [ DONE ]
Remote installation is selected.

Remote installation selected. Make sure that DBA creates a user and the database in the following fashion:
        create role <role> with login encrypted password <password>;
        create database ovirt_engine_history template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8' owner <role>;

Provide a remote DB user:  :  [engine_history]remote_engine_history
Please choose a password for the db user: 
Warning: Weak Password.
Re-type password: 
Could not connect to remote database - please try again.

      ^^^^^^^^^^^ - ignore, i created remote db under different name (corrected later)

Remote installation selected. Make sure that DBA creates a user and the database in the following fashion:
        create role <role> with login encrypted password <password>;
        create database ovirt_engine_history template template0 encoding 'UTF8' lc_collate 'en_US.UTF-8' lc_ctype 'en_US.UTF-8' owner <role>;

Provide a remote DB user:  :  [remote_engine_history]
Please choose a password for the db user: 
Warning: Weak Password.
Re-type password: 

Existing DB was found on the system. The size of the detected DB is 5 MB, free space in the backup folder /var/lib/ovirt-engine/backups is approximately 12.0 GB. 

^^^^^^^^^^^ - of course! rhevm-dwh-setup tells me to create it (see above for instructions for DBA)


The upgrade utility can backup the existing database. The time and space

^^^^^^^^^^^ - backup of empty db, how useful

required for the database backup depend on its size. The detected DB size is 5 MB. This process takes time, and in some cases (for instance, when the size is few GBs) may take few hours to complete. Would you like to continue and backup the existing database?
Answering "no" will skip the backup step and continue the upgrade without backing up the database (yes|no):
-%-

It should not talk about any upgrade at all if I'm doing clean remote install.

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

How reproducible:
100%

Steps to Reproduce:
1. clean remote install of engine
2. rhevm-dwh-setup
3.

Actual results:
instructs to create empty db during clean install, then it "thinks" it is doing upgrade and it backups _EMPTY_ db

Expected results:
be more clever, we are enterprise, we should know it is clean install - empty db - thus not doing upgrade/backup of useless empty db

Additional info:

Comment 1 Yaniv Lavi 2014-01-16 16:42:24 UTC
I understand the issue, but I don't think this is urgent enough to get to z stream. Barak, what do you think?



Yaniv

Comment 2 Yaniv Lavi 2014-01-16 16:43:15 UTC
Didi, didn't we add a if that causes backup of db only when there is data?


Yaniv

Comment 3 Yedidyah Bar David 2014-01-22 11:22:08 UTC
(In reply to Yaniv Dary from comment #2)
> Didi, didn't we add a if that causes backup of db only when there is data?

No, the check is 'if dbExists'. With a remote database, dbExists is always True at that point.

It's an easy fix - just change to 'if hasData'. I am pretty certain that I suggested to do that and you objected back then.

I am also not sure it's such a bad thing to back it up anyway. If we really want to do it right, we should check if it's empty and refuse using it if it's not (for a remote db, new setup).

Another potential fix is to ask only if the size is more than some threshold, e.g. 100MB or so, with the assumption that a small db can be backed up anyway without much hesitation. This will make it simpler for smaller installations that did not collect much data.

What do you think?

Comment 4 Yaniv Lavi 2014-01-22 15:00:50 UTC
Barak, do we want fix this in z stream?



Yaniv

Comment 5 Yedidyah Bar David 2014-01-22 15:20:28 UTC
(In reply to Yaniv Dary from comment #4)
> Barak, do we want fix this in z stream?

I think Yaniv meant 3.3.z, not 3.2.z. And if you agree I think you should clone.

Comment 7 Yedidyah Bar David 2014-02-02 10:08:32 UTC
Moving to ON_QA as the new setup code, based on otopi, should not have this issue, and merged to master two weeks ago.

Comment 8 Jiri Belka 2014-03-06 12:58:37 UTC
fail as this is downstream - because of upstream|downstream naming issue:

[root@jb-rhevm34 ~]# engine-setup 
[ INFO  ] Stage: Initializing
[ INFO  ] Stage: Environment setup
          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']
          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140306135435.log
          Version: otopi-1.2.0_master (otopi-1.2.0-0.0.master.el6_5)
[ INFO  ] Stage: Environment packages setup
[ INFO  ] Stage: Programs detection
[ INFO  ] Stage: Environment setup
[ INFO  ] Stage: Environment customization
         
          --== PRODUCT OPTIONS ==--
         
          Install Data Warehouse on this host (Yes, No) [Yes]: 
         
          --== PACKAGES ==--
         
[ INFO  ] Checking for product updates...
[ ERROR ] Yum: Cannot queue package ovirt-engine-dwh: No package(s) available to install
                                    ^^^^^^^^^^^^ -> s/ovirt-engine/rhevm/

...
[ INFO  ] Yum: Performing yum transaction rollback
[ ERROR ] Failed to execute stage 'Environment customization': No package(s) available to install
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20140306135435.log
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed
[root@jb-rhevm34 ~]# rpm -qa | grep dwh
rhevm-dwh-3.4.0-0.4.master.20140224152332.el6ev.noarch
rhevm-dwh-setup-3.4.0-0.4.master.20140224152332.el6ev.noarch


it works on upstream (beta3), ovirt-engine-dwh-setup-3.4.0-0.3.el6.noarch

...
[ INFO  ] Cleaning async tasks and compensations
[ INFO  ] Checking the Engine database consistency
[ INFO  ] Stage: Transaction setup
[ INFO  ] Stopping engine service
[ INFO  ] Stopping dwh service
[ INFO  ] Stopping websocket-proxy service
[ INFO  ] Stage: Misc configuration
[ INFO  ] Stage: Package installation
[ INFO  ] Stage: Misc configuration
[ INFO  ] Backing up database localhost:engine to '/var/lib/ovirt-engine/backups/engine-20140306124834.jRBTGf.sql'.
[ INFO  ] Updating Engine database schema
[ INFO  ] Creating DWH database schema
...

Comment 9 Jiri Belka 2014-03-06 13:13:06 UTC
With this one it passes yum check... and dwh setup finishes OK.

--- /usr/share/ovirt-engine/setup/ovirt_engine_setup/dwhconstants.py    2014-03-06 14:12:31.760590986 +0100
+++ /tmp/dwhconstants.py        2014-03-06 14:12:07.782591005 +0100
@@ -43,8 +43,8 @@ class Const(object):
     RPM_RELEASE = dwhconfig.RPM_RELEASE
     SERVICE_NAME = 'ovirt-engine-dwhd'
     OVIRT_ENGINE_DWH_DB_BACKUP_PREFIX = 'dwh'
-    OVIRT_ENGINE_DWH_PACKAGE_NAME = 'ovirt-engine-dwh'
-    OVIRT_ENGINE_DWH_SETUP_PACKAGE_NAME = 'ovirt-engine-dwh-setup'
+    OVIRT_ENGINE_DWH_PACKAGE_NAME = 'rhevm-dwh'
+    OVIRT_ENGINE_DWH_SETUP_PACKAGE_NAME = 'rhevm-dwh-setup'
 
     @classproperty
     def DWH_DB_ENV_KEYS(self):

Comment 10 Jiri Belka 2014-03-06 13:36:48 UTC
How is it possible I haven't seen same Yum failure while configuring rhevm-reports? Although this time I defined reports DB to be local.

# grep 'OVIRT.*PACKAGE_NAME' /usr/share/ovirt-engine/setup/ovirt_engine_setup/reportsconstants.py
    OVIRT_ENGINE_REPORTS_PACKAGE_NAME = 'ovirt-engine-reports'
    OVIRT_ENGINE_REPORTS_SETUP_PACKAGE_NAME = 'ovirt-engine-reports-setup'

Comment 11 Yaniv Lavi 2014-03-06 13:46:27 UTC
This is fixed in the following release.
See bug 1065730. Workaround is to run with --offline flag.
Please verify the bug at hand that issue is handled.



Yaniv

Comment 12 Jiri Belka 2014-03-06 14:08:52 UTC
Ok, based on latest comments.

Comment 13 errata-xmlrpc 2014-06-09 15:16:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-0601.html


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