Bug 854859

Summary: Anaconda ignores --activate parameter in kickstart file when it's used in "%include file" section
Product: Red Hat Enterprise Linux 6 Reporter: Petr Ruzicka <pruzicka>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: ana.perez, mhomolov
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-10 14:40:46 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:
Attachments:
Description Flags
Video showing the problem.
none
Sample kickstart file
none
Anaconda logs none

Description Petr Ruzicka 2012-09-06 07:39:09 UTC
*** Description of problem:
Anaconda didn't re-activate the network interface with specified network settings in the kickstart when using "network --activate".

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

*** How reproducible:
Start the RHEL 6.3 installation in the DHCP network. Put the attached kickstart file somewhere where the anaconda can grab it. 

*** Steps to Reproduce:
1. Let's have server connected to the "DHCP network". 
2. Create kickstart file with the following network settings:

network --activate --bootproto=static --ip=10.120.33.185 --netmask=255.255.255.0 --gateway=10.120.33.1 --nameserver=145.245.100.100

(or use the attached ones)

3. Anaconda didn't reactivate the network interface with the specified options.
  
*** Actual results:
The anaconda didn't reactivate the network interfaces according the settings in kickstart files. For the whole installation it's using the DHCP setting instead of using the static network parameters.

*** Expected results:
https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Installation_Guide/index.html#s1-kickstart2-options

Cite from installation manual:

If you use the --activate option on a device that has already been activated (for example, an interface you configured with boot options so that the system could retrieve the kickstart file) the device is reactivated to use the details specified in the kickstart file. 

*** Additional info:

Comment 2 Petr Ruzicka 2012-09-06 07:56:00 UTC
Created attachment 610206 [details]
Sample kickstart file

Comment 3 Petr Ruzicka 2012-09-06 08:08:52 UTC
Hello

Please note this it's working fine when using:

...
lang en_US
keyboard us
network --activate --bootproto=static --ip=10.1.3.2 --netmask=255.255.255.0 --gateway=10.1.3.1 --nameserver=10.1.3.1
zerombr
...

But it's not working in this case:

...
lang en_US
keyboard us
%include /tmp/Network
zerombr
...

%pre
echo 'network --activate --bootproto=static --ip=10.1.3.2 --netmask=255.255.255.0 --gateway=10.1.3.1 --nameserver=10.1.3.1' > /tmp/Network

So the problem appear only when using "%include".

Thank you

PetrR

Comment 4 Petr Ruzicka 2012-09-06 08:09:53 UTC
Created attachment 610222 [details]
Video showing the problem.

Comment 5 Petr Ruzicka 2012-09-06 08:30:58 UTC
Created attachment 610225 [details]
Sample kickstart file

Comment 6 Petr Ruzicka 2012-09-06 09:30:35 UTC
Hello.

I attached the anaconda log files (anaconda_logs.tar.bz2) where in directory "without-include" you can find the logs used with the kickstart:

...
lang en_US
keyboard us
network --activate --bootproto=static --ip=192.168.122.250 --netmask=255.255.255.0 --gateway=192.168.122.1 --nameserver=192.168.122.1
zerombr
...


^^^ this is working fine.


The logs in directory with-include contain the following kickstart:

...
lang en_US
keyboard us
%include /tmp/Network
zerombr
.
.
.
%pre
echo 'network --activate --bootproto=static --ip=192.168.122.250 --netmask=255.255.255.0 --gateway=192.168.122.1 --nameserver=192.168.122.1' > /tmp/Network

And this is not working properly.

Regards

Petr Ruzicka

Comment 7 Petr Ruzicka 2012-09-06 09:31:11 UTC
Created attachment 610241 [details]
Anaconda logs

Comment 8 Petr Ruzicka 2012-09-06 13:32:37 UTC
Hello.

The workaround can looks like:


install
cdrom
text
lang en_US
keyboard us
%include /tmp/Network
zerombr
clearpart --all
bootloader --location mbr
timezone America/Denver
auth --enablemd5 --enableshadow
rootpw redhat
selinux --disabled
firewall --disabled
skipx
key --skip
clearpart --all
part /boot --fstype="ext3" --size=200
part / --fstype="ext3" --size=5000
part swap --fstype="swap" --size=500

%packages
@Base

%pre
echo 'network --activate --bootproto=static --ip=192.168.122.250 --netmask=255.255.255.0 --gateway=192.168.122.1 --nameserver=192.168.122

sed -i 's/^BOOTPROTO=.*/BOOTPROTO=static/' /etc/sysconfig/network-scripts/ifcfg-eth0
cat >> /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
DNS1="192.168.122.1"
GATEWAY="192.168.122.1"
IPADDR="192.168.122.250"
NETMASK="255.255.255.0"
NM_CONTROLLED="yes"
EOF
mv /etc/sysconfig/network-scripts/ifcfg-eth0 /tmp/
mv /tmp/ifcfg-eth0 /etc/sysconfig/network-scripts/


Regards

Petr Ruzicka

Comment 9 Chris Lumens 2012-09-10 14:40:46 UTC
network commands cannot be in an include.  The network command is processed very early on (in loader) and loader does not understand includes.  This is really too much work for us to do anything about, either.  Sorry.