Bug 1501798 - Provide solution to make OVN provider working after ovirt-engine-rename
Summary: Provide solution to make OVN provider working after ovirt-engine-rename
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Tools.Rename
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.1
: 4.4.1.5
Assignee: Yedidyah Bar David
QA Contact: Pavel Novotny
URL:
Whiteboard:
: 1721870 1807242 (view as bug list)
Depends On:
Blocks: 1498855
TreeView+ depends on / blocked
 
Reported: 2017-10-13 08:50 UTC by Jiri Belka
Modified: 2021-06-16 19:47 UTC (History)
12 users (show)

Fixed In Version: ovirt-engine-4.4.1.5
Clone Of:
Environment:
Last Closed: 2020-08-05 06:24:55 UTC
oVirt Team: Integration
Embargoed:
pm-rhel: ovirt-4.4+
sbonazzo: devel_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5917691 0 None None None 2021-06-16 19:45:08 UTC
oVirt gerrit 92199 0 master MERGED packaging: rename: Handle OVN conf 2021-02-14 13:07:48 UTC
oVirt gerrit 109835 0 master MERGED packaging: rename: Restart ovirt-provider-ovn 2021-02-14 13:07:48 UTC
oVirt gerrit 109896 0 master MERGED packaging: rename: Support adding more PKI entities 2021-02-14 13:07:48 UTC
oVirt gerrit 109928 0 master MERGED packaging: rename: Handle OVN PKI 2021-02-14 13:07:48 UTC
oVirt gerrit 109961 0 master MERGED packaging: rename: Update OVN provider URL 2021-02-14 13:07:47 UTC

Description Jiri Belka 2017-10-13 08:50:23 UTC
Description of problem:

ovirt-engine-rename does not take care about existing default OVN provider
in 4.2.

from mmirecki@:

~~~
A quick look at this:

The following key/certs would need to be regenerated:
OVN North:
/etc/pki/ovirt-engine/keys/ovn-ndb.key.nopass
/etc/pki/ovirt-engine/certs/ovn-ndb.cer

OVN South:
/etc/pki/ovirt-engine/keys/ovn-sdb.key.nopass
/etc/pki/ovirt-engine/certs/ovn-sdb.cer

HTTPS:
/etc/pki/ovirt-engine/keys/ovirt-provider-ovn.key.nopass
/etc/pki/ovirt-engine/certs/ovirt-provider-ovn.cer

Then OVN needs to be updated with the keys:
ovn-nbctl set-ssl /etc/pki/ovirt-engine/keys/ovn-ndb.key.nopass /etc/pki/ovirt-engine/certs/ovn-ndb.cer /etc/pki/ovirt-engine/ca.pem
ovn-sbctl set-ssl /etc/pki/ovirt-engine/keys/ovn-sdb.key.nopass /etc/pki/ovirt-engine/certs/ovn-sdb.cer /etc/pki/ovirt-engine/ca.pem
systemctl restart ovn-northd

The new ca cert must be imported into the truststore:

keytool -import -alias ovirt-provider-ovn -keystore /var/lib/ovirt-engine/external_truststore -file /etc/pki/ovirt-engine/ca.pem -noprompt -storepass <truststore_password>

default password for truststore is: ******
if not, please check: /etc/ovirt-engine/engine.conf/11-setup-sso.conf

The OVN internal traffic is done using IPs (no hostnames allowed), so unless the ip changes, no changes should be required in this area.
~~~

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

How reproducible:
100%

Steps to Reproduce:
1. install engine, enable OVN during engine-setup
2. change IP/hostname of engine host
3. run ovirt-engine-rename

Actual results:
OVN does not work correctly, engine refuses to add new hosts because of bad ip/hostname for OVN provider and related stuff

Expected results:
either this should be well documented or ovirt-engine-rename should take care of it

Additional info:

Comment 1 Yedidyah Bar David 2018-06-13 10:18:02 UTC
(In reply to Jiri Belka from comment #0)
> Description of problem:
> 
> ovirt-engine-rename does not take care about existing default OVN provider
> in 4.2.
> 
> from mmirecki@:
> 
> ~~~
> A quick look at this:
> 
> The following key/certs would need to be regenerated:
> OVN North:
> /etc/pki/ovirt-engine/keys/ovn-ndb.key.nopass

I guess we can keep the keys, right? Assuming yes.

> /etc/pki/ovirt-engine/certs/ovn-ndb.cer
> 
> OVN South:
> /etc/pki/ovirt-engine/keys/ovn-sdb.key.nopass

Same

> /etc/pki/ovirt-engine/certs/ovn-sdb.cer
> 
> HTTPS:
> /etc/pki/ovirt-engine/keys/ovirt-provider-ovn.key.nopass

Same

> /etc/pki/ovirt-engine/certs/ovirt-provider-ovn.cer
> 
> Then OVN needs to be updated with the keys:
> ovn-nbctl set-ssl /etc/pki/ovirt-engine/keys/ovn-ndb.key.nopass
> /etc/pki/ovirt-engine/certs/ovn-ndb.cer /etc/pki/ovirt-engine/ca.pem
> ovn-sbctl set-ssl /etc/pki/ovirt-engine/keys/ovn-sdb.key.nopass
> /etc/pki/ovirt-engine/certs/ovn-sdb.cer /etc/pki/ovirt-engine/ca.pem
> systemctl restart ovn-northd

So is that needed?

> 
> The new ca cert must be imported into the truststore:

We do not change the ca cert in rename. That was a deliberate decision taken at the time of original implementation and is not likely to change.

> 
> keytool -import -alias ovirt-provider-ovn -keystore
> /var/lib/ovirt-engine/external_truststore -file /etc/pki/ovirt-engine/ca.pem
> -noprompt -storepass <truststore_password>
> 
> default password for truststore is: ******
> if not, please check: /etc/ovirt-engine/engine.conf/11-setup-sso.conf
> 
> The OVN internal traffic is done using IPs (no hostnames allowed), so unless
> the ip changes, no changes should be required in this area.

What if it is?

It's not exactly the scope of the rename tool, but these often go together. Usually we resolve names to addresses only during run time (not setup), so any IP address change normally requires at most a restart of the relevant services.

> ~~~
> 
> Version-Release number of selected component (if applicable):
> 4.2
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. install engine, enable OVN during engine-setup
> 2. change IP/hostname of engine host
> 3. run ovirt-engine-rename
> 
> Actual results:
> OVN does not work correctly, engine refuses to add new hosts because of bad
> ip/hostname for OVN provider and related stuff

Please provide steps to test this.

I see that we have some ovn stuff in ovirt-system-tests, perhaps it's enough to run rename there.

> 
> Expected results:
> either this should be well documented or ovirt-engine-rename should take
> care of it
> 
> Additional info:

Comment 2 Yedidyah Bar David 2018-06-18 09:56:11 UTC
Also, do we really need to update the certificates?

/etc/pki/ovirt-engine/certs/ovn-ndb.cer
/etc/pki/ovirt-engine/certs/ovn-sdb.cer
/etc/pki/ovirt-engine/certs/ovirt-provider-ovn.cer

I know that their subject is the old name, but does this matter?

Note that among all the certs that engine-setup creates, we only update by rename the one for httpd.

If nothing connects to the engine machine using the name, and nothing validates the name in the cert, no need to regenerate it.

Check also [1]. It's pretty outdated, but the principle remains: We do, in ovirt-engine-rename, the _minimal_ changes needed to satisfy users connect with a browser to the new name and have the cert validated correctly. We do _not_ try to change the old name everywhere possible. If e.g. you have whatever reasons (say, legal) to completely get rid of the old name, then ovirt-engine-rename is not the tool for you.

[1] https://www.ovirt.org/documentation/how-to/networking/changing-engine-hostname/

Comment 3 Marcin Mirecki 2018-06-18 13:26:05 UTC
We also need to update the ovn-controllers (on each host) with the new ip of the ovn db (engine).

This can be done either from the hosts (each host):
vdsm-tool ovn-config <ovn central ip> <tunneling ip or network name>
/usr/libexec/ovirt-provider-ovn/setup_ovn_controller.sh  <ovn central ip> <tunneling ip or network name>

or centrally from the engine for each cluster:
ansible-playbook --private-key=/etc/pki/ovirt-engine/keys/engine_id_rsa -i /usr/share/ovirt-engine-metrics/bin/ovirt-engine-hosts-ansible-inventory --extra-vars " cluster_name=<cluster name> ovn_central=<ovn central ip> ovn_tunneling_interface=<vdsm network name>" ovirt-provider-ovn-driver.yml
(this is described in BZ 1565963, although we deal with the name of the tunneling network, not ip of central)

Comment 4 Sandro Bonazzola 2018-10-15 05:34:10 UTC
Moving to 4.3.0 not being identified as blocker for 4.2.7 and not being urgent

Comment 5 Yedidyah Bar David 2018-11-26 09:16:45 UTC
Changing subject to clarify that this is a bug on ovirt-engine-rename.

IP addresses changes are not handled by this tool. They might be, as a side effect, if also the name changed.

Please open another bug/RFE, if needed, for IP address changes. Perhaps only a doc bug.

Comment 6 Pavel Novotny 2018-12-05 12:18:40 UTC
Hi Didi, I took this bug after Jiri. If your needinfo is regarding to your comment 5,
then I agree that ovirt-engine-rename should handle only hostnames.

Comment 7 Sandro Bonazzola 2019-01-16 09:22:41 UTC
Any update?

Comment 8 Yedidyah Bar David 2019-01-16 09:53:56 UTC
Sorry, not yet. I want to reproduce/verify this in OST, but that's progressing rather slowly.

(And without reproducing/verifying, I can't be certain about what exactly needs to be done.
Perhaps I should do this manually, but I'd also want an OST rename suite anyway...).

Comment 9 Sandro Bonazzola 2019-01-28 09:40:22 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.

Comment 10 Sandro Bonazzola 2019-07-11 07:03:30 UTC
Re-targeting to 4.3.6 not being identified as blocker for 4.3.5.

Comment 12 Yedidyah Bar David 2019-10-22 06:08:49 UTC
Sandro - move to 4.4?

Comment 13 Sandro Bonazzola 2019-10-31 10:15:43 UTC
Moved to 4.4

Comment 14 Yedidyah Bar David 2020-06-30 11:27:17 UTC
*** Bug 1721870 has been marked as a duplicate of this bug. ***

Comment 15 Yedidyah Bar David 2020-06-30 12:26:02 UTC
All pending patches merged, OST with patch to run rename passed.

Comment 16 Yedidyah Bar David 2020-07-02 10:11:50 UTC
*** Bug 1807242 has been marked as a duplicate of this bug. ***

Comment 17 Pavel Novotny 2020-07-15 23:31:53 UTC
Verified in
ovirt-engine-4.4.1.8-0.7.el8ev

Following OVN files are modified by ovirt-engine-rename to update the engine FQDN:

/etc/ovirt-provider-ovn/conf.d/10-setup-ovirt-provider-ovn.conf
/etc/pki/ovirt-engine/certs/ovirt-provider-ovn.cer
/etc/pki/ovirt-engine/keys/ovirt-provider-ovn.key.nopass
/etc/pki/ovirt-engine/keys/ovirt-provider-ovn.p12

As was said above, the certificate issuer line still contains the original engine FQDN, but it's rather a cosmetic thing.
The CN is updated to the new FQDN.

Also in webadmin, the 'ovirt-provider-ovn' provider URL is updated to the new FQDN.

Comment 18 Sandro Bonazzola 2020-08-05 06:24:55 UTC
This bugzilla is included in oVirt 4.4.1 release, published on July 8th 2020.

Since the problem described in this bug report should be resolved in oVirt 4.4.1 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.

Comment 20 Yedidyah Bar David 2020-08-18 06:54:16 UTC
Looks good to me.


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