cobbler------安装配置

一:配置好repo仓库,IP地址,
[[email protected] yum.repos.d]# ll
total 28
-rw-r--r--. 1 root root 1664 Dec  9  2015 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Dec  9  2015 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Dec  9  2015 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  290 Dec  9  2015 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 Dec  9  2015 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Dec  9  2015 CentOS-Sources.repo
-rw-r--r--. 1 root root 1952 Dec  9  2015 CentOS-Vault.repo
#使用阿里云的epel源
[[email protected] yum.repos.d]# wget https://mirrors.aliyun.com/repo/epel-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 115.28.122.210, 112.124.140.210
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|115.28.122.210|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1084 (1.1K) [application/octet-stream]
Saving to: ‘epel-7.repo’
100%[========================================================================================================================================================================>] 1,084       --.-K/s   in 0s      
2017-02-21 09:28:26 (82.2 MB/s) - ‘epel-7.repo’ saved [1084/1084]
[[email protected] yum.repos.d]# ls
CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo  epel-7.repo
[[email protected] yum.repos.d]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:e6:8c:cc brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.11/24 brd 192.168.56.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fee6:8ccc/64 scope link 
       valid_lft forever preferred_lft forever

二:yum安装cobbler

[[email protected] yum.repos.d]# yum install httpd dhcp tftp xinetd bind bind-chroot caching-nameserver cobbler cobbler-web python-ctypes

三:关闭防火墙

[[email protected] yum.repos.d]# systemctl stop firewalld
[[email protected] yum.repos.d]# chkconfig firewalld off
Note: Forwarding request to ‘systemctl disable firewalld.service‘.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[[email protected] yum.repos.d]# getenforce 
Enforcing
[[email protected] yum.repos.d]# setenforce 0 #临时生效
[[email protected] yum.repos.d]# getenforce 
Permissive
[[email protected] yum.repos.d]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
#编辑配置文件,把SELINUX修改成disabled,永久生效,需要重启OS
[[email protected] yum.repos.d]# vim /etc/sysconfig/selinux

四:启动服务并检查

[[email protected] yum.repos.d]# systemctl start httpd
[[email protected] yum.repos.d]# systemctl start cobblerd
[[email protected] yum.repos.d]# systemctl start xinetd
[[email protected] yum.repos.d]# netstat -lntup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1687/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2182/master         
tcp        0      0 127.0.0.1:25151         0.0.0.0:*               LISTEN      3985/python2        
tcp6       0      0 :::80                   :::*                    LISTEN      3956/httpd          
tcp6       0      0 :::22                   :::*                    LISTEN      1687/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      2182/master         
tcp6       0      0 :::443                  :::*                    LISTEN      3956/httpd

五:配置cobbler,

执行cobbler check命令后,会出现提示,告知需要修改的地方,按照说明修改即可:

[[email protected] yum.repos.d]# cobbler check
The following are potential configuration items that you may want to fix:

1 : The ‘server‘ field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the ‘next_server‘ field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
    https://github.com/cobbler/cobbler/wiki/Selinux
4 : change ‘disable‘ to ‘no‘ in /etc/xinetd.d/tftp
5 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run ‘cobbler get-loaders‘ to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The ‘cobbler get-loaders‘ command is the easiest way to resolve these requirements.
6 : enable and start rsyncd.service with systemctl
7 : debmirror package is not installed, it will be required to manage debian deployments and repositories
8 : ksvalidator was not found, install pykickstart
9 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to ‘cobbler‘ and should be changed, try: "openssl passwd -1 -salt ‘random-phrase-here‘ ‘your-password-here‘" to generate new one
10 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run ‘cobbler sync‘ to apply changes.

5.1 下面开始对上面的步骤提示进行修改,

1、对/etc/cobbler/setting中,修改server行,改成

server: 192.168.56.11

2、修改‘next_server’

next_server: 192.168.56.11

3、关闭selinux,需要重启系统

4、修改tftp

[[email protected] yum.repos.d]# vim /etc/xinetd.d/tftp 

# default: off
# description: The tftp server serves files using the trivial file transfer #       protocol.  The tftp protocol is often used to boot diskless #       workstations, download configuration files to network-aware printers, #       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

5、执行命令cobbler get-loaders,他会自动下载相关的启动引导文件

[[email protected] yum.repos.d]# cobbler get-loaders
task started: 2017-02-21_101556_get_loaders
task started (id=Download Bootloader Content, time=Tue Feb 21 10:15:56 2017)
downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***

6、启动服务rsyncd.service

systemctl start rsyncd

7、安装pykickstart

yum install pykickstart -y

8、生成新的密码,默认的过于简单,命令:openssl passwd -1 -salt ‘random-phrase-here‘ ‘your-password-here‘

[[email protected] yum.repos.d]# openssl passwd -1 -salt ‘123‘ ‘123456‘
$1$123$7mft0jKnzzvAdU4t0unTG1

把这个新生成的密钥,写入setting配置文件中的对应位置上

default_password_crypted: "$1$123$7mft0jKnzzvAdU4t0unTG1"

9、安装fence-agents

yum install fence-agents

10、可以不用管它

当然也可以安装这个服务,安装完毕后,需要修改配置文件

wget 
yum localinstall debmirror-20090807-1.el5.noarch.rpm 
vim /etc/debmirror.conf #将23和25行注释掉
23 #@dists=”sid”;
25 #@arches=”i386″;

上面所有的步骤操作完毕后,重启cobbler,然后执行“cobbler sync”

[[email protected] ~]# systemctl restart cobblerd
[[email protected] ~]# 
[[email protected] ~]# 
[[email protected] ~]# cobbler sync
task started: 2017-02-21_104452_sync
task started (id=Sync, time=Tue Feb 21 10:44:52 2017)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
copying: /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
copying: /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
copying: /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
copying: /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering TFTPD files
generating /etc/xinetd.d/tftp
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 shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
[[email protected] ~]# cobbler check
The following are potential configuration items that you may want to fix:

1 : debmirror package is not installed, it will be required to manage debian deployments and repositories

Restart cobblerd and then run ‘cobbler sync‘ to apply changes.

六:DHCP配置

我们可以配置cobbler,使用cobber来管理dhcp服务,修改一下配置文件:

[[email protected] ~]# vim /etc/cobbler/settings 
# set to 1 to enable Cobbler‘s DHCP management features.
# the choice of DHCP management engine is in /etc/cobbler/modules.conf
manage_dhcp: 1 #这里从0改成1,启动dhcp管理服务
[[email protected] cobbler]# ls
auth.conf       cobbler_bash  dhcp.template     import_rsync_whitelist  ldap          mongodb.conf    power  reporting      rsync.template      settings        users.conf    version        zone_templates
cheetah_macros  completions   dnsmasq.template  iso                     modules.conf  named.template  pxe    rsync.exclude  secondary.template  tftpd.template  users.digest  zone.template
[[email protected] cobbler]# vim dhcp.template 
# ******************************************************************
# Cobbler managed dhcpd.conf file
#
# generated from cobbler dhcp.conf template ($date)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
#
# ******************************************************************
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.56.0 netmask 255.255.255.0 {
     option routers             192.168.56.2;#路由地址
     option domain-name-servers 192.168.56.2;#dns地址
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.56.100 192.168.56.254;
     default-lease-time         21600;#默认租期时间
     max-lease-time             43200;#最大租期时间
     next-server                $next_server;#tftp地址
     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";
          }
     }
}

执行cobbler sync 自动生成dhcp配置文件

[[email protected] cobbler]# systemctl restart cobblerd
[[email protected] cobbler]# cobbler sync
task started: 2017-02-21_105948_sync
task started (id=Sync, time=Tue Feb 21 10:59:48 2017)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/grub-x86.efi
removing: /var/lib/tftpboot/grub/grub-x86_64.efi
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
copying: /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
copying: /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
copying: /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
copying: /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
rendering TFTPD files
generating /etc/xinetd.d/tftp
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 #这里会自动重启dhcp服务
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.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***

验证::::

这里查看dhcpd.conf会自动生成相同的配置文件信息

[[email protected] cobbler]# cat /etc/dhcp/dhcpd.conf 
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Tue Feb 21 15:59:49 2017)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
# ******************************************************************

ddns-update-style interim;

allow booting;
allow bootp;

ignore client-updates;
set vendorclass = option vendor-class-identifier;

option pxe-system-type code 93 = unsigned integer 16;

subnet 192.168.56.0 netmask 255.255.255.0 {
     option routers             192.168.56.2;
     option domain-name-servers 192.168.56.2;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.56.100 192.168.56.254;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                192.168.56.11;
     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";
          }
     }

}

# group for Cobbler DHCP tag: default
group {
}

七、导入操作系统

我们使用上传工具,上传一个系统到cobbler文件系统下面,这里使用的C7做为测试

7.1上传os到opt目录下面

[[email protected] opt]# ll -sh
total 4.1G
4.1G -rw-r--r-- 1 root root 4.1G Feb 21 11:10 CentOS-7-x86_64-DVD-1511.iso

7.2 导入distro,即导入一个发行版,发行版指的是操作系统

[[email protected] opt]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   46G  5.6G   41G  13% /
devtmpfs                 1.9G     0  1.9G   0% /dev
tmpfs                    1.9G     0  1.9G   0% /dev/shm
tmpfs                    1.9G  8.6M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1                497M  125M  373M  26% /boot
tmpfs                    378M     0  378M   0% /run/user/0
[[email protected] opt]# mount -t iso9660 -o loop /opt/CentOS-7-x86_64-DVD-1511.iso /mnt 
mount: /dev/loop0 is write-protected, mounting read-only
[[email protected] opt]# df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   46G  5.6G   41G  13% /
devtmpfs                 1.9G     0  1.9G   0% /dev
tmpfs                    1.9G     0  1.9G   0% /dev/shm
tmpfs                    1.9G  8.6M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1                497M  125M  373M  26% /boot
tmpfs                    378M     0  378M   0% /run/user/0
/dev/loop0               4.1G  4.1G     0 100% /mnt
[[email protected] ~]# cobbler import --path=/mnt/ --name=c7.2-x86_64 --arch=x86_64
task started: 2017-02-21_134843_import
task started (id=Media import, time=Tue Feb 21 13:48:43 2017)
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/c7.2-x86_64:
creating new distro: c7.2-x86_64
trying symlink: /var/www/cobbler/ks_mirror/c7.2-x86_64 -> /var/www/cobbler/links/c7.2-x86_64
creating new profile: c7.2-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/c7.2-x86_64 for c7.2-x86_64
processing repo at : /var/www/cobbler/ks_mirror/c7.2-x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/c7.2-x86_64
looking for /var/www/cobbler/ks_mirror/c7.2-x86_64/repodata/*comps*.xml
error launching createrepo (not installed?), ignoring
Exception occured: <type ‘exceptions.IOError‘>
Exception value: [Errno 2] No such file or directory: ‘/var/www/cobbler/ks_mirror/config/c7.2-x86_64.repo‘
Exception Info:
  File "/usr/lib/python2.7/site-packages/cobbler/modules/manage_import_signatures.py", line 599, in yum_process_comps_file
    config_file = open(fname, "w+")

*** TASK COMPLETE ***
[[email protected] ~]# ll /var/www/cobbler/ks_mirror/c7.2-x86_64/
total 296
-r--r--r-- 1 root root     14 Dec  9  2015 CentOS_BuildTag
dr-xr-xr-x 3 root root     33 Dec  9  2015 EFI
-r--r--r-- 1 root root    215 Dec  9  2015 EULA
-r--r--r-- 1 root root  18009 Dec  9  2015 GPL
dr-xr-xr-x 3 root root     54 Dec  9  2015 images
dr-xr-xr-x 2 root root   4096 Dec  9  2015 isolinux
dr-xr-xr-x 2 root root     41 Dec  9  2015 LiveOS
dr-xr-xr-x 2 root root 204800 Dec  9  2015 Packages
dr-xr-xr-x 2 root root   4096 Dec  9  2015 repodata
-r--r--r-- 1 root root   1690 Dec  9  2015 RPM-GPG-KEY-CentOS-7
-r--r--r-- 1 root root   1690 Dec  9  2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r-- 1 root root   2883 Dec  9  2015 TRANS.TBL

7.3 指定profile,在导入发行版的时候可以通过–kickstart=KICKSTART_FILE指定profile文件,如果没有指定,可以在后期重新指定,需要将profile文件提前准备好,最好放在/var/lib/cobbler/kickstarts,因为这是cobbler默认的ks文件路径,如下:

#查看默认使用的ks文件,默认使用的是sample_end.ks
[[email protected] kickstarts]# cobbler profile report
Name                           : c7.2-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : c7.2-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Kickstart                      : /var/lib/cobbler/kickstarts/sample_end.ks
Kickstart Metadata             : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Owners                         : [‘admin‘]
Parent Profile                 : 
Internal proxy                 : 
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm
#上传一个自己写好的ks文件,并写入到profile文件配置里面
[[email protected] kickstarts]# pwd
/var/lib/cobbler/kickstarts
[[email protected] kickstarts]# ll
total 56
-rw-r--r--  1 root root 1519 Feb 21 13:59 CentOS-7.1-x86_64_cobbler.cfg
[[email protected] kickstarts]# cobbler profile edit --name=c7.2-x86_64 --kickstart=/var/lib/cobbler/kickstarts/CentOS-7.1-x86_64_cobbler.cfg
[[email protected] kickstarts]# cobbler profile report
Name                           : c7.2-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : c7.2-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
Kernel Options                 : {}
Kernel Options (Post Install)  : {}
Kickstart                      : /var/lib/cobbler/kickstarts/CentOS-7.1-x86_64_cobbler.cfg
Kickstart Metadata             : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Owners                         : [‘admin‘]
Parent Profile                 : 
Internal proxy                 : 
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

#修改内核配置
[[email protected] kickstarts]# cobbler profile edit --name=c7.2-x86_64 --kopts=‘net.ifnames=0 biosdevname=0‘
[[email protected] kickstarts]# cobbler profile report
Name                           : c7.2-x86_64
TFTP Boot Files                : {}
Comment                        : 
DHCP Tag                       : default
Distribution                   : c7.2-x86_64
Enable gPXE?                   : 0
Enable PXE Menu?               : 1
Fetchable Files                : {}
Kernel Options                 : {‘biosdevname‘: ‘0‘, ‘net.ifnames‘: ‘0‘}
Kernel Options (Post Install)  : {}
Kickstart                      : /var/lib/cobbler/kickstarts/CentOS-7.1-x86_64_cobbler.cfg
Kickstart Metadata             : {}
Management Classes             : []
Management Parameters          : <<inherit>>
Name Servers                   : []
Name Servers Search Path       : []
Owners                         : [‘admin‘]
Parent Profile                 : 
Internal proxy                 : 
Red Hat Management Key         : <<inherit>>
Red Hat Management Server      : <<inherit>>
Repos                          : []
Server Override                : <<inherit>>
Template Files                 : {}
Virt Auto Boot                 : 1
Virt Bridge                    : xenbr0
Virt CPUs                      : 1
Virt Disk Driver Type          : raw
Virt File Size(GB)             : 5
Virt Path                      : 
Virt RAM (MB)                  : 512
Virt Type                      : kvm

#更改登录界面内容
[[email protected] kickstarts]# vim /etc/cobbler/pxe/pxedefault.template 

DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://cobbler.github.io/
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT $pxe_timeout_profile

LABEL local
        MENU LABEL (local)
        MENU DEFAULT
        LOCALBOOT -1

$pxe_menu_items

MENU end

到此安装完毕

启动客户端测试

时间: 2024-08-27 13:18:09

cobbler------安装配置的相关文章

pxe 简介以及 cobbler安装配置自动化

PXE(CentOS 6.7):准备环境: pxe简介: PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由此支持通过网络启动操作系统,在启动过程中,终端要求服务器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol

cobbler安装配置

一.服务端安装配置: (1.)cobbler服务端(主机名为rhel4,ip地址为192.168.122.40)采用redhat6.4系统,部署自动安装redhat6.4客户端系统: (2.)保证cobbler服务端可以上外网,可以epel在线安装所需软件包: (3.)cobbler服务端安装epel: (4.)安装cobbler软件包(包含httpd,rsync,xinetd,tftp-server都是必须安装的):       #cobbler服务端 (5)启动cobbler与httpd服务

CentOS+Cobbler安装配置

1.安装epel; [[email protected] apps]# wget http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm [[email protected] apps]# rpm -ivhepel-release-6-8.noarch.rpm 2.安装cobbler相关服务: [[email protected] apps]# yum install -ycobbler httpd 

cobbler安装配置脚本

#!/bin/bash yum -y install cobbler httpd cobbler-web debmirror pykickstart service cobblerd start service httpd start cd /etc/cobbler sed -i '[email protected]_server: [email protected]_server: [email protected]' settings sed -i '[email protected]: [

cobbler 安装与配置

cobbler是一个再次封装的PXE.核心概念: Distribution:每一个distrbution是一个仓库,是一个可安装的发行版.具体如何安装需要其它组件定义.每个distribution都会依赖一个Repository才可以完成安装.distribution用来定义每个发行版的内核以及initrd的文件,来确定安装那个发行版的操作系统.内核启动后需要到repository中获取系统安装过程中的各个文件. Repository:yum仓库,是distribution启动后必须要指定仓库的

RHEL6.5上安装配置Cobbler

Cobbler运行流程图 <特别声明: 该图来源"煮酒品茶"的博客,如有不妥,请联系本人删除,谢谢!> 加载epel源 # rpm -Uvh http://mirrors.ustc.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm 或者 # rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 安装cobbler包及

cobbler快速安装配置指南

安装epel rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm 安装软件包 yum install -y httpd tftp dhcp cobbler cobbler-web pykickstart xinetd 启动服务 systemctl start httpd systemctl start cobblerd systemctl start xinetd 设置开机启动 systemctl e

Cobbler 自动安装 配置

自动化安装适用于IDC机房批量安装服务器: 现在我们的自动化安装的方法有两种:今天我们来实现一下Cobbler的配置: 1.PXE,这种配置起来比较麻烦: 2.Cobbler,这种批量安装的方法,也是基于PEX结构执行的,但是Cobbler省去了我们配置文件的步骤,都交给了Cobbler来完成: 1)安装软件:查看服务是否启动 [[email protected] ~]# yum install tftp-server rsync xinetd httpd dhcp [[email protec

centos 7 下 cobbler 安装

一.cobbler 介绍: Cobbler 是一个系统启动服务(boot server),可以通过网络启动(PXE)的方式用来快速安装.重装物理服务器和虚拟机,支持安装不同的 Linux 发行版和 Windows.该工具使用python开发,小巧轻便(才15k行代码),使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理 DHCP,DNS,以及yum包镜像. Linux学习,http:// linux.it.net.cn Cobbler 使用命令行方式管理,也提供了基于 Web 的界面

自动装机之Cobbler安装部署

运维自动化安装方面,早期一般使用人工配置pxe+dhcp+tftp配合kickstart,现在开源工具就多了,如cobbler,OpenQRM和Spacewalk.本文重点介绍Cobbler. Cobbler介绍 Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行代码),使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP,DNS,以及yum包镜像. Cobbler支持命令行管理,w