7 Cloning Disk Images #
If SUSE Linux Enterprise Server is installed in a virtualized environment, cloning an existing installation may be the fastest way to deploy further machines. SUSE Linux Enterprise Server provides a script to clean up configuration that is unique to each installation. With the introduction of systemd, unique system identifiers are used and set in different locations and files. Therefore, cloning is no longer the recommended way to build system images. Images can be created with KIWI NG, see https://doc.suse.com/kiwi/.
To clone disks of machines, refer to the documentation of your virtualization environment.
7.1 Cleaning Up Unique System Identifiers #
Executing the following procedure permanently deletes important system configuration data. If the source system for the clone is used in production, run the clean up script on the cloned image.
To clean all unique system identifiers, execute the following procedure
before or after cloning a disk image. If run on the clone, this procedure
needs to be run on each clone. Therefore, we recommend to create a
golden image
that is not used in production and only
serves as a source for new clones. The golden image is already cleaned
up and clones can be used immediately.
The clone-master-clean-up
command for example removes:
Swap files
Zypper repositories
SSH host and client keys
Temporary directories, like
/tmp/*
Postfix data
HANA firewall script
systemd journal
Use
zypper
to install clone-master-clean-up:root #
zypper
install clone-master-clean-upConfigure the behavior of
clone-master-clean-up
by editing/etc/sysconfig/clone-master-clean-up
. This configuration file defines whether users with a UID larger than 1000, the/etc/sudoers
file, Zypper repositories and Btrfs snapshots should be removed.Remove existing configuration and unique identifiers by running the script:
root #
clone-master-clean-up