User Tools

Site Tools



create the cobbler-vm

cd /mnt/lv_public/kvm/images
cat ><<EOT

set -x

export VMNAME='cslave'
export VMNUMBER='45'

/usr/libexec/qemu-kvm \
        -hda /mnt/lv_public/kvm/images/${VMNAME}_image \
        -boot d \
        -m 512 \
        -k de \
        -smp 1 \
        -net nic,macaddr=00:de:ad:be:ef:7 \
        -net vde,vlan=0
        -no-reboot \
        -vnc :$VMNUMBER
#        -net nic,vlan=1,macaddr=00:de:ad:be:ef:$VMNUMBER,model=e1000 \
#        -net tap,vlan=1,script=/mnt/lv_public/kvm/images/qemu_add_tap_to_kvm0,downscript=no \

chmod +x
kvm-img create cslave_image 42G # create diskfile
sudo ./
# now do a basic installation.

# make sure network-interface is set up statically:
cat >/etc/sysconfig/network-scripts/ifcfg-eth0<<EOT

setup cobbler-services on the cobbler-vm

# I will use the http-export from the host also for the client-installs:
host$ echo '/mnt/centos,rw,no_subtree_check,no_root_squash)' >>/etc/exports
host$ /etc/init.d/nfs-kernel-server reload

# from now on at the cslave vm:
mkdir /mnt/centos
mount /mnt/centos

# lets setup epel-repos additionally:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
rpm -Uvh
yum install -y cobbler dhcp xinetd

chkconfig tftp on
service iptables stop; chkconfig iptables off
sed -i 's,enforcing,disabled,' /etc/sysconfig/selinux
setenforce 0

cd /etc/cobbler
vi settings
# manage_dhcp: 1
# server: # ip of the cobbler-vm
# next_server: # ip serving the tftp, here the host-linux

vi dhcp.template
# edit the subnet-section to look like this:
subnet netmask {
     option routers   ;
     option domain-name-servers;
     option subnet-mask;
     filename                   "/pxelinux.0";
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
# i also had to remove these 3 lines (dhcpd didnt like the resulting output):
        #if $iface.hostname:
            hostname $iface.hostname;
        #end if

service cobblerd start
cobbler sync
service dhcpd start
service httpd start
service xinetd start
for i in cobblerd dhcpd httpd xinetd; do chkconfig $i on; done

# now import the first distro
cobbler import --path=/mnt/centos --name=centos --available-as=

# and lets set the sample kickstart template
cobbler profile edit --name=centos-i386 --kickstart=/var/lib/cobbler/kickstarts/sample.ks

# now we are ready to cobbler-boot a client.
software/cobbler/cobblervm.txt ยท Last modified: 2021/03/23 12:22 (external edit)