User Tools

Site Tools


Sidebar

software:cobbler:sles

What is it?

These are templates and scripts useful for deployment of SuSE Linux Enterprise Server (SLES) with cobbler.

Please note: The pieces below had landed in cobbler 2.2.3, and upstream cobbler 2.4.2 has further improvements for SuSE. So in most cases it should be better to look at vanilla cobbler.

If you use older cobbler versions then the code below might be useful. Tested with sles9/10/11 on cobbler 1.0, 1.6.x, 2.0 and 2.2 . The snippets have been extended recently to also work with cobbler 2.2 and newer (variable netmask is now used instead of subnet in former cobbler versions). Enhancement/comments appreciated.

importing sles into cobbler

sles10

This is the modern variant to import. We loopback mount the sles media and cobbler creates a copy of the media contents.

mkdir /mnt/tmp
mount -o loop /path/sles10.2.iso /mnt/tmp
cobbler import --path=/mnt/tmp --name=sles-10.2

Alternatively, to prevent cobbler from creating a copy of the repository contents:

# loopback-mount the sles10 iso file
# cp -r it to /cobbler/webroot/x86_64/sles10sp2, then:
cobbler distro add --name=sles10sp2-x86_64 --arch=x86_64 --breed=suse \
  --kernel=/cobbler/webroot/x86_64/sles10sp2/boot/x86_64/loader/linux \
  --initrd=/cobbler/webroot/x86_64/sles10sp2/boot/x86_64/loader/initrd \
  --kopts='install=http://$serverip/sles10sp2'
cobbler profile add --name=sles10sp2-x86_64 --distro=sles10sp2-x86_64
cobbler profile edit --name=sles10sp2-x86_64 \
  --kickstart='/cobbler/template_sles10.cfg'
cobbler profile edit --name=sles10sp2-x86_64 \
  --kopts='textmode=1 !text !ksdevice !kssendmac !lang'

sles11

This is the modern variant to import, tested i.e. with cobbler 2.2.3. We loopback mount the sles media and cobbler creates a copy of the media contents.

mkdir /mnt/tmp
mount -o loop /path/sles11.iso /mnt/tmp
cobbler import --path=/mnt/tmp --name=sles-11.1

Alternatively, to prevent cobbler from creating a copy of the repository contents:

# loopback-mount the sles11 iso file and 
# cp -r it to /cobbler/webroot/x86_64/sles11, then:
cobbler distro add --name=sles11-x86_64 --arch=x86_64 --breed=suse \
  --kernel=/cobbler/webroot/x86_64/sles11/boot/x86_64/loader/linux \
  --initrd=/cobbler/webroot/x86_64/sles11/boot/x86_64/loader/initrd \
  --kopts='install=http://$serverip/x86_64/sles11'
cobbler profile add --name=sles11-x86_64 --distro=sles11-x86_64
cobbler profile edit --name=sles11-x86_64 \
  --kickstart='/cobbler/template_sles11.cfg'
cobbler profile edit --name=sles11-x86_64 \
  --kopts='textmode=1 !text !ksdevice !kssendmac !lang'

templates for a start

template_sles10.cfg can be used as template for a SLES10 kickstart-file (actually autoyast-file in SuSE naming scheme, but for cobbler still –kickstart will carry the path to this value). template_sles11.cfg can be used as template for sles11. Passwords are 'cobbler', can be overridden with a ksmeta-var. There is also template_sles9.cfg

SuSE is using xml-syntax.

the snippets used by the templates

networking

interfaces_pre_sles10 and interfaces_post_sles10 get included as snippets. Together they do the same interface-ordering that works for redhat-distos: cobbler systems can be configured with multiple interfaces (i.e. 'cobbler system edit --name=.. --interface=eth1 --mac=... --ip=...') and appear after system-deployment in that order. The sles11-template is using similiar scripts. Bonding not implemented. Setting the dns-domain works same as for redhat: 'cobbler system edit –name=… –hostname=host.domain.tld' .

packages

packages_big_sles and packages_tiny_sles are package-selections, separated as snippets. Working for sles10 and sles11.

partitioning

partitioning_default_lvm_sles10 is included as usable partitioning. Apparently placing the /-filesystem on a LVM-volume with autoyast doesnt work. partitioning_default_lvm_sles11 is used by the sles11-template, using LVM for partitioning. A ksmeta-variable 'swapsize' can optionally be set to modify a default-swapsize of 2000MB. This ksmeta is also implemented in the partitioning-scripts used here for redhat distros.

cleaning up

post_cleanup_services is disabling services, mostly useful for sles9/sles10, sles11 is slim by default service-wise. Also irqbalance is disabled on singlecpu-systems, microcode-updates get disabled on AMD-cpu and smartd is disabled on vmware-systems.

postinstall script wrapper

For redhat-distros pure shellcode can be used in snippets in the postinstall-section. SuSE needs xml-syntax bevore and after the shellcode. To make snippets compatible with bot Redhat and SuSE based syntax post_sles_scriptwrapper can be used. Syntax is like this:

#set global $wrappedscript = 'snippet_sles/post_cleanup_grubconfig_menu.lst'
$SNIPPET('snippet_sles/post_sles_scriptwrapper')

Here post_cleanup_grubconfig_menu.lst (in directory snippet_sles) is set as value in the global variable $wrapperscript. Then the scriptswapper is called, outputting the xml-header/footer and calling the script mentioned in $wrappedscript.

grubcleaning

post_cleanup_grubconfig_menu.lst disables graphic-stuff in the grubconfig (for all of sles9/10/11). This is pure shell-code and using the scriptwrapper mentioned above.

software/cobbler/sles.txt · Last modified: 2021/03/23 12:22 (external edit)