CentOS7安装Cobbler+ESXI6.0

1、安装epelyum源

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

2、安装cobbler和依赖

# yum install cobbler cobbler-web dnsmasq syslinux pykickstart bind rsync

3、启动服务

# systemctl start httpd
# systemctl start cobblerd


4、生产密码 

#openssl passwd -1 -salt 'fajlfjal' 'cobbler'
$1$fajlfjal$UdbS4N.XbTitCc5Pa0bvz.


5、配置cobbler

/etc/cobbler/settings:
default_password_crypted: "$1$fajlfjal$UdbS4N.XbTitCc5Pa0bvz."
manage_dhcp: 1
manage_dns: 1
pxe_just_once: 1
next_server: 192.168.0.5
server: 192.168.0.5


5、配置cobbler的DHCP模版

#cat /etc/cobbler/dhcp.template
subnet 192.168.56.0 netmask 255.255.255.0 {
     option routers             192.168.56.101;
     option domain-name-servers 192.168.56.101;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.56.200 192.168.56.254;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
     class "pxeclients" {
          match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
          if option pxe-system-type = 00:02 {
                  filename "ia64/elilo.efi";
          } else if option pxe-system-type = 00:06 {
                  filename "grub/grub-x86.efi";
          } else if option pxe-system-type = 00:07 {
                  filename "grub/grub-x86_64.efi";
          } else {
                  filename "pxelinux.0";
          }
     }
}

7、重启cobbler

# systemctl restart cobbler


8、检查下会有示需要什么,按要去安装或修改配置即可

# cobbler check 

wKioL1Z2CrmiMl9WAADD_U4QJeY675.png

修改好了后sync同步下

# cobbler sync


9、挂载、导入镜像

#mount /dev/cdrom /media
#cobbler import --path=/media --name CentOS-7.1 --arch=x86_65

10、配置安装镜像的ks文件

查看详细信息,看看用的那个KS

wKiom1Z2CybBEvlKAABlgixZmvU568.png

修改下KS如下

#
# Sample scripted installation file
# for ESXi 6
#
vmaccepteula
reboot --noeject
rootpw --iscrypted $default_password_crypted
install --firstdisk --overwritevmfs
clearpart --firstdisk --overwritevmfs
#$SNIPPET('network_config') //注释
network --bootproto=dhcp //添加
%pre --interpreter=busybox
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
%post --interpreter=busybox
$SNIPPET('kickstart_done')
r=busybox
$SNIPPET('kickstart_done')

11、cobbler sync同步下,开始安装

wKioL1Z2CyThjiPDAABt31sHjYY193.png


你可能感兴趣的:(CentOS7安装Cobbler+ESXI6.0)