Bug 1338631

Summary: "SettingsNotFoundError" occur during install with ipv6 parameter in kickstart file.
Product: Red Hat Enterprise Linux 7 Reporter: Wei Wang <weiwang>
Component: anacondaAssignee: Radek Vykydal <rvykydal>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: bugs, cshao, fdeutsch, huzhao, leiwang, rvykydal, weiwang, yaniwang, ycui
Target Milestone: beta   
Target Release: 7.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1339156 (view as bug list) Environment:
Last Closed: 2016-11-16 10:50:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1329957    
Attachments:
Description Flags
tmp log files
none
/var/log/*.*
none
ks file
none
ks file none

Description Wei Wang 2016-05-23 07:34:18 UTC
Created attachment 1160471 [details]
tmp log files

Description of problem:
"SettingsNotFoundError" occur during install with ipv6 parameter in kickstart file.

Version-Release number of selected component (if applicable):
rhev-hypervisor7-ng-3.6-20160518.0
imgbased-0.6-0.1.el7ev.noarch vdsm-4.17.28-0.el7ev.noarch
Red Hat Enterprise Virtualization Manager Version: 3.6.6.2-0.1.el6


How reproducible:
100%

Steps to Reproduce:
1. Install ngn on machine with kickstart file in attachment
    keywords:
    network --device=enp0s25 --bootproto=static --ipv6=2001::1/64 --gateway=2001::2
2. Check the installation process

Actual results:
Installation failed, and "SettingsNotFoundError" occur.

Expected results:
Install successfully with ipv6 parameter


Additional info:

Comment 1 Wei Wang 2016-05-23 07:35:03 UTC
Created attachment 1160472 [details]
/var/log/*.*

Comment 2 Wei Wang 2016-05-23 07:36:33 UTC
Created attachment 1160473 [details]
ks file

Comment 3 Fabian Deutsch 2016-05-23 07:40:51 UTC
I can not find the error in the logs, but it looks like an issue in anaconda.

Comment 4 Radek Vykydal 2016-05-23 13:25:12 UTC
The --bootoproto option is used only for ipv4 configuration. If used one needs to supply at least --ip and --netmask. In case you don't want to configure ipv4 on a device (not to use default which is dhcp), use --noipv4.
Also, for ipv6 gateway there is --ipv6gateway option (documented in rhel 7 installation guide, seems to be missing in https://github.com/rhinstaller/pykickstart/blob/master/docs/kickstart-docs.rst#network).

What is the goal of your configuration?
Use ipv4 on the device during installation and configure ipv6 only for target system? Or configure static ipv6 additionally to ipv4 (dhcp)?

Comment 5 Radek Vykydal 2016-05-23 14:22:14 UTC
The connection on which anaconda crashes is not created because, as NM says:

07:20:45,048 WARNING NetworkManager: <warn>  ifcfg-rh: loading "/etc/sysconfig/network-scripts/ifcfg-enp0s25" fails: ipv4.addresses: this property cannot be empty for 'method=manual'

when parsing this ifcfg file:

07:20:49,254 DEBUG ifcfg: /etc/sysconfig/network-scripts/ifcfg-enp0s25:
07:20:49,254 DEBUG ifcfg:   # Generated by parse-kickstart
07:20:49,254 DEBUG ifcfg:   UUID=7d0ab369-4245-4067-b066-736b8250be67
07:20:49,254 DEBUG ifcfg:   IPADDR=
07:20:49,254 DEBUG ifcfg:   GATEWAY=2001::2
07:20:49,254 DEBUG ifcfg:   IPV6_AUTOCONF=no
07:20:49,255 DEBUG ifcfg:   NETMASK=
07:20:49,255 DEBUG ifcfg:   BOOTPROTO=static
07:20:49,255 DEBUG ifcfg:   DEVICE=enp0s25
07:20:49,255 DEBUG ifcfg:   IPV6ADDR=2001::1/64
07:20:49,255 DEBUG ifcfg:   ONBOOT=yes
07:20:49,255 DEBUG ifcfg:   IPV6INIT=yes


Anaconda probably shouldn't be crashing though.
With RHEL 7.3 nightly http://download.eng.brq.redhat.com/pub/rhel/nightly/RHEL-7.3-20160520.n.0/ the traceback doesn't occur. It is because new NM actually creates the connection for the ifcfg file.

Comment 6 Wei Wang 2016-05-24 03:22:30 UTC
Hi Radek,

I want to use ipv4 on the device during installation and configure ipv6 only for target system. And the configure ipv6 statically. Should I using kickstart commands like below?
   network --device=enp0s25 --bootproto=dhcp
   network --device=enp0s25 --noipv4 --ipv6=2001::1/64 --ipv6gateway=2001::2

test with above commands in kickstart file, it can be installed successfully, and the configuration file looks like right for ipv6
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s25 
# Generated by parse-kickstart
IPV6_DEFAULTGW=2001::2
IPV6INIT=yes
IPV6_AUTOCONF=no
BOOTPROTO=dhcp
DEVICE=enp0s25
IPV6ADDR=2001::1/64
ONBOOT=yes
UUID=836e9380-1725-4caf-9bd0-4aa98fcf5274
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME="System enp0s25"
PEERDNS=yes
PEERROUTES=yes

if so, I think some update should be done in https://github.com/rhinstaller/pykickstart/blob/master/docs/kickstart-docs.rst#network

Comment 7 Radek Vykydal 2016-05-24 08:57:46 UTC
You can configure a device only once in kickstart. The second configuration would override (or merge? the results are undefined) the first one. If you want to use different configurations of a device for installer environment and for target system, and you use networking in early stage (eg to fetch kickstart) configure the device for installation using boot options and for target system using kickstart.

In your case, the device configuration is not supplied via boot options, but because the device needs to be activated in early stage (initramfs) to fetch kickstart, dracut default is used which is: try dhcp on all devices. (If you wanted to configure the device for installer explicitly, you could use boot option ip=enp0s25:dhcp.)

For target system, you should be able to use just:

network --device=enp0s25 --noipv4 --ipv6=2001::1/64 --ipv6gateway=2001::2

(note that due to your first network command "network --device=enp0s25 --bootproto=dhcp", the device is configured to use dhcp for ipv4 on target system which is perhaps not what you want, using --noipv4)

The problem is that anaconda assumes --activate flag to be set for the first network command in kickstart, which means the device will be reactivated in later stage of installer (after switch root from initramfs when anaconda starts) with the kickstart configuration. We are thinking about removing this assumption (in scope of bug #1277975) to make the scenarios as yours possible.

As a workaround, make the network command be not the first one, ie use dummy first network command for nonexisting device [1]

network --device=DUMMY
network --device=enp0s25 --noipv4 --ipv6=2001::1/64 --ipv6gateway=2001::2

We should definitely update documentation (both https://github.com/rhinstaller/pykickstart/blob/master/docs/kickstart-docs.rst#network and RHEL 7 installation guide saying that:
--bootproto is option for ipv4 configuration
--noipv4 needs to be used to disable ipv4 configuration
I'm going to open BZ for documentation team.

[1] or network --hostname can be moved to be the first command if it should be configured.

Comment 8 Radek Vykydal 2016-05-24 10:57:18 UTC
(In reply to Radek Vykydal from comment #7)

> We should definitely update documentation (both
> https://github.com/rhinstaller/pykickstart/blob/master/docs/kickstart-docs.
> rst#network and RHEL 7 installation guide saying that:
> --bootproto is option for ipv4 configuration
> --noipv4 needs to be used to disable ipv4 configuration
> I'm going to open BZ for documentation team.

bug 1339156

Comment 9 Radek Vykydal 2016-05-26 12:53:50 UTC
Upstream documentation update PR:
https://github.com/rhinstaller/pykickstart/pull/86

Comment 10 Radek Vykydal 2016-05-27 14:42:29 UTC
I've prepared updates image for RHEL 7.2 installer with patch adding --no-activate option. To check that it would fix your issue you just need to add --no-activate to your kickstart command

e.g.

network --device=enp0s25 --noipv4 --ipv6=2001::1/64 --ipv6gateway=2001::2 --no-activate

and apply the updates image with boot option

updates=https://rvykydal.fedorapeople.org/updates.noactivate72.img

Comment 11 Fabian Deutsch 2016-06-03 21:34:25 UTC
Wei, can you help Radek with comment 10?

Comment 12 Wei Wang 2016-06-06 07:40:20 UTC
Test Version
rhev-hypervisor7-ng-4.0-20160603.0.x86_64
imgbased-0.7.0-0.1.el7ev.noarch

Test Steps:
1. Prepare kickstart file in attachment
   key parameter:
   network --device=enp0s25 --noipv4 --ipv6=2001::1/64 --gateway=2001::2 --no-activate

2. Install rhev-h with boot option and kickstart file in step 1
   updates=https://rvykydal.fedorapeople.org/updates.noactivate72.img

3. After reboot and login system, check device configuration file

Result:
Install successfully, and check result shows as below
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s25
# Generated by dracut initrd
NAME="enp0s25"
DEVICE="enp0s25"
ONBOOT=yes
NETBOOT=yes
UUID="0108e25a-d2d8-48d4-975c-78136a7938a5"
IPV6INIT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_AUTOCONF=no
IPV6ADDR=2001::1/64
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
PEERDNS=yes
PEERROUTES=yes

Comment 13 Wei Wang 2016-06-06 07:41:42 UTC
Created attachment 1165089 [details]
ks file

Comment 14 Radek Vykydal 2016-11-16 10:50:23 UTC
--no-activate option has been added to RHEL 7.3 so the approach from comment #10 should work in 7.3. I am closing this bug, if the solution does not work for you with 7.3 feel free to reopen it.