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

Bug 1600170

Summary: hosted-engine ansible playbooks has ovirtmgmt hardcoded as MGMT_NETWORK
Product: [oVirt] ovirt-hosted-engine-setup Reporter: Jiri Belka <jbelka>
Component: GeneralAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: high Docs Contact:
Priority: high    
Version: 2.2.20CC: bugs, gveitmic, irosenzw, lleistne, lsvaty, mtessun, pmatyas, sbonazzo, stirabos
Target Milestone: ovirt-4.4.0Keywords: Reopened
Target Release: ---Flags: rule-engine: ovirt-4.4+
lleistne: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1667281 (view as bug list) Environment:
Last Closed: 2020-05-20 19:59:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1667281    

Description Jiri Belka 2018-07-11 15:04:49 UTC
Description of problem:

hosted-engine ansible playbooks has ovirtmgmt hardcoded as MGMT_NETWORK, this impacts older environments which would need to do SHE DR with 'rhevm' bridge (like  QE in BRQ).

# grep -n ': ovirtmgmt' /usr/share/ovirt-hosted-engine-setup/ansible/get_network_interfaces.yml
6:    MGMT_NETWORK: rhevm


Version-Release number of selected component (if applicable):
ovirt-hosted-engine-setup-2.2.20-1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. have she env which has long history, ie. rhevm bridge
2. upgrade to 4.2
3. try SHE DR with hosted-engine --deploy --otopi-environment="OVEHOSTED_NETWORK/bridgeName=str:'rhevm'"

Actual results:
deployment fails because ansible playbook has ovirtmgmt hardcoded

 [ ERROR ] Failed to execute stage 'Environment customization': A Network interface is required


Expected results:
make it working with rhevm bridge

Additional info:

Comment 1 Jiri Belka 2018-07-11 15:05:53 UTC
description includes 'rhevm' as i tried to workaround it for my env :) so line '6' contains ovirtmgmt in reality.

Comment 4 Jiri Belka 2018-07-16 08:04:38 UTC
Please provide DR steps for 4.2 SHE env which was installed in 3.5 version time and still uses 'rhevm' name for bridge.

Comment 5 Sandro Bonazzola 2018-07-16 14:18:18 UTC
Re-opening for DR scenario.

Comment 6 Simone Tiraboschi 2018-07-16 20:05:29 UTC
The value is not really hardcoded into the code but 'ovirtmgmt' it's just the default value for MGMT_NETWORK ansible variable and the user can easily override it with standard ansible means.

The missing gap is just an implicit sync between OVEHOSTED_NETWORK/bridgeName as used in past otopi based answer files and MGMT_NETWORK as used now.
Or maybe by better: have the playbook querying the engine for the name of the management bridge and use that instead of having it in a variable on playbook side.

Comment 7 Jiri Belka 2018-07-17 06:07:54 UTC
(In reply to Simone Tiraboschi from comment #6)
> The value is not really hardcoded into the code but 'ovirtmgmt' it's just
> the default value for MGMT_NETWORK ansible variable and the user can easily
> override it with standard ansible means.
> 
> The missing gap is just an implicit sync between
> OVEHOSTED_NETWORK/bridgeName as used in past otopi based answer files and
> MGMT_NETWORK as used now.
> Or maybe by better: have the playbook querying the engine for the name of
> the management bridge and use that instead of having it in a variable on
> playbook side.

So in plain language, ansible variable is just default but you can't pass the name of your bridge as option of hosted-engine --deploy (ie. --otopi-environment="OVEHOSTED_NETWORK/bridgeName=str:'rhevm'") to overload the default?

> we are already asking to the user to run the vintage flow (with --noansible 
> option) where he can force a custom bridge name exactly as in the past.

...asking where? I was following RHV 4.2 docs and there was no info about this.

Comment 8 Simone Tiraboschi 2018-07-17 18:47:34 UTC
(In reply to Jiri Belka from comment #7)
> > The missing gap is just an implicit sync between
> > OVEHOSTED_NETWORK/bridgeName as used in past otopi based answer files and
> > MGMT_NETWORK as used now.
> > Or maybe by better: have the playbook querying the engine for the name of
> > the management bridge and use that instead of having it in a variable on
> > playbook side.
> 
> So in plain language, ansible variable is just default but you can't pass
> the name of your bridge as option of hosted-engine --deploy (ie.
> --otopi-environment="OVEHOSTED_NETWORK/bridgeName=str:'rhevm'") to overload
> the default?

Not directly from otopi answer file, but you can do it at ansible level.

See https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable ,
for variable precedences.

> > we are already asking to the user to run the vintage flow (with --noansible 
> > option) where he can force a custom bridge name exactly as in the past.
> 
> ...asking where? I was following RHV 4.2 docs and there was no info about
> this.

in https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.2/html/self-hosted_engine_guide/sect-restoring_she_bkup
7.2.1, point 2.

Comment 9 Ido Rosenzwig 2018-07-25 07:25:40 UTC
In order to complete the patch we need to have the ability to rename the management network via ansible module before adding the host.

Unfortunately such an ability on the ovirt-ansible modules yet, so I opened a relevant RFE on ansible : https://github.com/ansible/ansible/issues/43236

Comment 10 Sandro Bonazzola 2018-08-21 08:48:29 UTC
Re-targeting to 4.2.7 not being identified as blocker for 4.2.6.

Comment 11 Sandro Bonazzola 2018-09-12 16:06:37 UTC
Ansible module fix has been targeted to Ansible 2.8: https://github.com/ansible/ansible/pull/44951

So we can't get this fix in for 4.2.7.

Comment 12 Sandro Bonazzola 2018-12-10 11:32:11 UTC
Moved to 4.3.1 since ansible 2.8 won't be available before 4.3.0 GA

Comment 14 Sandro Bonazzola 2019-02-22 17:21:39 UTC
*** Bug 1667281 has been marked as a duplicate of this bug. ***

Comment 15 Martin Tessun 2020-01-15 08:32:07 UTC
As Ansible 2.8 has been released already, shouldn't this BZ be ON_QA?

Comment 16 Sandro Bonazzola 2020-01-31 10:38:04 UTC
(In reply to Martin Tessun from comment #15)
> As Ansible 2.8 has been released already, shouldn't this BZ be ON_QA?

Didi already handled.

Comment 17 Petr Matyáš 2020-04-01 14:02:43 UTC
Verified on ovirt-hosted-engine-setup-2.4.2-2.el8ev.noarch using ansible-2.9.5-1.el8ae.noarch

Comment 18 Yedidyah Bar David 2020-04-16 06:31:08 UTC
Petr, can you please clarify what was the verification flow? I am not sure that merely verifying that we are using ansible >= 2.8 (or 2.9 [1][2], for that matter) is enough, as it seems like we are not actually using it - well, at least not doing what was discussed on [1].

[1] https://gerrit.ovirt.org/#/c/93277/
[2] https://docs.ansible.com/ansible/latest/modules/ovirt_network_info_module.html

Comment 19 Petr Matyáš 2020-04-16 06:49:09 UTC
I did exactly what was in reproduction steps and during setup it showed it's using whatever I provided as bridge name for mgmt network.

Comment 20 Yedidyah Bar David 2020-04-16 06:51:46 UTC
Answering to a private question about what was actually fixed and how, for this bug.

Seems to me like the fix, if at all, was done while copying the code from ovirt-hosted-engine-setup [1] to ovirt-ansible-hosted-engine-setup [2]. Compare [3] (from [1]) with [4] (from [2]). [3] did (it's a removal of below code):

- name: Network interfaces
  hosts: localhost
  connection: local
  vars:
    MGMT_NETWORK: ovirtmgmt
  tasks:
  - name: Detecting interface on existing management bridge
    set_fact:
      bridge_interface="{{ hostvars[inventory_hostname]['ansible_' + MGMT_NETWORK ]['interfaces']|first }}"
    when: "'ansible_' + MGMT_NETWORK in hostvars[inventory_hostname]"
  - debug: var=bridge_interface

Where [4] does:


- name: Network interfaces
  block:
  - name: Detecting interface on existing management bridge
    set_fact:
      bridge_interface="{{ hostvars[inventory_hostname]['ansible_' + item ]['interfaces']|first }}"
    when: "'ansible_' + item in hostvars[inventory_hostname]"
    with_items:
      - 'ovirtmgmt'
      - 'rhevm'
  - debug: var=bridge_interface

If I got it right, this means that the code supports only 'ovirtmgmt' and 'rhevm', still hard-coded, and the idea to use comment 9 and/or command 18 was never implemented. Even that is only for checking existing bridges, perhaps for attempting to re-deploy, or for pre-creation of the bridge (do we support that? not sure).

Also, it seems like the ansible code allows configuring the name using 'he_mgmt_network', but the CLI otopi wrapper does not allow passing it. And the cockpit UI has code to set 'bridgeName' which is passed to ansible as var 'he_bridge', but this var is never used in the ansible code.

Lastly, I see in the ansible code, in README.md:
    | he_bridge_if | eth0 | The network interface ovirt management bridge will be configured on |
    ...
    | he_bridge_if | null | interface used for the management bridge |
so perhaps this was left in the middle of deciding to rename variables or something like that.

Ido, can you please try to recall and clarify? Thanks.

[1] https://gerrit.ovirt.org/94362
[2] https://github.com/oVirt/ovirt-ansible-hosted-engine-setup/commit/db5a0fcc619ab9f15fc2e6482968bd79c05035cd
[3] https://gerrit.ovirt.org/#/c/94362/20/src/ansible/get_network_interfaces.yml
[4] https://github.com/oVirt/ovirt-ansible-hosted-engine-setup/commit/db5a0fcc619ab9f15fc2e6482968bd79c05035cd#diff-e86a8e72cafd097cd373a4ee1161c97e

Comment 21 Yedidyah Bar David 2020-04-16 06:53:13 UTC
(In reply to Petr Matyáš from comment #19)
> I did exactly what was in reproduction steps and during setup it showed it's
> using whatever I provided as bridge name for mgmt network.

Can you please attach relevant logs? Thanks.

Comment 22 Petr Matyáš 2020-04-16 07:27:13 UTC
Nope, machine was reinstalled right after that test as changing bridge name by me was a bit....destructive to network capabilities of that machine. (Definitely not a network expert)

Comment 23 Ido Rosenzwig 2020-04-16 08:21:26 UTC
If I recall correctly, Eddi from VDSM team said they aren't support a bridge name that is not 'ovirtmgmt'.
Additionally, in the VDSM repo 'ovirtmgmt' appear hardcoded as well in many places

Comment 24 Sandro Bonazzola 2020-05-20 19:59:56 UTC
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020.

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