Bug 1367107 - [RFE] Override firewall rules by default when installing a new host or reinstalling existing host
Summary: [RFE] Override firewall rules by default when installing a new host or reinst...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.0.2.6
Hardware: All
OS: Linux
high
high
Target Milestone: ovirt-4.1.2
: 4.1.2
Assignee: Ondra Machacek
QA Contact: Aleksei Slaikovskii
URL:
Whiteboard:
Depends On:
Blocks: 1341204
TreeView+ depends on / blocked
 
Reported: 2016-08-15 14:38 UTC by Aleksei Slaikovskii
Modified: 2017-06-25 09:18 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-05-23 08:21:52 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: ovirt-4.2+
mgoldboi: planning_ack+
mperina: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)
engine.log-20160816.xz and server.log (1.13 MB, application/x-xz)
2016-08-16 07:42 UTC, Aleksei Slaikovskii
no flags Details
host-deploy, engine, server and vdsm logs. (90.43 KB, application/x-xz)
2016-08-16 10:03 UTC, Aleksei Slaikovskii
no flags Details
engine log- fail on api vs success on ui (684.61 KB, text/plain)
2017-02-14 08:50 UTC, Moran Goldboim
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 73684 0 master MERGED Document default behaviour of override firewall 2017-03-09 16:03:56 UTC
oVirt gerrit 73685 0 master MERGED core: set override firewall to true by default 2017-03-08 13:42:02 UTC
oVirt gerrit 73864 0 model_4.1 MERGED Document default behaviour of override firewall 2017-03-09 16:09:21 UTC
oVirt gerrit 73875 0 ovirt-engine-4.1 MERGED core: set override firewall to true by default 2017-03-21 13:29:37 UTC

Description Aleksei Slaikovskii 2016-08-15 14:38:57 UTC
Description of problem:
If adding new host with newly installed RHEL7.2 (with all needed repos, of course) through Python SDK installation of host always ends as failed. On the other hand, adding this clean host to engine trough web-interface works fine.

Version-Release number of selected component (if applicable):
Engine version: 4.0.2.6-0.1.el7ev
Python SDK version: latest 4.0 from github.com

How reproducible:
100%

Steps to Reproduce:
1. get some hosts
2. get engine
3. add this hosts through python-sdk

Actual results:
Host installation fails.

Expected results:
Host is up.

Additional info:
Script I'm using to add hosts: https://gist.github.com/slaykovsky/3bdcaa305edd4d04f1b38b11ac65615e

Comment 1 Aleksei Slaikovskii 2016-08-15 14:42:44 UTC
(In reply to Aleksei Slaikovskii from comment #0)
> Description of problem:
> If adding new host with newly installed RHEL7.2 (with all needed repos, of
> course) through Python SDK installation of host always ends as failed. On
> the other hand, adding this clean host to engine trough web-interface works
> fine.
> 
> Version-Release number of selected component (if applicable):
> Engine version: 4.0.2.6-0.1.el7ev
> Python SDK version: latest 4.0 from github.com
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. get some hosts
> 2. get engine
> 3. add this hosts through python-sdk
> 
> Actual results:
> Host installation fails.
> 
> Expected results:
> Host is up.
> 
> Additional info:
> Script I'm using to add hosts:
> https://gist.github.com/slaykovsky/3bdcaa305edd4d04f1b38b11ac65615e

There's vdsm on hosts: vdsm-4.18.11-1.el7ev.x86_64(In reply to Aleksei Slaikovskii from comment #0)
> Description of problem:
> If adding new host with newly installed RHEL7.2 (with all needed repos, of
> course) through Python SDK installation of host always ends as failed. On
> the other hand, adding this clean host to engine trough web-interface works
> fine.
> 
> Version-Release number of selected component (if applicable):
> Engine version: 4.0.2.6-0.1.el7ev
> Python SDK version: latest 4.0 from github.com
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. get some hosts
> 2. get engine
> 3. add this hosts through python-sdk
> 
> Actual results:
> Host installation fails.
> 
> Expected results:
> Host is up.
> 
> Additional info:
> Script I'm using to add hosts:
> https://gist.github.com/slaykovsky/3bdcaa305edd4d04f1b38b11ac65615e

vdsm-4.18.11-1.el7ev.x86_64

Comment 2 Yaniv Kaul 2016-08-16 05:47:05 UTC
Can you attach engine.log, server.log?

Comment 3 Aleksei Slaikovskii 2016-08-16 07:42:27 UTC
Created attachment 1191124 [details]
engine.log-20160816.xz and server.log

Comment 4 Yaniv Kaul 2016-08-16 07:57:11 UTC
Which server is it that you are trying to install?
Assuming it's _test_0, you can find its logs (on the engine) at /var/log/ovirt-engine/host-deploy/ovirt-host-deploy-20160815144925-10.34.61.74-6d6f1229.log

(and in general, in any deploy failures, you can look @ /var/log/ovirt-engine/host-deploy/ to find out more information).

Comment 6 Yaniv Kaul 2016-08-16 08:04:14 UTC
(In reply to Yaniv Kaul from comment #4)
> Which server is it that you are trying to install?

And you clearly have other issues that need to be solved:
2016-08-15 14:40:10,766 ERROR [org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand] (org.ovirt.thread.pool-6-thread-5) [8e8e747] Host installation failed for host '34b2d3ab-77a8-4275-84ba-2ff6bf83d818', 'aslaikov_test_3':Host is not reachable 

Let's try to narrow down the scenario (and the log file - I shouldn't be going over 60MB log file).

Comment 7 Aleksei Slaikovskii 2016-08-16 08:12:17 UTC
(In reply to Yaniv Kaul from comment #6)
> (In reply to Yaniv Kaul from comment #4)
> > Which server is it that you are trying to install?
> 
> And you clearly have other issues that need to be solved:
> 2016-08-15 14:40:10,766 ERROR
> [org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand]
> (org.ovirt.thread.pool-6-thread-5) [8e8e747] Host installation failed for
> host '34b2d3ab-77a8-4275-84ba-2ff6bf83d818', 'aslaikov_test_3':Host is not
> reachable 

Yes, installation fails because of "host is not reachable".

> Let's try to narrow down the scenario (and the log file - I shouldn't be
> going over 60MB log file).

Ok, I will try to install the other one now and give you logs.

Comment 9 Aleksei Slaikovskii 2016-08-16 10:03:04 UTC
Created attachment 1191185 [details]
host-deploy, engine, server and vdsm logs.

Comment 10 Piotr Kliczewski 2016-08-16 10:39:03 UTC
Looking at the engine log I can see that during protocol detection in the engine. Both protocol failed to connect to vdsm due to:

Caused by: java.net.NoRouteToHostException: No route to host

I do not see in host deploy log that firewall was configured. Please make sure that during host installation firewall is reconfigured to allow engine <-> vdsm communication or open 54321 port manually.

Comment 11 Aleksei Slaikovskii 2016-08-16 11:04:23 UTC
So this problem was successfully fixed by adding override_iptables=True to Host constructor. E.g. like:

 h = Host(name=name,
                     address=address,
                     root_password=self._host_password,
                     override_iptables=True)

Comment 12 Aleksei Slaikovskii 2016-08-16 11:05:12 UTC
So I close it as it's not a bug eventually :)

Comment 13 Yaniv Kaul 2017-02-13 21:02:10 UTC
We need to make sure it's the default, or added. Just failed our Ansible scripts, for example.

Comment 14 Piotr Kliczewski 2017-02-14 08:03:27 UTC
Yaniv, please provide engine, host deploy and vdsm logs for your failure when using Ansible scripts.

Comment 15 Moran Goldboim 2017-02-14 08:50:55 UTC
Created attachment 1250148 [details]
engine log- fail on api vs success on ui

Comment 16 Yaniv Kaul 2017-02-14 09:59:25 UTC
(In reply to Piotr Kliczewski from comment #14)
> Yaniv, please provide engine, host deploy and vdsm logs for your failure
> when using Ansible scripts.

Piotr - no need. Just revert https://gerrit.ovirt.org/#/c/71772/3/basic-suite-4.1/test-scenarios/002_bootstrap.py and see it happening in ovirt-system-test. Without setting the iptables, it'll fail installation.

Comment 17 Piotr Kliczewski 2017-02-14 10:26:12 UTC
Yaniv, if we do not update firewall settings we assume that admin need to do it manually. It seems to be expected behaviour.

Comment 18 Martin Perina 2017-02-14 13:25:11 UTC
(In reply to Piotr Kliczewski from comment #17)
> Yaniv, if we do not update firewall settings we assume that admin need to do
> it manually. It seems to be expected behaviour.

Right, if you do not allow overriding iptables during host-deploy, we expect that admin already performed this change manually.

Inside UI code we have a checkbox (checked by default) which enables overriding iptables on host during installation.

AFAIK SDK does not send the default value for override_iptables parameter, the default is stored on backend in VdsOperationActionParameters. Also as SDKs are autogenerated, we cannot easily add default value into each SDK.

So the only way how to change it is to change the default in backend class VdsOperationActionParameters. But not sure if we don't break backward compatibility of API by that change. @Juan?

Comment 19 Juan Hernández 2017-02-14 14:10:35 UTC
Changing default values breaks backwards compatibility. If we take that seriously then we shouldn't change them, till version 5 of the API. The only thing we can (and probably should) do in version 4 of the API is document it correctly. Currently it isn't.

Comment 20 Yaniv Kaul 2017-02-14 15:15:37 UTC
(In reply to Juan Hernández from comment #19)
> Changing default values breaks backwards compatibility. If we take that
> seriously then we shouldn't change them, till version 5 of the API. The only
> thing we can (and probably should) do in version 4 of the API is document it
> correctly. Currently it isn't.

I think in this case, we can make an exception to the rule.

Comment 21 Juan Hernández 2017-02-14 15:29:25 UTC
No objection, if it is correctly documented, in a release note and in the specification of the API.

Comment 22 Yaniv Kaul 2017-02-15 13:11:33 UTC
Martin - I just want to make sure that Ansible is going to be OK, when we GA (or when Ansible 2.3 does).

Comment 23 Martin Perina 2017-02-15 13:28:09 UTC
(In reply to Yaniv Kaul from comment #22)
> Martin - I just want to make sure that Ansible is going to be OK, when we GA
> (or when Ansible 2.3 does).

Ansible is behaving the same way as SDK: if you don't specify override_iptables option when invoking ovirt_hosts module, the default value is defined in backend code (same as for API request). ovirt_hosts module doesn't contain any default value for that option.

So when we change default on backend it will not affect only API/SDKs but also Ansible module.

Unfortunately we don't have 'override_iptables: True' in examples inside ovirt_hosts module, but we will post a PR to fix that (hopefully it will get into Ansible 2.3.0 release).

Comment 24 Martin Perina 2017-03-08 11:27:33 UTC
It makes sense to override firewall rules by default also when reinstalling the host. With this change we will have the same behaviour in both UI and API.

Comment 25 Aleksei Slaikovskii 2017-05-03 15:56:57 UTC
Verified on python-ovirt-engine-sdk4-4.1.3-1.el7ev.x86_64


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