Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1846365

Summary: Handle grafana in ovirt-engine-rename
Product: [oVirt] ovirt-engine-dwh Reporter: Yedidyah Bar David <didi>
Component: SetupAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Novotny <pnovotny>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4.0CC: bugs, emarcus, lleistne, mtessun, sradco
Target Milestone: ovirt-4.4.3Keywords: ZStream
Target Release: 4.4.3Flags: pm-rhel: ovirt-4.4+
mtessun: planning_ack+
sbonazzo: devel_ack+
lleistne: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-dwh-4.4.3 Doc Type: Bug Fix
Doc Text:
In this version, ovirt-engine-rename supports also grafana, if it's set up on the engine machine. doc team: You might want to add, here, or elsewhere (see discussion in the bug): If grafana is set up on a separate machine, ovirt-engine-rename on the engine machine will work, but not on the grafana machine. If the grafana database does not include important data (normally it should only include user accounts), it should be easier to just remove it (e.g. using engine-cleanup on the grafana machine) and run engine-setup again, after changing the host name (or reinstalling the machine with the new name).
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-02 11:33:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Metrics RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1866734, 1879377    

Description Yedidyah Bar David 2020-06-11 13:01:47 UTC
Description of problem:

Check where we might keep the FQDN in grafana (conf, db, etc.) and handle changing it in ovirt-engine-rename.

Also include the conf file we add to the engine to let it link to grafana, see bug 1845049.

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

How reproducible:
Always

Steps to Reproduce:
1. Install and setup engine+dwh+grafana
2. ovirt-engine-rename, supply a new name
3. Check if old name still appears anywhere and can cause problems

Actual results:
It appears at least in grafana.ini, certificates, engine conf. Need to check elsewhere

Expected results:
Does not appear, or at least not in places that might cause problems

Additional info:

Should verify/fix the same also for engine and dwh+grafana on separate machines

Comment 2 Lucie Leistnerova 2020-07-11 16:31:32 UTC
I just needed this by testing upgrade and when there is not grafana installed on the server, it still tries to rename and fails.

2020-07-11 18:23:51,840+0200 DEBUG otopi.context context._executeMethod:145 method exception
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-engine/setup/bin/../plugins/ovirt-engine-rename/ovirt-engine-grafana-dwh/config.py", line 150, in _misc
    self._sso_config.get('SSO_CLIENT_SECRET')
AttributeError: 'NoneType' object has no attribute 'get'
2020-07-11 18:23:51,850+0200 ERROR otopi.context context._executeMethod:154 Failed to execute stage 'Misc configuration': 'NoneType' object has no attribute 'get'

Tested in ovirt-engine-dwh-4.4.1.2-1.el8ev.noarch

Comment 3 RHEL Program Management 2020-07-11 16:31:39 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 4 Pavel Novotny 2020-09-01 19:07:07 UTC
FailedQA in
ovirt-engine-4.4.2.3-0.6.el8ev.noarch
ovirt-engine-dwh-4.4.2.1-1.el8ev.noarch

Found one issue - another config file needs to be updated.

After ovirt-engine-rename (engine+DWH+Grafana on the same machine), the Monitoring Portal link on welcome page points to the old URL.
This is because variable ENGINE_GRAFANA_FQDN in /etc/ovirt-engine/engine.conf.d/10-setup-grafana-access.conf still contains the old hostname.

Comment 5 RHEL Program Management 2020-09-01 19:07:13 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 6 Yedidyah Bar David 2020-09-02 10:15:20 UTC
I am going to handle this only for engine+grafana on same machine. rename tool already does not support grafana on separate machine. Please file a separate bug for this if needed - it will require more work (also for SSO etc.). It's probably easier to simply setup a new machine with the new name, and perhaps copy grafana db if needed (no idea if it keeps the name inside it, if it does it's more work).

Comment 7 Lucie Leistnerova 2020-09-03 15:24:20 UTC
(In reply to Yedidyah Bar David from comment #6)
> I am going to handle this only for engine+grafana on same machine. rename
> tool already does not support grafana on separate machine. Please file a
> separate bug for this if needed - it will require more work (also for SSO
> etc.). It's probably easier to simply setup a new machine with the new name,
> and perhaps copy grafana db if needed (no idea if it keeps the name inside
> it, if it does it's more work).

We do support engine on one machine and dwh+grafana on separate machine and so should also the rename tool. In that case when you need to rename the engine, it fails.
I can create new bug, but I want to be sure that we agree on this scenario.

Comment 8 Yedidyah Bar David 2020-09-06 05:46:38 UTC
(In reply to Lucie Leistnerova from comment #7)
> 
> We do support engine on one machine and dwh+grafana on separate machine and
> so should also the rename tool. In that case when you need to rename the
> engine, it fails.

What is "it"?

I doubt grafana cares that much.

Probably DWH fails, if the engine db is not accessible anymore using the old name.
This is unrelated to grafana, and this bug existed "forever".

> I can create new bug, but I want to be sure that we agree on this scenario.

You are welcome to create the bug, but I am not sure we'll handle it.
Perhaps we want a doc bug, detailing, among the various possible combinations
of components on different machines, which ones are supported by the rename tool.

Comment 9 Lucie Leistnerova 2020-09-07 07:16:39 UTC
(In reply to Yedidyah Bar David from comment #8)
> (In reply to Lucie Leistnerova from comment #7)
> > 
> > We do support engine on one machine and dwh+grafana on separate machine and
> > so should also the rename tool. In that case when you need to rename the
> > engine, it fails.
> 
> What is "it"?
> 
Rename tool on engine machine, error in comment #2

> I doubt grafana cares that much.
> 
> Probably DWH fails, if the engine db is not accessible anymore using the old
> name.
> This is unrelated to grafana, and this bug existed "forever".
> 
> > I can create new bug, but I want to be sure that we agree on this scenario.
> 
> You are welcome to create the bug, but I am not sure we'll handle it.
> Perhaps we want a doc bug, detailing, among the various possible combinations
> of components on different machines, which ones are supported by the rename
> tool.

After discussion with Didi, we agreed that the issue I was raising is not renaming grafana but renaming engine itself and that should be fixed by patch 110282. When renaming grafana will be needed, we will create new bug, but I don't see it neccessary now.

Comment 12 Sandro Bonazzola 2020-11-11 06:45:49 UTC
This bugzilla is included in oVirt 4.4.3 release, published on November 10th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.3 release, it has been closed with a resolution of CURRENT RELEASE.

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