I've set up a local webserver to store kickstart files for domUs. All parameters are respected apart from the network settings. DomU always gets DHCP. Can any one help to unwrap this one? Does one add hostname, ip, netmask and gateway values to the /etc/xen/blah.cfg file? # ---- domU kickstart file ----# url --url http://192.168.1.120/centos/5/os/i386 lang en_US.UTF-8 keyboard uk network --device=eth0 --bootproto=static --netmask=255.255.255.0 --ip=192.168.1.115 --gateway=192.168.1.1 --nameserver=192.168.1.1 --hostname=dns1 --onboot=yes rootpw blahblahblah firewall --enabled --port=22:tcp authconfig --enableshadow --enablemd5 selinux --disabled timezone --utc Europe/London bootloader --location=mbr --driveorder=xvda --append="console=xvc0" clearpart --all --initlabel --drives=xvda part /boot --fstype ext3 --size=100 --ondisk=xvda --asprimary part / --fstype ext3 --size=10240 --grow --ondisk=xvda --asprimary part swap --size=1024 --ondisk=xvda --asprimary %packages @base @core # sudo cat /etc/xen/dns1.cfg ramdisk = "/home/jayeola/virt/images/centos_domU/initrd.img" kernel = "/home/jayeola/virt/images/centos_domU/vmlinuz"name = "dns1" maxmem = 1024 memory = 1024 vcpus = 1 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" disk = [ "tap:aio:/home/jayeola/virt/images/centos_domU/dns1.img,xvda,w" ] vif = [ "bridge=xenbr0,script=vif-bridge" ] extra = "text ks=http://192.168.1.120/dns1-ks.cfg" -- John Maclean 07739 171 531 MSc (DIC) Enterprise Linux Systems Engineer
Christopher G. Stach II
2010-Apr-06 11:12 UTC
[CentOS-virt] kickstart + domU for static IP
----- "john maclean" <jayeola at gmail.com> wrote:> I've set up a local webserver to store kickstart files for domUs. All > parameters are respected apart from the network settings. DomU always > gets DHCP. Can any one help to unwrap this one? Does one add > hostname, > ip, netmask and gateway values to the /etc/xen/blah.cfg file?If you mean before kickstart is even run:> extra = "text ks=http://192.168.1.120/dns1-ks.cfg"extra = "... ip=..." -- Christopher G. Stach II http://ldsys.net/~cgs/
From: "john maclean", Tuesday, April 06, 2010 4:11 AM> I've set up a local webserver to store kickstart files for domUs. All > parameters are respected apart from the network settings. DomU always > gets DHCP. Can any one help to unwrap this one? Does one add hostname, > ip, netmask and gateway values to the /etc/xen/blah.cfg file? > > # ---- domU kickstart file ----# > ... > > # sudo cat /etc/xen/dns1.cfg > ... > -- > John Maclean > 07739 171 531 > MSc (DIC) > > Enterprise Linux Systems EngineerIt's not quite clear to me what your process for creating the DomU is, but I think you're creating the xen config file by hand then running xm create <vm>? I'm not sure when you are having the IP issue. If during the installation process, anaconda has to initialize eth0 before it can get access to the kickstart file, so it must use DHCP. After some discussion with Russ some time ago, he convinced me that in most cases, virt-install is your friend. I use virt-install (specifying a mac address) to create my virtual machines, which sets up a boot partition, just like a physical machine, so my extra parameters go into the VM's /boot/grub/grub.conf file. I assign static IP addresses with DHCP during the install process and also set the IP address in the kickstart file (if it is a server). I like that the VM's config is mostly internal to the virtual disk image. I don't have a problem controlling my IP addresses.