Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise Server for SAP Applications 15 SP1

13 Creating Operating System Images Edit source

There are multiple ways to create custom operating system images from SUSE Linux Enterprise Server for SAP Applications. The preferred way is generally to use KIWI, which ingests an XML configuration file and then runs fully automatically.

Alternatively, you can also create an image from an existing installation that is cleaned up before re-use.

13.1 Creating Images with KIWI Edit source

KIWI is a tool to create operating system images that can be easily copied to new physical or virtual machines. This section will present information on creating SLES-SAP images with KIWI.

SUSE Linux Enterprise Server for SAP Applications now supports creating images with KIWI using the template from the package kiwi-template-sap. However, there are certain restrictions in the current implementation:

  • Only building VMX disk images is supported. Building other image types is not supported.

  • You must provide an ISO image of SUSE Linux Enterprise Server for SAP Applications at /tmp/SLES4SAP.iso, as the Open Build Service does not contain all necessary packages.

To build a basic image, use the following two commands:

  1. Build the root file system:

    root # kiwi -p SLES4SAP --root fsroot
  2. Build the VMX image:

    root # kiwi --create fsroot --type vmx -d build

To enable running graphical installations using SAPinst, the default settings of the image enable the following:

  • Installation of an IceWM desktop

  • The service xrdp is started automatically, so you can connect to the machine via RDP. For more information, see Chapter 12, Connecting via RDP.

For more information about KIWI and SLES-SAP:

13.2 Cleaning Up an Instance Before Using It as a Master Image Edit source

In some cases, it makes sense to use an image of an already-configured master instance on multiple systems instead of generating a KIWI image from scratch. For example, when your image needs to contain additional software or configuration that cannot be installed using KIWI.

However, normally such an image would contain certain configuration data that should not be copied along with the rest of the system.

To avoid needing to clean up manually, use the script clone-master-clean-up (available from the package of the same name).

It deletes the following data automatically:

  • Swap device (zero-wiped, then re-enabled)

  • SUSE registration information and repositories from SUSE, and the Zypper ID

  • User and host SSH keys and domain and host names

  • The generated HANA-Firewall script (but not the configuration itself)

  • Shell history, mails, cron jobs, temporary files (/tmp, /var/tmp), log files (/var/log), random seeds, systemd journal, collectd statistics, postfix configuration, parts of /root

  • /var/cache, /var/crash, /var/lib/systemd/coredump

Additionally, the following configuration is restored to defaults:

  • Network interfaces that do not use DHCP and network configuration (/etc/hostname, /etc/hosts, and /etc/resolv.conf)

  • sudo settings

Additionally, you can choose to set up a new root password. UUID-based entries in /etc/fstab are replaced by device strings. This script also ensures that if the first-boot section of the installation workflow was used for the original installation, it is run again on the next boot.

13.2.1 Configuring clone-master-clean-up Edit source

Before running clone-master-clean-up, the script can be configured in the following ways:

  • To configure the script to not clean up certain data, use the configuration file /etc/sysconfig/clone-master-clean-up.

    This file also gives short explanations of the available options.

  • To configure the script to clean up additional directories or files, create a list with the absolute paths of such directories and files:

    /additional/file/to/delete.now
    /additional/directory/to/remove

    Save this list as /var/adm/clone-master-clean-up/custom_remove.

13.2.2 Using clone-master-clean-up Edit source

To use the script, do:

root # clone-master-clean-up

Then follow the instructions.

13.2.3 For More Information Edit source

The following sources provide additional information about clone-master-clean-up:

  • For general information, see the man page clone-master-clean-up.

  • For information on which files and directories might additionally be useful to delete, see /var/adm/clone-master-clean-up/custom_remove.template.

Print this page