[Spacewalk-list] Virtualized guest provisioning and static IP

Milan Zazrivec mzazrivec at redhat.com
Mon Jan 2 16:56:57 UTC 2012


On Tuesday 13 December 2011 11:11:12 pradelles nicolas wrote:
> 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, Nicolas, please see my comment

    https://bugzilla.redhat.com/show_bug.cgi?id=768070#c1

Regards
Milan Zázrivec




More information about the Spacewalk-list mailing list