Bug 865192 - F18 kickstart static networking not working in Beta TC2 and previous
Summary: F18 kickstart static networking not working in Beta TC2 and previous
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Radek Vykydal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-11 00:36 UTC by Scott Poore
Modified: 2013-02-01 10:50 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-01 10:50:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Scott Poore 2012-10-11 00:36:33 UTC
Description of problem:
I can't get a kickstart network line defining the static network to work. 

Version-Release number of selected component (if applicable):
I've tested this in Beta TC1, TC2, and some of the Alpha Composes.  

How reproducible:
Always

Steps to Reproduce:

I just tried a kickstart of F18 Beta TC1 and I'm seeing the same issue.

I'm using this line in my ks.cfg:

network  --bootproto=static --gateway=192.168.122.1 --ip=192.168.122.181 --nameserver=192.168.122.1 --netmask=255.255.255.0

But, /etc/sysconfig/network-scripts/ifcfg-eth0 shows this after build:

BOOTPROTO="dhcp"
ONBOOT="yes"

This is while doing an iso based install to a KVM guest with virt-install:

virt-install --connect=qemu:///system \
    --network=bridge:virbr0 \
    --initrd-inject=./${VMNAME}.ks \
    --extra-args="ks=file:/${VMNAME}.ks $EXTRAARGS" \
    --name=$VMNAME \
    --disk path=$DISKIMAGE,format=qcow2,size=8 \
    --ram 1024 \
    --vcpus=1 \
    --check-cpu \
    --hvm \
    --location=$OSIMG \
    --vnc --video=vga
  
Actual results:
Server comes up in DHCP instead of static with network defined.

Expected results:
Static networking used.

Additional info:

Comment 1 Peter McNabb 2012-10-11 22:11:42 UTC
This is a duplicate of Bug 853980

Comment 2 Scott Poore 2012-10-11 23:26:31 UTC
I'm not sure I understand how this is a dup of bug 853980.  Isn't that one a problem with qemu getting the extra-args stuff from virt-install?

In my case, the rest of my ks.cfg appears to be honored and used.  It's just the networking that doesn't appear to be set on Fedora 18 builds.  Of course my kickstart is pretty minimal.

Now, one thing I forgot to mention earlier is that after build, I do see two network lines in the anaconda-ks.cfg file:

network  --bootproto=static --gateway=192.168.122.1 --ip=192.168.122.181 --nameserver=192.168.122.1 --netmask=255.255.255.0
network  --bootproto=dhcp --hostname=f18-9.example.com

Unfortunately, all I've had time to see during boot so far is that it's using DHCP during anaconda.

Comment 3 Radek Vykydal 2012-10-12 10:29:00 UTC
It is probably actually broken in installer, ifcfg configuration coming from kickstart network command is overwritten by ifcfg files generated by dracut (dhcp in this case).

I am working on a fix for dracut.

Comment 4 Radek Vykydal 2012-10-19 12:33:50 UTC
Pa(In reply to comment #3)
 
> I am working on a fix for dracut.

http://www.spinics.net/lists/linux-initramfs/msg02901.html

Comment 5 Radek Vykydal 2012-11-23 15:00:41 UTC
This should by fixed the patch in dracut in F18 Beta RC1.
I am working on more fixes regarding --onboot and --activate options which don't behave as expected.

Comment 6 Adam Williamson 2012-12-07 19:12:21 UTC
Can anyone confirm the behaviour in Beta? Is it improved? Thanks!

Comment 7 Scott Poore 2012-12-11 00:55:25 UTC
I'm still seeing my config come up DHCP.

This is what I did this time:
##############################################
# Downloaded F18 x86_64 Beta ISO to /data/isos/F18B_64.iso
##############################################
used wget here...

##############################################
# Run virt-install
##############################################

/usr/bin/virt-install --connect=qemu:///system --network=bridge:virbr0 --initrd-inject=./f18-1.ks --extra-args="ks=file:/f18-1.ks console=tty0 console=ttyS0,115200 serial rd_NO_PLYMOUTH" --name=f18-1 --disk path=/data/VirtualMachines/f18-1.img,format=qcow2,size=8 --ram 1024 --vcpus=1 --check-cpu --hvm --location=/data/isos/F18B_64.iso --nographics

##############################################
# used this kickstart config file:
##############################################
# cat f18-1.ks 
install
rootpw testpwd
cdrom

#url --url=http://dl.fedoraproject.org/pub/fedora/linux/releases/test/18-Beta/Fedora/x86_64/os/

text
reboot
lang en_US.UTF-8
keyboard us
network --onboot=yes --bootproto=static --ip=192.168.122.181 --netmask=255.255.255.0 --gateway=192.168.122.1 --nameserver=192.168.122.1
rootpw testpwd
firewall --enabled --ssh
selinux --enforcing
timezone --utc America/New_York
bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 serial rd_NO_PLYMOUTH"

zerombr
clearpart --all --initlabel
autopart

%packages
@standard
%end
%post
passwd -u root
%end

##############################################
# Then, post-build on the F18 VM:  
##############################################

[root@localhost ~]# cat f18-1.ks
cat: f18-1.ks: No such file or directory
[root@localhost ~]# ls
anaconda-ks.cfg
[root@localhost ~]# cat anaconda-ks.cfg 
#version=DEVEL
# Install OS instead of upgrade
install
# Use CDROM installation media
cdrom
# Network information
network  --bootproto=static --gateway=192.168.122.1 --ip=192.168.122.181 --nameserver=192.168.122.1 --netmask=255.255.255.0
network  --hostname=localhost.localdomain
# Reboot after installation
reboot# Use text mode install
text
# Firewall configuration
firewall --enabled --service=ssh
ignoredisk --only-use=vda
# Keyboard layouts
# old format: keyboard us
# new format:
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Installation logging level
logging --level=info
# Root password
rootpw --plaintext testpwd
# SELinux configuration
selinux --enforcing
# System timezone
timezone America/New_York --isUtc
# System bootloader configuration
bootloader --append="console=tty0 console=ttyS0,115200 serial rd_NO_PLYMOUTH" --location=mbr --boot-drive=vda
autopart
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel 

%post
passwd -u root
%end

%packages
@standard

%end

##############################################
# check eth0 config
##############################################

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="52:54:00:D3:29:D8"
BOOTPROTO="dhcp"
ONBOOT="yes"
UUID="f3ba471b-a250-470a-9e46-41084b0b3a24"


############################################

Could this be happening now because my network line I use doesn't define hostname?  Or the should I have extra-args set network info for the virt-install?

Comment 8 Radek Vykydal 2012-12-19 14:35:49 UTC
The cause of static kickstart configuration not honoured is most probably missing --device specification in network command. (We used to pick some default before transition from loader to dracut)

Comment 9 Scott Poore 2012-12-21 01:02:57 UTC
Radek,

Thanks.  That was the problem.  Static is working from kickstart now.

[root@f18-2 anaconda]# grep ^network ~/anaconda-ks.cfg 
network  --bootproto=static --device=eth0 --gateway=192.168.122.1 --ip=192.168.122.182 --nameserver=192.168.122.1 --netmask=255.255.255.0
network  --hostname=f18-2.example.com

[root@f18-2 anaconda]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Generated by parse-kickstart
UUID=8916c83e-436f-4e96-afd4-ff6ca084a828
DNS1=192.168.122.1
IPADDR=192.168.122.182
GATEWAY=192.168.122.1
HWADDR=
NETMASK=255.255.255.0
BOOTPROTO=static
DEVICE=eth0
ONBOOT=yes

The second network line in the anaconda-ks.cfg still confuses me but, hey, it worked so I'm happy.

Thanks everyone.

Comment 10 Stephan Wiesand 2012-12-28 17:09:56 UTC
Doesn't work for me. F18 Beta installation using PXE on bare metal.

pxelinux.cfg:

default sl
IPAPPEND 2

label sl
  kernel vmlinuz.F18b
  append initrd=initrd.F18b ks=http://.../xyz.ks method=http://.../x86_64 noipv6 pci=bfsort ksdevice=bootif


Thus, at this stage DHCP is used. In %pre, a line for static configuration is generated and %included in xyz.ks. After installation:

# grep ^network anaconda-ks.cfg 
network  --bootproto=static --device=em1 --gateway=192.168.2.1 --hostname=xyz.example.com --ip=192.168.2.22 --nameserver=192.168.2.16,192.168.2.22 --netmask=255.255.255.0 --noipv6

# ip addr show em1
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether b8:ac:6f:86:1b:ca brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.22/24 brd 192.168.2.255 scope global em1
    inet6 fe80::baac:6fff:fe86:1bca/64 scope link 
       valid_lft forever preferred_lft forever

# cat /etc/sysconfig/network-scripts/ifcfg-em1
# Generated by dracut initrd
DEVICE=em1
ONBOOT=yes
NETBOOT=yes
UUID=82bd1251-fc76-415e-bd82-6df4d1433067
DHCPV6C=yes
BOOTPROTO=dhcp
HWADDR="b8:ac:6f:86:1b:ca"
TYPE=Ethernet
NAME="Boot Disk"


The failure to disable ipv6 at all stages is probably a different bug. Anaconda logs "Disabling ipv6 on target system" and after installation there's an /etc/modprobe.d/ipv6.conf containing "options ipv6 disable=1", but it's useless.

Comment 11 Radek Vykydal 2013-01-31 14:03:52 UTC
(In reply to comment #10)
  
> The failure to disable ipv6 at all stages is probably a different bug.
> Anaconda logs "Disabling ipv6 on target system" and after installation
> there's an /etc/modprobe.d/ipv6.conf containing "options ipv6 disable=1",
> but it's useless.

This issue should be fixed in master, anaconda-19.2-3 (F19).

Comment 12 Stephan Wiesand 2013-01-31 16:02:07 UTC
(In reply to comment #11)
> This issue should be fixed in master, anaconda-19.2-3 (F19).

Thanks.

The issue with static network configuration seems fixed too. At least it now works for me with F18 final, and I think I haven't changed anything relevant.

Comment 13 Radek Vykydal 2013-02-01 10:50:13 UTC
Thanks for letting know, we fixed dracut  so it doesn't overwrite kickstart files post F18 Beta which is most probably your case. I am closing the bug.


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