When setting up Hadoop, OpenStack, or Docker containers, as well as K8S clusters, multiple hosts are required. Installing them one by one can be cumbersome, so we can create a template that can be cloned as needed.This article takes CentOS Stream 8 as an example to create a Linux template.1. Install a Minimal System
Image download link:https://mirrors.aliyun.com/centos-vault/8-stream/isos/x86_64/The steps for installing the system are omitted here, as they are basic operations. Below is the configuration.
After installation, restart to begin creating the template.2. Clear Network Card Configuration Information
# cd /etc/sysconfig/network-scripts/ |
# vi ifcfg-ens160!! The network card name may not necessarily be ens160; VMware 16 and earlier versions are usually ens33. Edit according to your personal situation. |
3. Clear Key InformationKey information is automatically generated upon booting.
# cd /etc/ssh/ |
# rm -rf ssh_host_* |
4. Clear Machine ID
# cat /etc/machine-id |
# cat /dev/null > /etc/machine-id |
5. Shut Down the Virtual Machine
# init 0Note! At this point, the Linux template has been created. Since key information is automatically generated upon booting, do not power it on after shutting down. Just clone it when needed. |
This article concludes here. If you found it helpful, please leave a like for the author!