[Spacewalk-list] Virtualized guest provisioning and static IP

pradelles nicolas npradelles at eutelsat.fr
Tue Dec 13 10:11:12 UTC 2011


Hello,
I have already a bootproto=static configuration in the kickstart profile, network section:
-----8<-----
--noipv6 --bootproto=static --ip=X.X.X.X --netmask=Y.Y.Y.Y --gateway=Z.Z.Z.Z --nameserver=W.W.W.W --hostname=xxx.yyy.com
-----8<-----

If I use the "virt-install" command on the hypervisor to install the VM, the VM use this parameter to configure its interface with static IP. But with the Spacewalk interface the interface is configured in DHCP :(

If I install the VM within Spacewalk, I can find in the resulting file "/root/anaconda.ks" the following two sections of code who are not present when I use the "virt-install" manual command:
-----8<-----
%pre
...
# Start of code to match cobbler system interfaces to physical interfaces by their mac addresses
#  Start eth0
# Configuring eth0 (00:16:3e:45:6d:60)
if ifconfig -a | grep -i 00:16:3e:45:6d:60
then
  IFNAME=$(ifconfig -a | grep -i '00:16:3e:45:6d:60' | cut -d " " -f 1)
  echo "network --device=$IFNAME --bootproto=dhcp" >> /tmp/pre_install_network_config
fi
# End pre_install_network_config generated code
...

%post
...
mkdir /etc/sysconfig/network-scripts/cobbler
cp /etc/sysconfig/network-scripts/ifcfg-lo /etc/sysconfig/network-scripts/cobbler/
# Start configuration for eth0
IFNAME=$(ifconfig -a | grep -i '00:16:3E:45:6D:60' | cut -d ' ' -f 1)
if [ -f "/etc/modprobe.conf" ] && [ $IFNAME ]; then
    grep $IFNAME /etc/modprobe.conf | sed "s/$IFNAME/eth0/" >> /etc/modprobe.conf.cobbler
    grep -v $IFNAME /etc/modprobe.conf >> /etc/modprobe.conf.new
    rm -f /etc/modprobe.conf
    mv /etc/modprobe.conf.new /etc/modprobe.conf
fi
echo "DEVICE=eth0" > /etc/sysconfig/network-scripts/cobbler/ifcfg-eth0
echo "HWADDR=00:16:3E:45:6D:60" >> /etc/sysconfig/network-scripts/cobbler/ifcfg-eth0
echo "ONBOOT=yes" >> /etc/sysconfig/network-scripts/cobbler/ifcfg-eth0
echo "BOOTPROTO=dhcp" >> /etc/sysconfig/network-scripts/cobbler/ifcfg-eth0
# End configuration for eth0
rm -f /etc/sysconfig/network-scripts/ifcfg-*
mv /etc/sysconfig/network-scripts/cobbler/* /etc/sysconfig/network-scripts/
rm -r /etc/sysconfig/network-scripts/cobbler
if [ -f "/etc/modprobe.conf" ]; then
cat /etc/modprobe.conf.cobbler >> /etc/modprobe.conf
rm -f /etc/modprobe.conf.cobbler
fi
...
-----8<-----

It seems Cobbler overwrite my own IP configuration with a DHCP config.


Regards,
Nicolas



-----Original Message-----
From: spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Jan Pazdziora
Sent: vendredi 9 décembre 2011 17:25
To: spacewalk-list at redhat.com
Subject: Re: [Spacewalk-list] Virtualized guest provisioning and static IP

On Fri, Dec 02, 2011 at 11:00:46AM +0100, pradelles nicolas wrote:
> Hello,
> I have some virtualization hosts managed by Spacewalk and trying to 
> create VM provisioning with a VM static IP.
> 
> Instead the RH Satellite Deployement guide section 6.8.3, in the 
> "Virtualization => Provisioning => Advanced Configuration", I can only 
> choose DHCP in Network Connection section ("Use DHCP from interface XXX"
> or "DHCP using first available interface").
> 
> I can force a static IP for the installation boot by entering 
> following parameters in "kernel options" custom section:
> ip=WWW.WWW.WWW.WWW netmask=XXX.XXX.XXX.XXX dns=YYY.YYY.YYY.YYY 
> gateway=ZZZ.ZZZ.ZZZ.ZZZ
> 
> ... but after rebooting the final VM is booting in DHCP instead static 
> IP as defined in kickstart file.
> 
> 
> Any idea or advice ?

The behaviour of the system after reboot is driven by configuration setup by anaconda. The network setup of anaconda is done in kickstart's Advanced Options, in the network field. I believe your are looking for something like --bootproto=static. You should be able to find more in the anaconda configuration for your operating system.

--
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

This message may contain confidential or privileged information and is 
intended only for the personal and confidential use of the designated
recipient(s) named above. If you are not one of the intended recipients 
of this message you are hereby notified that any review, dissemination, 
distribution or copying is strictly prohibited. 
This communication is for information purposes only and should not be 
regarded as an official statement of Eutelsat S.A. or any of its 
subsidiaries. E-mail transmission cannot be guaranteed to be secure or 
error-free. Therefore, Eutelsat S.A. does not claim that this information
is complete or accurate and it should not be treated as such. 






More information about the Spacewalk-list mailing list