1) 挂载iso作为镜像的源
[root@srv ~]# mkdir /mnt/cdrom
[root@srv ~]# mount ./CentOS-7-x86_64-Minimal-2009.iso /mnt/cdrom
mount: /dev/loop0 is write-protected, mounting read-only
2) 导入镜像
[root@srv ~]# cobbler import --path=/mnt/cdrom --name=CentOS79
task started: 2021-05-29_150622_import
task started (id=Media import, time=Sat May 29 15:06:22 2021)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/CentOS79:
creating new distro: CentOS79-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS79 -> /var/www/cobbler/links/CentOS79-x86_64
creating new profile: CentOS79-x86_64
associating repos
checking for rsync repo(s)
checking for rhn repo(s)
checking for yum repo(s)
starting descent into /var/www/cobbler/ks_mirror/CentOS79 for CentOS79-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS79
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS79
looking for /var/www/cobbler/ks_mirror/CentOS79/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS79/repodata
*** TASK COMPLETE ***
3) 列示镜像
[root@srv ~]# # cobbler list
distros:
CentOS79-x86_64
profiles:
CentOS79-x86_64
systems:
repos:
images:
mgmtclasses:
packages:
files:
4) 重启cobblerd服务并同步
[root@srv ~]# systemctl restart cobblerd
[root@srv ~]# cobbler sync
task started: 2021-05-29_150832_sync
task started (id=Sync, time=Sat May 29 15:08:32 2021)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/CentOS79-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/images/CentOS79-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
copying distros to tftpboot
copying files for distro: CentOS79-x86_64
trying hardlink /var/www/cobbler/ks_mirror/CentOS79/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/CentOS79-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/CentOS79/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/CentOS79-x86_64/initrd.img
copying images
generating PXE configuration files
generating PXE menu structure
copying files for distro: CentOS79-x86_64
trying hardlink /var/www/cobbler/ks_mirror/CentOS79/images/pxeboot/vmlinuz -> /var/www/cobbler/images/CentOS79-x86_64/vmlinuz
trying hardlink /var/www/cobbler/ks_mirror/CentOS79/images/pxeboot/initrd.img -> /var/www/cobbler/images/CentOS79-x86_64/initrd.img
Writing template files for CentOS79-x86_64
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
processing boot_files for distro: CentOS79-x86_64
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout:
received on stderr: Redirecting to /bin/systemctl restart dhcpd.service
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.manage_genders
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
6) 验证Web是否可以正常访问
[浏览器]---http://192.168.1.11/cobbler/ks_mirror/

5) 带有pxe的客户端测试






|