Bug 1295041

Summary: [RFE] add IPv6 support to ovirt-setup-lib
Product: [oVirt] ovirt-setup-lib Reporter: Yevgeny Zaspitsky <yzaspits>
Component: RFEsAssignee: Yedidyah Bar David <didi>
Status: CLOSED CURRENTRELEASE QA Contact: Roni <reliezer>
Severity: medium Docs Contact:
Priority: high    
Version: 1.0.0CC: bugs, danken, dholler, eheftman, mburman, myakove, sbonazzo, ylavi
Target Milestone: ovirt-4.2.6Keywords: FutureFeature
Target Release: ---Flags: rule-engine: ovirt-4.2+
mburman: testing_plan_complete-
ylavi: planning_ack+
rule-engine: devel_ack+
mburman: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-setup-lib-1.1.5-1 Doc Type: Enhancement
Doc Text:
Previously, the engine-setup tool did not support host names that only resolved to an IPv6 address. In this release, the engine-setup tool supports host names that only resolve to an IPv6 address.
Story Points: ---
Clone Of:
: 1613507 (view as bug list) Environment:
Last Closed: 2018-09-03 15:08:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1080725, 1613507, 1613661    
Attachments:
Description Flags
terminal log of engine-setup
none
setup-engine_with_ipv4
none
setup-engine_with_ipv6
none
setup-engine_ipv6_no_virbr0 none

Description Yevgeny Zaspitsky 2016-01-01 09:26:12 UTC
Description of problem:
Setup does not allow defining engine hostname as one that resolves to ipv6 address only.

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


How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2016-01-10 07:22:06 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Sandro Bonazzola 2016-01-21 15:06:51 UTC
Simone, is this ovirt-setup-lib related? Or ovirt-engine-setup?

Comment 3 Simone Tiraboschi 2016-02-01 11:36:30 UTC
(In reply to Sandro Bonazzola from comment #2)
> Simone, is this ovirt-setup-lib related? Or ovirt-engine-setup?

Probably both

Comment 4 Dominik Holler 2018-06-29 10:44:21 UTC
Created attachment 1455492 [details]
terminal log of engine-setup

engine-setup works in IPv6. Ip is important to use engine-setup in offline mode, because the repos are net yet IPv6. After engine-setup webadmin is accessible via IPv6.

Comment 5 Roni 2018-07-03 14:09:01 UTC
Created attachment 1456252 [details]
setup-engine_with_ipv4

Comment 6 Roni 2018-07-03 14:09:42 UTC
Created attachment 1456253 [details]
setup-engine_with_ipv6

Comment 7 Roni 2018-07-03 14:13:38 UTC
There is an issue with IPv6 FQDN resolving.
IPv6 FQDN does not recognize by engine-setup

* A workaround is by setting 'hostname' as FQDN
(hostnamectl --set-hostname FQDN)

* Due to lack of IPv6 DHCP server and Domain Name resolving, 
test is using Static IPv6, and '/etc/hosts'

* Same scenario with IPv4 works fine!


NOTES:
======
1. setup-engine must be run with --offline (see Dominik's comments above) 
2. OVN must be set to 'No' during setup-engine due to following issue: https://bugzilla.redhat.com/show_bug.cgi?id=1593252


Scenario:
=========
1. Disable IPv4 for localhost

set /etc/hosts
#127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
2001::2     engine.ipv6


2. Disable IPv4 and enable only IPv6

cat /etc/sysconfig/network-scripts/ifcfg-eth0 
NAME="eth0"
HWADDR="00:1A:4A:16:98:76"
ONBOOT="yes"
NETBOOT="yes"
UUID="60de5581-79a7-4859-895e-29bf56f902e4"
IPV6INIT="yes"
#BOOTPROTO="dhcp"
BOOTPROTO="none"
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6ADDR="2001::2"

3. run engine-setup --offline
for the OVN question choose 'No'


Results:
========
- engine-setup will give and error, see attached setup-engine_with_ipv6
  WebUI will reject login due to mismatch FQDN 
- same scenario with IPv4 words fine, see attached  setup-engine_with_ipv4

Comment 8 Roni 2018-07-03 14:25:41 UTC
editing above comment....

Scenario:
=========
1. Disable IPv4 for localhost & define the IPv6 FQDN locally
2. Disable IPv4 and add static IPv6

Comment 9 Roni 2018-07-03 14:39:50 UTC
Created attachment 1456258 [details]
setup-engine_ipv6_no_virbr0

Comment 10 Roni 2018-07-03 15:06:39 UTC
According to Dominik Holler: "this has to be fixed in ovirt-setup-lib"

"<dholler> (I located the code which has to be changed in /usr/lib/python2.7/site-packages/ovirt_setup_lib/hostname.py)"

Comment 11 Yedidyah Bar David 2018-07-04 07:50:48 UTC
(In reply to Roni from comment #7)
> Results:
> ========
> - engine-setup will give and error, see attached setup-engine_with_ipv6

Please always attach the generated logs, as output by engine-setup:


[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20180703153401-4xmmu7.log

Thanks.

In current case, that's not needed:

(In reply to Roni from comment #10)
> According to Dominik Holler: "this has to be fixed in ovirt-setup-lib"
> 
> "<dholler> (I located the code which has to be changed in
> /usr/lib/python2.7/site-packages/ovirt_setup_lib/hostname.py)"

Indeed, in getResolvedAddresses.

Comment 12 Yedidyah Bar David 2018-07-04 07:58:35 UTC
(In reply to Yedidyah Bar David from comment #11)
> Indeed, in getResolvedAddresses.

Patching just this function (removing the third argument AF_INET) is not enough, will look at this later.

Comment 13 Dan Kenigsberg 2018-07-17 07:44:57 UTC
Sandro, may we attempt to solve this sooner than later? This may be raised as a hurdle for SHE-on-ipv6.

Comment 14 Sandro Bonazzola 2018-08-08 06:47:24 UTC
fix for this bug is included in ovirt-setup-lib-1.1.5-1 which is available for testing using https://resources.ovirt.org/pub/yum-repo/ovirt-release42-pre.rpm

Comment 15 Michael Burman 2018-08-20 11:20:16 UTC
Setting oVirt team as Network. I need this bug visible in our sprint board as we are the qa contact of this fix.

Comment 16 Roni 2018-08-20 15:40:59 UTC
verified on: 4.2.6.3-0.1.el7ev

Comment 17 Roni 2018-08-21 06:35:44 UTC
build 4.2.6.3-0.1.el7ev include: ovirt-setup-lib-1.1.5-1.el7ev.noarch