Bug 1261827 - Place /var/lib/ovirt-hosted-engine-ha/ha.conf outside of /var/lib/ovirt-hosted-engine-ha
Place /var/lib/ovirt-hosted-engine-ha/ha.conf outside of /var/lib/ovirt-hoste...
Status: CLOSED NOTABUG
Product: ovirt-hosted-engine-ha
Classification: oVirt
Component: General (Show other bugs)
---
Unspecified Unspecified
low Severity medium (vote)
: ovirt-4.0.2
: ---
Assigned To: Martin Sivák
meital avital
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-10 05:25 EDT by Fabian Deutsch
Modified: 2016-06-29 05:17 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-29 05:17:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Integration
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ylavi: ovirt‑4.0.z?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

  None (edit)
Description Fabian Deutsch 2015-09-10 05:25:26 EDT
Description of problem:
If /var/lib/ovirt-hosted-engine-ha/ha.conf provides a vendor provided configuration, then it should go to /usr/{lib,etc}/ovirt-hosted-engine-ha/ha.conf
The user can customize/override it by copying it to /etc/ovirt-hosted-engine-ha.

Placing it in /var/lib/ovirt-hosted-engine-ha/ is bad, because /var might be different at runtime, then how it is at install time, i.e. in image environemnts like Node.

The error you get when the file is missing is:
Sep 10 09:07:51 node.example.org vdsm[3391]: vdsm vds ERROR error setting HA maintenance mode
                                                 Traceback (most recent call last):
                                                   File "/usr/share/vdsm/API.py", line 1737, in setHaMaintenanceMode
                                                     haClient.HAClient().set_maintenance_mode(mm, enabled)
                                                   File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/client/client.py", line 266, in set_maintenance_mode
                                                     str(util.to_bool(value)))
                                                   File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/env/config.py", line 164, in set
                                                     with open(self._dynamic_files[type], 'r+') as f:
                                                 IOError: [Errno 2] No such file or directory: '/var/lib/ovirt-hosted-engine-ha/ha.conf'
Comment 1 Martin Sivák 2015-09-10 09:44:44 EDT
Fabian, this file is not user editable, it should be coming from OVF store where it will be placed by the engine (to allow UI based management and to synchronize the file across all nodes).

The crash is not good though.
Comment 2 Fabian Deutsch 2015-09-10 09:49:02 EDT
I see, then, indeed it looks as if it's placed correctly, but - yes - then HA should not expect it to be there - or recreate it empty if needed.
Comment 3 Fabian Deutsch 2016-04-06 07:59:09 EDT
If this file has vendor presets/defaults, then please move this file to some location in /usr.
If this file has content which is edited by users, please move it to /etc.

At best it should allow shadowing:

First read from /usr, let it be overriden by /etc,

This bug is still highly relevant for good upgrades paths of NGN.
Comment 4 Martin Sivák 2016-04-06 08:26:47 EDT
This file is automatically generated every time hosted engine reads the data from the OVF store. It is not user editable and it does not contain any values you can modify or shadow from the host perspective (it should all be coming from the engine).
Comment 5 Fabian Deutsch 2016-04-07 07:06:46 EDT
If it's getting auto-generated then the location seems to be fine - and I'm fine in closing this bug.

One nit: What about putting it in /var/cache/ if it can be derived from another datasource?
Comment 6 Martin Sivák 2016-04-07 07:15:18 EDT
> One nit: What about putting it in /var/cache/ if it can be derived from
> another datasource?

Not a bad idea actually.
Comment 7 Sandro Bonazzola 2016-05-02 06:07:16 EDT
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.
Comment 8 Yaniv Lavi 2016-05-23 09:22:01 EDT
oVirt 4.0 beta has been released, moving to RC milestone.
Comment 9 Yaniv Lavi 2016-05-23 09:24:46 EDT
oVirt 4.0 beta has been released, moving to RC milestone.
Comment 10 Fabian Deutsch 2016-06-15 08:37:42 EDT
For the record, comment 5 summarizes the status.
Comment 11 Roy Golan 2016-06-29 05:17:38 EDT
We can't use cache because we need that fallback configuration, and we want it to survive reboots. closing this.

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