SUSE Manager features the Cobbler server that allows administrators to centralize their system installation and provisioning infrastructure. Cobbler is an installation server that provides various methods of performing unattended system installations, whether it be server, workstation, or guest systems in a full or para-virtualized setup.
Cobbler offers several tools to assist in pre-installation guidance, automated installation file management, installation environment management, and more. This section explains supported features of Cobbler, which include:
Installation environment analysis using the cobbler check command,
Multi-site installation server configuration with cobbler replicate,
Virtual machine guest installation automation with the koan client-side tool,
Building installation ISOs with PXE-like menus using the cobbler buildiso command for SUSE Manager systems with x86_64 architecture.
For more detailed upstream documentation on Cobbler, see http://cobbler.github.io/manuals/.
SUSE only support those Cobbler functions that are either listed within our formal documentation or available via the Web Interface and API.
To use Cobbler as a PXE boot server, follow these guidelines:
For system installation with PXE, you must have a TFTP server installed and configured. By default, SUSE Manager installs such a TFTP server.
To PXE boot systems for installation, you must either set up a DHCP server for Cobbler PXE booting or have access to your network’s DHCP server. Edit /etc/dhcp.conf to change next-server to the hostname or IP address of your Cobbler server.
When onboarding bare metal systems using the pxe-default-image, it’s important to ensure all systems to be on-board have unique hostnames. Otherwise, if you later assign a provisioning profile to it, the new configuration file will overwrite the configuration settings for any system with the duplicate hostname. Cobbler uses hostnames as a unique key for each system.
Cobbler configuration is mainly done in the /etc/cobbler/settings file.
With the default settings unchanged, Cobbler runs as intended.
All configurable settings are explained in detail in the /etc/cobbler/settings file with regard to how they affect functionality of Cobbler and whether it is recommended for users to adjust values to their environment.
If SUSE Manager complains about language “en” was not found within the list of supported languages available at /usr/share/YaST2/data/languages, remove the lang in /etc/cobbler/settings or add a proper value such as en_US.
For background info, see https://www.suse.com/support/kb/doc?id=7018334.
Cobbler supports bare-metal automated installation of systems configured to perform network boots using a PXE boot server. To properly implement a Cobbler installation server, administrators need to either have administrative access to the network’s DHCP server or set up DHCP on the Cobbler server itself.
If you have a DHCP server deployed on another system in the network, you will need administrative access to the DHCP server to edit the DHCP configuration file so that it points to the Cobbler server and PXE boot image.
As root on the DHCP server, edit the /etc/dhcpd.conf file and append a new class with options for performing PXE boot installation.
For example:
allow booting; allow bootp; 1 class "PXE" 2 {match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; 3 next-server 192.168.2.1; 4 filename "pxelinux.0";} 5
Enable network booting with the | |
Create a class called | |
A system configured to have PXE first in its boot priority identifies itself as | |
As a result, the DHCP server directs the system to the Cobbler server at | |
The DHCP server retrieves the |
Not necessarily for production, but for lab or demo environments you can alternativly set up PXE boot in KVM.
Such a configuration can replace the next-server setting on a DHCP server explained in Section 10.2.2.1, “Configuring an Existing DHCP Server”.
To edit the network XML description with virsh, proceed as follow:
Produce an XML dump of the current description:
virsh net-dumpxml --inactive network > network.xml
Open the XML dump file (here network.xml ) with a text editor and add a bootp statement within the <dhcp> element:
<bootp file='/pxelinux.0' server='192.168.100.153'/>
Install the edited description:
virsh net-define network.xml
Or try the net-edit subcommand that does some error checking.
<network>
<name>default</name>
<uuid>1da84185-31b5-4c8b-9ee2-a7f5ba39a7ee</uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:29:59:18'/>
<domain name='default'/>
<ip address='192.168.100.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.100.128' end='192.168.100.254'/>
<bootp file='/pxelinux.0' server='192.168.100.153'/> 1
</dhcp>
</ip>
</network>
|
SUSE Manager uses the atftpd daemon, but it can also operate with Xinetd/TFTP.
The atftpd is installed by default as the recommended method for providing PXE services.
Usually, you do not have to change its configuration, but if you have to, use the YaST Sysconfig Editor.
Xinetd is a daemon that manages a suite of services, including TFTP, the FTP server used for transferring the boot image to a PXE client.
To configure TFTP, you must first enable the service via Xinetd.
To do this, edit the /etc/xinetd.d/tftp file as root and change the disable = yes line to disable = no.
Before TFTP can serve the pxelinux.0 boot image, you must start the Xinetd service.
Start YaST and use › to configure the Xinetd daemon.
It is possible to sync cobbler generated TFTP contents to SUSE Manager Proxies to perform PXE booting via these proxies.
On the SUSE Manager Server as root, install the package susemanager-tftpsync:
zypper install susemanager-tftpsync
On the SUSE Manager Proxy systems as root, install the package susemanager-tftpsync-recv:
zypper install susemanager-tftpsync-recv
Execute configure-tftpsync.sh on the SUSE Manager Proxy systems.
This setup script asks for hostnames and IP addresses of the SUSE Manager server and the proxy.
Additionally, it asks for the tftpboot directory on the proxy.
For more information, see the output of configure-tftpsync.sh --help.
As root execute configure-tftpsync.sh on SUSE Manager Server:
configure-tftpsync.sh proxy1.example.com proxy2.example.com
Execute cobbler sync to initially push the files to the proxy systems.
This will succeed if all listed proxies are properly configured.
You can call configure-tftpsync.sh to change the list of proxy systems.
You must always provide the full list of proxy systems.
In case you reinstall an already configured proxy and want to push all files again you must remove the cache file /var/lib/cobbler/pxe_cache.json before you can call cobbler sync again.
The SUSE Manager Server must be able to access the SUSE Manager Proxy systems directly. Push via proxies is not possible.
Before starting the cobbler service, run a check on the cobbler service to make sure that all the prerequisites are configured according to the organization’s needs with the cobbler check command.
If content, start the SUSE Manager server with the following command:
/usr/sbin/spacewalk-service start
Do not start or stop the cobblerd service independent of the SUSE Manager service.
Doing so may cause errors and other issues.
Always use /usr/sbin/spacewalk-service to start or stop SUSE Manager.
If all Cobbler prerequisites have been met and Cobbler is running, you can use the Cobbler server as an installation source for a distribution:
Make installation files such as the kernel image and the initrd image available on the Cobbler server. Then add a distribution to Cobbler, using either the Web interface or the command line tools.
For information about creating and configuring AutoYaST or Kickstart distributions from the SUSE Manager interface, refer to Section 8.6, “Autoinstallation > Distributions”.
To create a distribution from the command line, use the cobbler command as root:
cobbler distro add --name=`string`--kernel=`path`--initrd=`path`
--name=string optionA label used to differentiate one distribution choice from another (for example, sles12server).
--kernel=path optionSpecifies the path to the kernel image file.
--initrd=path optionspecifies the path to the initial ram disk (initrd) image file.
Once you have added a distribution to Cobbler, you can add profiles.
Cobbler profiles associate a distribution with additional options like AutoYaST or Kickstart files. Profiles are the core unit of provisioning and there must be at least one Cobbler profile for every distribution added. For example, two profiles might be created for a Web server and a desktop configuration. While both profiles use the same distribution, the profiles are for different installation types.
For information about creating and configuring Kickstart and AutoYaST profiles in the SUSE Manager interface, refer to Section 8.3, “Autoinstallation > Profiles (Kickstart and AutoYaST)”.
Use the cobbler command as root to create profiles from the command line:
cobbler profile add --name=string --distro=string [--kickstart=url] \ [--virt-file-size=gigabytes] [--virt-ram=megabytes]
--name=stringThe unique label for the profile, such as sles12webserver or sles12workstation.
--distro=stringSpecifies the distribution that will be used for this particular profile. For adding distributions, see Section 10.3, “Adding a Distribution to Cobbler”.
--kickstart=urlSpecifies the location of the Kickstart file (if available).
--virt-file-size=gigabytesAllows you to set the size of the virtual guest file image. The default is 5 GB.
--virt-ram=megabytesSpecifies how many MB of physical RAM a virtual guest can consume. The default is 512 MB.
Once the distributions and profiles for Cobbler have been created, add systems to Cobbler. System records map a piece of hardware on a client with the cobbler profile assigned to run on it.
If you are provisioning via koan and PXE menus alone, it is not required to create system records.
They are useful when system-specific Kickstart templating is required or to establish that a specific system should always get specific content installed.
If a client is intended for a certain role, system records should be created for it.
For information about creating and configuring automated installation from the SUSE Manager interface, refer to Section 7.3.4, “System Details > Provisioning [Management]”.
Run the following command as root to add a system to the Cobbler configuration:
cobbler system add --name=string --profile=string \ --mac-address=AA:BB:CC:DD:EE:FF
--name=stringA unique label for the system, such as engineering_server or frontoffice_workstation.
--profile=stringSpecifies the name of one of the profiles added in Section 10.4, “Adding a Profile to Cobbler”.
--mac-address=AA:BB:CC:DD:EE:FFAllows systems with the specified MAC address automatically being provisioned to the profile associated with the system record when they are being installed.
For more options, such as setting hostname or IP addresses, refer to the Cobbler manpage (man cobbler).
The SUSE Manager Web interface facilitates creating variables for use with Kickstart distributions and profiles. To create a Kickstart profile variable, refer to Section 8.3.1.3, “Autoinstallation Details > Variables”.
Kickstart variables are part of an infrastructural change in SUSE Manager to support templating in Kickstart files. Kickstart templates are files describing how to build actual Kickstart files rather than creating specific Kickstarts.
These templates are shared by various profiles and systems that have their own variables and corresponding values. These variables modify the templates and a template engine parses the template and variable data into a usable Kickstart file. Cobbler uses an advanced template engine called Cheetah that provides support for templates, variables, and snippets.
Advantages of using templates include:
Robust features that allow administrators to create and manage large amounts of profiles or systems without duplication of effort or manually creating Kickstarts for every unique situation.
While templates can become complex and involve loops, conditionals and other enhanced features and syntax, you can keep them simple by creating Kickstart files without such complexity.
Kickstart templates can have static values for certain common items such as PXE image file names, subnet addresses, and common paths such as /etc/sysconfig/network-scripts/.
However, templates differ from standard Kickstart files in their use of variables.
For example, a standard Kickstart file may have a networking section similar to the following:
network --device=eth0 --bootproto=static --ip=192.168.100.24 \ --netmask=255.255.255.0 --gateway=192.168.100.1 --nameserver=192.168.100.2
In a Kickstart template file, the networking section would rather look like this:
network --device=$net_dev --bootproto=static --ip=$ip_addr \ --netmask=255.255.255.0 --gateway=$my_gateway --nameserver=$my_nameserver
These variables will be substituted with the values set in your Kickstart profile variables or in your system detail variables. If the same variables are defined in both the profile and the system detail, then the system detail variable takes precedence.
The template for the autoinstallation has syntax rules, using punctuation symbols. To avoid clashes, they need to be properly treated.
In case the autoinstallation scenario contains any shell script using variables like $(example), its content should be escaped by using the backslash symbol: \$(example).
If the variable named example is defined in the autoinstallation snippet, the templating engine will evaluate $example with its content.
If there is no such variable, the content will be left unchanged.
Escaping the $ symbol will prevent the templating engine to perform its evaluation as an internal variable.
Long scripts or strings can be escaped by wrapping them with the \#raw and \#end raw directives.
For example:
#raw
#!/bin/bash
for i in {0..2}; do
echo "$i - Hello World!"
done
#end rawAlso, pay attention to similar scenarios like the following:
#start some section (this is a comment) echo "Hello, world" #end some section (this is a comment)
Any line with a # symbol followed by a whitespace is treated as a comment and is therefore not evaluated.
For more information about Kickstart templates, refer to the Cobbler project page at:
If you have common configurations across all Kickstart templates and profiles, you can use the Snippets feature of Cobbler to take advantage of code reuse.
Kickstart snippets are sections of Kickstart code that can be called by a $SNIPPET() function that will be parsed by Cobbler and substituted with the contents of the snippet.
For example, you might have a common hard drive partition configuration for all servers, such as:
clearpart --all part /boot --fstype ext3 --size=150 --asprimary part / --fstype ext3 --size=40000 --asprimary part swap --recommended part pv.00 --size=1 --grow volgroup vg00 pv.00 logvol /var --name=var vgname=vg00 --fstype ext3 --size=5000
Save this snippet of the configuration to a file like my_partition and place the file in /var/lib/cobbler/snippets/, where Cobbler can access it.
Use the snippet by calling the $SNIPPET() function in your Kickstart templates.
For example:
$SNIPPET('my_partition')Wherever you invoke that function, the Cheetah parser will substitute the function with the snippet of code contained in the my_partition file.
Whether you are provisioning guests on a virtual machine or reinstalling a new distribution on a running system, koan works in conjunction with Cobbler to provision systems.
If you have created a virtual machine profile as documented in Section 10.4, “Adding a Profile to Cobbler”, you can use koan to initiate the installation of a virtual guest on a system.
For example, create a Cobbler profile with the following command:
cobbler add profile --name=virtualfileserver \ --distro=sles12-x86_64-server --virt-file-size=20 --virt-ram=1000
This profile is for a fileserver running SUSE Linux Enterprise Server 12 with a 20 GB guest image size and allocated 1 GB of system RAM.
To find the name of the virtual guest system profile, run the following koan command:
koan --server=hostname --list-profiles
This command lists all the available profiles created with cobbler profile add.
Start creating the image file and the installation of the virtual guest system:
koan --virt --server=cobbler-server.example.com \ --profile=virtualfileserver --virtname=marketingfileserver
The command specifies that a virtual guest system be created from the Cobbler server (hostname cobbler-server.example.com) using the virtualfileserver profile.
The virtname option specifies a label for the virtual guest, which by default is the system’s MAC address.
Once the installation of the virtual guest is complete, it can be used as any other virtual guest system.
koan can replace a still running system with a new installation from the available Cobbler profiles by executing the following command on the system to be reinstalled:
koan --replace-self --server=hostname --profile=name
This command, running on the system to be replaced, will start the provisioning process and replace its own system using the profile in --profile=name on the Cobbler server specified in --server=hostname.
Some environments might lack PXE support.
The cobbler buildiso command provides functionality to create a boot ISO image containing a set of distributions and kernels, and a menu similar to PXE network installations.
Define the name and output location of the boot ISO using the --iso option.
Depending on Cobbler related systemd settings (see /usr/lib/systemd/system/cobblerd.service) writing ISO images to public tmp directories will not work.
cobbler buildiso --iso=/path/to/boot.iso
The boot ISO includes all profiles and systems by default.
Limit these profiles and systems using the --profiles and --systems options.
cobbler buildiso --systems="system1,system2,system3" \ --profiles="profile1,profile2,profile3"
Building ISOs with the cobbler buildiso command is supported for all architectures except the z Systems architecture.