Appendix: Creating Arbitrary CentOS ImagesΒΆ
Creating PXEboot Images in the Installation & Administrator Guide describes how to create PXEboot images from the latest CentOS 7 and 6 repos. This section describes how to create images from CentOS 7 and 6 repos that are not the latest packages.
For example, using the CentOS-7-x86_64-DVD-1908.iso ISO file,
you can use scyld-clusterctl repos
and scyld-clusterctl distros
to create a repo and distro for this Centos version 7.7,
then use scyld-modimg
to create an image and a boot config.
Or more simply you can use scyld-add-boot-config
to perform
the same result in fewer steps.
Execute the following and accept all the defaults:
scyld-add-boot-config --iso /mnt/isos/CentOS-7-x86_64-DVD-1908.iso
This creates a distro and repo both named CentOS-7-x86_64-1908, and an image and boot config both named CentOS-7-x86_64-1908.
Alternatively, you can avoid the manual acceptance of the defaults by specifying desired names and running the command in batch mode:
scyld-add-boot-config --iso /mnt/isos/CentOS-7-x86_64-DVD-1908.iso \
--image CentOS-7.7-Image --boot-config CentOS-7.7-Boot
View the result, which shows the default repo and the new repo, and the default boot config and the new boot config:
[admin@head]$ scyld-clusterctl distros ls -l
Distros
CentOS
name: CentOS
package_manager: yum
release: 7
repos
CentOS_base
CentOS-7-x86_64-1908
name: CentOS-7-x86_64-1908
package_manager: yum
release: none
repos
CentOS-7-x86_64-1908
[admin@head]$ scyld-bootctl ls -l
Boot Configurations
CentOS-7.7-Boot
cmdline: enforcing=0
image: CentOS-7.7-Image
initramfs
chksum: a85b01e91c26c52ebf549066c6c5fce544f3c75b
filename: 3684fbadf53f4c8bb8a3dea24ecf778d
mtime: 2022-03-18 16:49:06 UTC (1:14:23 ago)
size: 33.4 MiB (34978448 bytes)
kernel
chksum: 73872862a49ee024bf44c4d796c96bed4d52ee43
filename: 1d6888add971485395d943df191645c4
mtime: 2022-03-18 16:49:07 UTC (1:14:23 ago)
size: 6.4 MiB (6734016 bytes)
last_modified: 2022-03-18 16:49:07 UTC (1:14:23 ago)
name: CentOS-7.7-Boot
release: 3.10.0-1062.el7.x86_64
Note
Creating images from some older ISOs may produce an error message
beginning with ERROR: One or more repositories in the newly created image
are invalid or unreachable.
The scyld-modimg
tool will automatically retry the image creation,
and if there is no subsequent error reported, then the administrator can
assume that the resulting image is useable.
Important
If the CentOS image thus built is subsequently updated using
yum update
, then by default that updates packages to the latest minor
release level, not to newer versions at the image's current minor
release level.
Also, yum install
of additional packages may update dependency packages
from their current minor release version level to the latest minor level.
Such actions may result in a mixture of packages from different minor
releases, which may have unintended consequences.