Bug 510299 - Static network handling is broken
Static network handling is broken
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning (Show other bugs)
530
All Linux
low Severity medium
: ---
: ---
Assigned To: Partha Aji
Preethi Thomas
: Regression
Depends On:
Blocks: 457075
  Show dependency treegraph
 
Reported: 2009-07-08 11:48 EDT by Justin Sherrill
Modified: 2009-09-10 15:27 EDT (History)
4 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Justin Sherrill 2009-07-08 11:48:28 EDT
In 5.2 we did the following if the user had selected static networking for a profile:


1.  We would embed the kickstart within the initrd during kickstart initiation
2.  We would re-write the 'network' line of the kickstart when rendering it for a re-provisioning so that it matched that interface. 


Currently we are doing neither of these things.  I spoke with mike and these were our thoughts on how to implement this:





<jsherrill> we more the 'use dhcp interface' and 'use static interface' to the provisioning page
<jsherrill> take it off the profile page \
<jsherrill> move*
<jsherrill> then if they select static, we set the static flag in the cobbler system record 
<jsherrill> and use the snippet for the network line
<jsherrill> now if we didn't want to always use the snippet for the network line
<jsherrill> (i.e only use it if they select static, to reduce risk)
<jsherrill> we could create an if statement in the templates
<jsherrill> that basically say
<jsherrill> if some variable ($static for instance) is defined and set to 1
<jsherrill> use the snippet
<jsherrill> else
<jsherrill> just use 'network --bootproto dhcp'
<jsherrill> mccun934,  does that make sense ?
<mccun934> jsherrill: that does
Comment 1 Clifford Perry 2009-07-08 12:05:36 EDT
Sounds good to me. Static I am sure is still widely used in server environments. 

Cliff
Comment 2 Partha Aji 2009-07-13 10:41:23 EDT
Should be resolved as of http://git.fedorahosted.org/git/?p=spacewalk.git;a=commit;h=26aa7de5d7692f814e9f609d47c004f11a6f82f2


Following changes were made to the workflow
1) The Network Interface  selection was moved from Profile -> System Details to SDC -> Provisioning-> Schedule -> Advanced Configuration page, for the network option is more system specific than profile specific. So if you want to set provision thru static IP go to SDC Provisioning advanced configuration page.
 That being said, if the user wants to use network --bootproto  static for bare metal KS they can still go to Profiles -> Profile -> Advanced Options and add the bootproto line to network command. 

2) This option has been added to SSM provisioning also.

3) Spacewalk koan has been modified to deal with the static device addition and embed the kickstart in the initrd image similar to what was done in 5.2.
Comment 3 Partha Aji 2009-07-16 15:09:10 EDT
Muliple areas to test.
* SSH to your system and get the following details of your system,
Device/Interface Name (usually eth0)-> ifconfig,

IP Address:
ifconfig $DEVICE | perl -lne '/inet addr:([\d.]+)/ and print $1'

Netmask:
ifconfig $DEVICE | perl -lne '/Mask:([\d.]+)/ and print $1'

Hostname:
hostname

Nameservers:
cat /etc/resolv.conf | perl -lne '/^nameserver\s+(\S+)$/ and print $1'

Gateway:
route -n | grep '^0.0.0.0' | awk  '{print $2}'


*  SDC to that system -> Provisioning-> Schedule -> Advanced Configuration page change DHCP to static and select an interface (lets say eth0 for our example)..
*  Click Schedule and Finish
* rhn_check make sure it schedules everything ok
* shutdown -c, 
find the initrd image name from /etc/grub.conf  and look under /boot
cp the image to a tmp location and
gunzip < initrd.img | cpio -i --make-directories
make sure you find a ks.cfg file in the base dir with the following line, 
* network --bootproto static --device <DEVICE> --ip <IP> --gateway <GATEWAY> --nameserver <NAMESERVER> --netmask <NETMASK> --hostname <HOSTNAME>
the variables should be the same as the interface values you computed in the first step

If you are satisfied with this , reboot the machine and after a successful kickstart check -> /etc/sysconfig/network-scripts/ifcfg-<DEVICE>
you should see the correct values  for

DEVICE=<DEVICE>
HWADDR=<HWADDR>
ONBOOT=yes
BOOTPROTO=static
IPADDR=<IP>
NETMASK=<NETMASK>
DNS1=<NAMESERVER>


also check the host name.. "hostname"
It should look ok

also look at
Couple of things I 'd also test 
Select a Kickstart Profile and go to Advanced Options 
Change the network line from 
network: --bootproto dhcp
to
network: --bootproto dhcp TESTFOO
Go to kickstart file 
You should see the line-> 
network --bootproto dhcp TESTFOO
Comment 4 Partha Aji 2009-07-16 15:38:44 EDT
Just noticed that the spacewalkkoan code running this was determining the ip in an incorrect manner. Its using 
ifconfig  | perl -lne '/inet addr:([\d.]+)/ and print $1' 
instead of 
ifconfig <DEVICE NAME> | perl -lne '/inet addr:([\d.]+)/ and print $1' 

the first can potentially be wrong if more than 2 interfaces exist on the system.
Comment 6 Preethi Thomas 2009-07-23 14:43:45 EDT
fails_qa
Satellite-5.3.0-RHEL5-re20090721.0-i386-embedded-oracle.iso

after satitc kickstart
[root@rlx-0-10 network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:42:52:00:ED:D6
ONBOOT=yes
BOOTPROTO=dhcp
Comment 7 Preethi Thomas 2009-07-23 14:44:10 EDT
sorry I meant to fails_qa.
Comment 9 Preethi Thomas 2009-07-24 11:06:35 EDT
Satellite-5.3.0-RHEL5-re20090721.0-i386-embedded-oracle.iso
Yum updated to the latest
after static kickstart
[root@fjs-0-20 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:C0:9F:AC:62:4B
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.10.76.147
NETMASK=255.255.254.0
DNS1=172.16.52.28
DNS2=172.16.52.27
Comment 10 Brandon Perkins 2009-09-10 15:27:13 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

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