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 1359844 - [downsream clone - 3.6.9] engine-setup should warn users running within hosted engine to set to maintenance
Summary: [downsream clone - 3.6.9] engine-setup should warn users running within hoste...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-3.6.9
: 3.6.9
Assignee: Lev Veyde
QA Contact: Jiri Belka
URL:
Whiteboard:
Depends On: 1290073
Blocks: 1375161
TreeView+ depends on / blocked
 
Reported: 2016-07-25 14:19 UTC by rhev-integ
Modified: 2016-09-21 18:05 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
With this update, users are now warned to set the system in global maintenance mode before running the engine-setup command. This is because data corruption may occur if the engine-setup command is run without setting the system into global maintenance mode. This update means that the user is warned and the setup will be aborted if the system is not in global maintenance mode and the engine is running in the hosted engine configuration.
Clone Of: 1290073
Environment:
Last Closed: 2016-09-21 18:05:14 UTC
oVirt Team: Integration


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1929 normal SHIPPED_LIVE Moderate: Red Hat Virtualization Manager (RHV) bug fix 3.6.9 2016-09-21 21:57:10 UTC
oVirt gerrit 57270 master MERGED packaging: Add Hosted Engine VM detection 2016-07-25 14:19:26 UTC
oVirt gerrit 60264 ovirt-engine-4.0 ABANDONED packaging: Add Hosted Engine VM detection 2016-07-25 14:19:26 UTC
oVirt gerrit 60265 ovirt-engine-4.0.1 ABANDONED packaging: Add Hosted Engine VM detection 2016-07-25 14:19:26 UTC
oVirt gerrit 60268 None None None 2016-07-25 14:19:26 UTC
oVirt gerrit 60275 master MERGED packaging: Add Hosted Engine VM detection 2016-07-25 14:19:26 UTC
oVirt gerrit 61339 ovirt-engine-3.6 MERGED packaging: Add Hosted Engine VM detection 2016-07-25 15:06:40 UTC
oVirt gerrit 63724 master MERGED packaging: setup: Handle the case when HE option is missing 2016-09-13 13:38:50 UTC
oVirt gerrit 63725 ovirt-engine-3.6 MERGED packaging: setup: Handle the case when HE option is missing 2016-09-13 14:03:11 UTC
oVirt gerrit 63737 ovirt-engine-4.0 MERGED packaging: setup: Handle the case when HE option is missing 2016-09-13 14:02:28 UTC
oVirt gerrit 63740 ovirt-engine-3.6.9 MERGED packaging: setup: Handle the case when HE option is missing 2016-09-13 14:17:22 UTC
oVirt gerrit 63741 ovirt-engine-4.0.4 MERGED packaging: setup: Handle the case when HE option is missing 2016-09-13 14:22:07 UTC

Comment 2 Jiri Belka 2016-09-12 11:12:26 UTC
ok, rhevm-3.6.9-2

~~~
...
[ INFO  ] Stage: Setup validation
          During execution engine service will be stopped (OK, Cancel) [OK]: 
[ ERROR ] It seems that you are running your engine inside of the hosted-engine VM and are not in "Global M
aintenance" mode. In that case you should put the system into the "Global Maintenance" mode before running 
engine-setup, or the hosted-engine HA agent might kill the machine, which might corrupt your data. 
[ ERROR ] Failed to execute stage 'Setup validation': Hosted Engine setup detected, but Global Maintenance 
is not set.
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20160912125329-zljjsj.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20160912130140-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed
~~~

with global maintenance enabled no such error is visible.

Comment 3 Jiri Belka 2016-09-13 07:04:29 UTC
Ooops, this causes broken upgrade of SHE (engine) from 3.5 to 3.6:

~~~
2016-09-13 08:56:16 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:171 Database: 'None', Statement: '
                select version, option_value
                from vdc_options
                where option_name = %(name)s
            ', args: {'name': 'HostedEngineVmName'}
2016-09-13 08:56:16 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:176 Creating own connection
2016-09-13 08:56:16 DEBUG otopi.ovirt_engine_setup.engine_common.database database.execute:221 Result: []
2016-09-13 08:56:16 DEBUG otopi.context context._executeMethod:156 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/otopi/context.py", line 146, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-common/ovirt-engine-common/system/he.py", line 71, in _validate
    ownConnection=True,
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/vdcoption.py", line 86, in getVdcOption
    ownConnection=ownConnection,
  File "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/vdcoption.py", line 61, in getVdcOptionVersions
    name=name,
RuntimeError: Cannot locate application option HostedEngineVmName
2016-09-13 08:56:16 ERROR otopi.context context._executeMethod:165 Failed to execute stage 'Setup validation': Cannot locate application option HostedEngineVmName
~~~

3.5 engine obviously doesn't know this:

~~~
engine=# select version, option_name,option_value from vdc_options where option_name = 'HostedEngineVmName
';
 version | option_name | option_value 
---------+-------------+--------------
(0 rows)
~~~

Comment 5 Jiri Belka 2016-09-13 07:07:21 UTC
(In reply to Jiri Belka from comment #3)
> Ooops, this causes broken upgrade of SHE (engine) from 3.5 to 3.6:
> 
> ~~~
> 2016-09-13 08:56:16 DEBUG otopi.ovirt_engine_setup.engine_common.database
> database.execute:171 Database: 'None', Statement: '
>                 select version, option_value
>                 from vdc_options
>                 where option_name = %(name)s
>             ', args: {'name': 'HostedEngineVmName'}
> 2016-09-13 08:56:16 DEBUG otopi.ovirt_engine_setup.engine_common.database
> database.execute:176 Creating own connection
> 2016-09-13 08:56:16 DEBUG otopi.ovirt_engine_setup.engine_common.database
> database.execute:221 Result: []
> 2016-09-13 08:56:16 DEBUG otopi.context context._executeMethod:156 method
> exception
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/site-packages/otopi/context.py", line 146, in
> _executeMethod
>     method['method']()
>   File
> "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-common/ovirt-
> engine-common/system/he.py", line 71, in _validate
>     ownConnection=True,
>   File
> "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/vdcoption.py", line
> 86, in getVdcOption
>     ownConnection=ownConnection,
>   File
> "/usr/share/ovirt-engine/setup/ovirt_engine_setup/engine/vdcoption.py", line
> 61, in getVdcOptionVersions
>     name=name,
> RuntimeError: Cannot locate application option HostedEngineVmName
> 2016-09-13 08:56:16 ERROR otopi.context context._executeMethod:165 Failed to
> execute stage 'Setup validation': Cannot locate application option
> HostedEngineVmName
> ~~~
> 
> 3.5 engine obviously doesn't know this:
> 
> ~~~
> engine=# select version, option_name,option_value from vdc_options where
> option_name = 'HostedEngineVmName
> ';
>  version | option_name | option_value 
> ---------+-------------+--------------
> (0 rows)
> ~~~

Steps:

1. have 3.5 SHE env
2. global maintenance
3. update rpms inside engine VM
4. engine-setup

Comment 6 Jiri Belka 2016-09-13 07:21:17 UTC
Workaround:

curl -o /tmp/patch 'https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=patch;h=23e9a25de622eb374efa8ffcf8c0bb613082cfc5'
cd /usr/share/ovirt-engine
patch -p2 -R < /tmp/patch

Comment 7 Jiri Belka 2016-09-16 11:24:53 UTC
ok, rhevm-setup-plugin-ovirt-engine-3.6.9.2-0.1.el6.noarch

Comment 9 errata-xmlrpc 2016-09-21 18:05:14 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.

https://rhn.redhat.com/errata/RHSA-2016-1929.html


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