Bug 854859 - Anaconda ignores --activate parameter in kickstart file when it's used in "%include file" section
Anaconda ignores --activate parameter in kickstart file when it's used in "%i...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: anaconda (Show other bugs)
6.3
All All
medium Severity medium
: rc
: ---
Assigned To: Anaconda Maintenance Team
Release Test Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-06 03:39 EDT by Petr Ruzicka
Modified: 2013-03-07 19:13 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-10 10:40:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Video showing the problem. (3.57 MB, video/x-msvideo)
2012-09-06 04:09 EDT, Petr Ruzicka
no flags Details
Sample kickstart file (531 bytes, application/octet-stream)
2012-09-06 04:30 EDT, Petr Ruzicka
no flags Details
Anaconda logs (49.55 KB, application/x-bzip2)
2012-09-06 05:31 EDT, Petr Ruzicka
no flags Details

  None (edit)
Description Petr Ruzicka 2012-09-06 03:39:09 EDT
*** 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 03:56:00 EDT
Created attachment 610206 [details]
Sample kickstart file
Comment 3 Petr Ruzicka 2012-09-06 04:08:52 EDT
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 04:09:53 EDT
Created attachment 610222 [details]
Video showing the problem.
Comment 5 Petr Ruzicka 2012-09-06 04:30:58 EDT
Created attachment 610225 [details]
Sample kickstart file
Comment 6 Petr Ruzicka 2012-09-06 05:30:35 EDT
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 05:31:11 EDT
Created attachment 610241 [details]
Anaconda logs
Comment 8 Petr Ruzicka 2012-09-06 09:32:37 EDT
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 10:40:46 EDT
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.

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