首页 > 代码库 > Cobbler自动部署主机系统-扩展
Cobbler自动部署主机系统-扩展
指定服务器的装机配置
指定服务器就是绑定它的mac地址,并设置好ip、dns、hostname 定义系统
[root@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 [root@master ~]# cobbler system list #查看列表 Test_Mail_1 [root@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 : <<inherit>> Kickstart Metadata : {} LDAP Enabled : False LDAP Management Type : authconfig Management Classes : <<inherit>> Management Parameters : <<inherit>> 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 : <<inherit>> Red Hat Management Key : <<inherit>> Red Hat Management Server : <<inherit>> Repos Enabled : False Server Override : <<inherit>> Status : production Template Files : {} Virt Auto Boot : <<inherit>> Virt CPUs : <<inherit>> Virt Disk Driver Type : <<inherit>> Virt File Size(GB) : <<inherit>> Virt Path : <<inherit>> Virt PXE Boot : 0 Virt RAM (MB) : <<inherit>> Virt Type : <<inherit>> 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 :
命令列表:
[root@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 distro profile
可以查看、编辑distros, profiles, subprofiles, systems, repos 、 kickstart文件
[root@master ~]# yum install cobbler-web -y
2.1.设置用户名密码
为已存在的用户cobbler重置密码
[root@master ~]# htdigest /etc/cobbler/users.digest "Cobbler" cobbler Changing password for user cobbler in realm Cobbler New password: Re-type new password:
2.2.添加新用户
[root@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文件
yum install system-config-kickstart -y 终端执行 system-config-kickstart
[root@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
[root@bogon ~]# yum install koan -y
4.2列出远程cobbler上的系统版本对象
[root@bogon ~]# koan --server=192.168.10.128 --list=profiles - looking for Cobbler at http://192.168.10.128:80/cobbler_api centos6.2-x86_64 centos6.5-x86_64
4.3 更多关于远程Cobbler对象信息 [root@bogon ~]# koan --server=192.168.10.128 --display --profile=centos6.5-x86_64 - looking for Cobbler at http://192.168.10.128:80/cobbler_api - reading URL: http://192.168.10.128/cblr/svc/op/ks/profile/centos6.5-x86_64 install_tree: http://192.168.10.128/cblr/links/centos6.5-x86_64 name : centos6.5-x86_64 distro : centos6.5-x86_64 kickstart : http://192.168.10.128/cblr/svc/op/ks/profile/centos6.5-x86_64 ks_meta : tree=http://@@http_server@@/cblr/links/centos6.5-x86_64 install_tree : http://192.168.10.128/cblr/links/centos6.5-x86_64 kernel : /var/www/cobbler/ks_mirror/centos6.5-x86_64/images/pxeboot/vmlinuz initrd : /var/www/cobbler/ks_mirror/centos6.5-x86_64/images/pxeboot/initrd.img kernel_options : ks=http://192.168.10.128/cblr/svc/op/ks/profile/centos6.5-x86_64 ksdevice=link kssendmac lang= text repos : virt_ram : 512 virt_disk_driver : raw virt_type : kvm virt_path : virt_auto_boot : 1
4.4重新安装客户端系统 # 把原本6.5的系统换6.2
[root@bogon ~]# koan -r --server=192.168.10.128 --profile=centos6.2-x86_64 [root@bogon ~]#reboot
reboot 后 ;就会自动重装;
安装指定客户机系统
koan -r --server=172.17.10.14 --system=Test_Mail_1
成功
本文出自 “大風” 博客,请务必保留此出处http://lansgg.blog.51cto.com/5675165/1553153
Cobbler自动部署主机系统-扩展
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。