cobbler服务安装centos7

本文介绍了如何利用cobbler服务进行CentOS7的批量安装。首先,新建虚拟机并选择自定义安装及稍后添加操作系统。安装成功后,进行定制安装步骤,包括统计服务器MAC地址,通过cobbler的web界面配置(URL: https://ip/cobbler_web,用户名和密码均为cobbler)。完成配置后同步并重启相关服务,实现开机自动安装系统。
摘要由CSDN通过智能技术生成

cobbler服务批量安装centos7

导入centos7镜像
[root@localhost ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# cobbler import --path=/mnt --name=centos-7 --arch=x86_64
task started: 2021-10-14_015218_import
task started (id=Media import, time=Thu Oct 14 01:52:18 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/centos-7-x86_64:
creating new distro: centos-7-x86_64
trying symlink: /var/www/cobbler/ks_mirror/centos-7-x86_64 -> /var/www/cobbler/links/centos-7-x86_64
creating new profile: centos-7-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/centos-7-x86_64 for centos-7-x86_64
processing repo at : /var/www/cobbler/ks_mirror/centos-7-x86_64	//导入镜像的位置
need to process repo/comps: /var/www/cobbler/ks_mirror/centos-7-x86_64
looking for /var/www/cobbler/ks_mirror/centos-7-x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/centos-7-x86_64/repodata
*** TASK COMPLETE ***

说明:
    --path      //镜像路径
    --name      //为安装源定义一个名字
    --arch      //指定安装源平台
安装源的唯一标示就是根据name参数来定义,本例导入成功后,安装源的唯一标示就是:CentOS-7-x86_64,如果重复,系统会提示导入失败

查看cobbler镜像列表
[root@localhost ~]# cobbler list
distros:
   centos-7-x86_64

profiles:
   centos-7-x86_64
   
systems:

repos:

images:

mgmtclasses:

packages:

files:
创建kickstarts自动安装脚本
[root@localhost ~]# vim /var/lib/cobbler/kickstarts/centos-7-x86_64.ks 
[root@localhost ~]# cat /var/lib/cobbler/kickstarts/centos-7-x86_64.ks 
auth --enableshadow --passalgo=sha512
bootloader --location=mbr
clearpart --all --initlabel
part /boot --asprimary --fstype="ext4" --size=500
part swap --fstype="swap" --size=4096
part / --fstype="ext4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值