1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
| [iyunv@master ~]# cobbler system add --name=Test_Mail_1 --hostname=Test_Mail_o --mac=00:19:B9:E5:34:FE --interface=eth0 --ip-address=192.168.10.222 --subnet=255.255.255.0 --gateway=192.168.10.2 --static=1 --profile=centos6.5-x86_64
[iyunv@master ~]# cobbler system list #查看列表
Test_Mail_1
[iyunv@master ~]# cobbler system report Test_Mail_1 # 查看详情
Name : Test_Mail_1
TFTP Boot Files : {}
Comment :
Enable gPXE? : 0
Fetchable Files : {}
Gateway : 192.168.10.2
Hostname : Test_Mail_o
Image :
IPv6 Autoconfiguration : False
IPv6 Default Device :
Kernel Options : {}
Kernel Options (Post Install) : {}
Kickstart : <>
Kickstart Metadata : {}
LDAP Enabled : False
LDAP Management Type : authconfig
Management Classes : <>
Management Parameters : <>
Monit Enabled : False
Name Servers : []
Name Servers Search Path : []
Netboot Enabled : True
Owners : ['admin']
Power Management Address :
Power Management ID :
Power Management Password :
Power Management Type : ipmitool
Power Management Username :
Profile : centos6.5-x86_64
Proxy : <>
Red Hat Management Key : <>
Red Hat Management Server : <>
Repos Enabled : False
Server Override : <>
Status : production
Template Files : {}
Virt Auto Boot : <>
Virt CPUs : <>
Virt Disk Driver Type : <>
Virt File Size(GB) : <>
Virt Path : <>
Virt PXE Boot : 0
Virt RAM (MB) : <>
Virt Type : <>
Interface ===== : eth0
Bonding Opts :
Bridge Opts :
CNAMES : []
DHCP Tag :
DNS Name :
Per-Interface Gateway :
Master Interface :
Interface Type :
IP Address : 192.168.10.222
IPv6 Address :
IPv6 Default Gateway :
IPv6 MTU :
IPv6 Prefix :
IPv6 Secondaries : []
IPv6 Static Routes : []
MAC Address : 00:19:B9:E5:34:FE
Management Interface : False
MTU :
Subnet Mask : 255.255.255.0
Static : True
Static Routes : []
Virt Bridge :
|
命令列表:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| [iyunv@master ~]# cobbler system --help
usage
=====
cobbler system add
cobbler system copy
cobbler system dumpvars
cobbler system edit
cobbler system find
cobbler system getks
cobbler system list
cobbler system poweroff
cobbler system poweron
cobbler system powerstatus
cobbler system reboot
cobbler system remove
cobbler system rename
cobbler system report
|
2.Cobbler Web管理
Cobbler web界面是一个很好的前端,非常容易管理Cobbler 可以添加和删除 system distroprofile 可以查看、编辑distros, profiles, subprofiles,systems, repos 、 kickstart文件 1
| [iyunv@master ~]# yum install cobbler-web -y
|
2.1.设置用户名密码为已存在的用户cobbler重置密码
1
2
3
4
| [iyunv@master ~]# htdigest /etc/cobbler/users.digest "Cobbler" cobbler
Changing password for user cobbler in realm Cobbler
New password:
Re-type new password:
|
2.2.添加新用户 1
2
3
4
| [iyunv@master ~]# htdigest /etc/cobbler/users.digest "Cobbler" Test_user1
Adding user Test_user1 in realm Cobbler
New password:
Re-type new password:
|
重启cobbler、http
2.3 访问,登录
http://192.168.10.128/cobbler_web/do_login
3. 用system-config-kickstart工具生成Kickstart文件
1
2
| yum install system-config-kickstart -y
终端执行 system-config-kickstart
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| [iyunv@master 桌面]# cat Test.cfg
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://192.168.10.128/cobbler/ks_mirror/centos6.5-x86_64"
# Root password
rootpw --iscrypted $1$4pvQUK/B$IBC/.aDmomR/gOQdgFy2V/
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Disk partitioning information
part / --fstype="ext4" --size=200
part /opt --fstype="ext4" --size=10240
part /MyData --fstype="ext4" --size=1024
%packages
@chinese-support
@graphics
-ibus-table-cangjie
-ibus-table-erbi
-ibus-table-wubi
%end
|
4.使用Koan重装系统
koan是cobbler的一个辅助工具,koan是kickstart-over-a-network的缩写安装在客户端的使用,koan配合cobbler实现快速重装linux。 koan的相关脚本在此目录内/usr/lib/python2.4/site-packages/koan/ 4.1在客户端安装koan
1
| [iyunv@bogon ~]# yum install koan -y
|
4.2列出远程cobbler上的系统版本对象
4.4重新安装客户端系统 # 把原本6.5的系统换6.2
1
2
| [iyunv@bogon ~]# koan -r --server=192.168.10.128 --profile=centos6.2-x86_64
[iyunv@bogon ~]#reboot
|
reboot 后 ;就会自动重装;
安装指定客户机系统1
2
| koan
-r --server=172.17.10.14 --system=Test_Mail_1
|
成功
|