cobbleru盘安装centos7双系统操作系统

centos7安装cobbler_centos_ThinkSAAS
centos7安装cobbler
centos7安装cobbler
内容来源: 网络
http://46aae4d1e9798941cef698./linglong0820/article/details/
用上面的安装后,改下下
/etc/cobbler/settings下的server
就OK了
还有安装的时候,要把安装系统的机子和cobbler设置为同一网络
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
让ThinkSAAS更好,把建议拿来。
开发客服微信查看:1427|回复:1
yongcobbler import 命令导入Centos7.0不成功,求大神们指教,不胜感激
(63.08 KB)
虽然过去很久了,但是希望我的回答可以帮到一些朋友
只要运行cobbler signature update
就可以解决。
但有个前提是你的服务器可以连到转账请注明出处:http://blog.csdn.net/gcogle/article/details/
CentOS7 安装cobbler自动部署ubuntu
Cobbler是红帽开发的批量部署系统的工具,对RHEL、CentOS支持完美
对其他发行版的linux部分支持,也不是很完美
本文介绍的是基于CentOS 7上安装cobbler 2.6的文档
参照了网上的一些教程和官方文档,加上自己的实践,特别是分区部分,调试了数十次才算完美了。
二、安装CentOS 7调整配置及安装相关软件
1、调整配置
安装完成后关闭selinux或参照cobbler官方文档设置selinux,http://cobbler.github.io/manuals/2.6.0/4/2_-_SELinux.html
[root@cobbler-server ~]# sed&-i&'/SELINUX/s/enforcing/disabled/'&/etc/selinux/config&&
重启服务器
关闭iptables以及取消开机启动,centos7 minimal没有安装ipables
关闭firewall或放行80 67 68 69 443端口
80 443是cobbler web管理界面端口
67 68 是DHCP端口
69是TFTP端口
[root@cobbler-server ~]# systemctl stop firewalld
[root@cobbler-server ~]# systemctl disable firewalld
2、安装epel
[root@cobbler-server ~]# yum install epel-release
[root@cobbler-server ~]# yum makecache
3、安装cobbler、cobbler-web以及相关依赖软件
[root@cobbler-server ~]# yum install cobbler cobbler-web xinetd pykickstart cman dhcp -y
4、设置开机启动
[root@cobbler-server ~]# systemctl enablehttpd
[root@cobbler-server ~]# systemctl enabledhcpd&&
[root@cobbler-server ~]# systemctl enablecobblerd
三、Cobbler、tftp、dhcp、rsync配置
1、TFTP配置
配置tftp绿色着色为修改后的值
[root@cobbler-server ~]# 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
2、配置rsync
[root@cobbler-server ~]# systemctl enable rsyncd
CentOS7上安装cobbler对于rsync无需额外配置
3、配置/etc/cobbler/settings
[root@cobbler-server ~]# cat /etc/cobbler/settings |grep '^[^#]'
allow_duplicate_hostnames: 0
allow_duplicate_ips: 0
allow_duplicate_macs: 0
allow_dynamic_settings: 0
anamon_enabled: 0
authn_pam_service: &login&
auth_token_expiration: 3600
build_reporting_enabled: 0
build_reporting_sender: &&
build_reporting_email: [ 'root@localhost' ]
build_reporting_smtp_server: &localhost&
build_reporting_subject: &&
build_reporting_ignorelist: [ && ]
cheetah_import_whitelist:
&- &random&
createrepo_flags: &-c cache -s sha&
default_kickstart: /var/lib/cobbler/kickstarts/default.ks
default_name_servers: []
default_ownership:
&- &admin&
default_password_crypted: &$1$mF86/UHC$WvcIcX2t6crBz2onWxyac.&
default_template_type: &cheetah&
default_virt_bridge: xenbr0
default_virt_file_size: 5
default_virt_ram: 512
default_virt_type: xenpv
enable_gpxe: 0
enable_menu: 1
func_auto_setup: 0
func_master: overlord.example.org
http_port: 80
kernel_options:
&ksdevice: bootif
&lang: ' '
kernel_options_s390x:
&ramdisk_size: 40000
&root: /dev/ram0
ldap_server: &&
ldap_base_dn: &DC=example,DC=com&
ldap_port: 389
ldap_tls: 1
ldap_anonymous_bind: 1
ldap_search_bind_dn: ''
ldap_search_passwd: ''
ldap_search_prefix: 'uid='
ldap_tls_cacertfile: ''
ldap_tls_keyfile: ''
ldap_tls_certfile: ''
mgmt_classes: []
mgmt_parameters:
&from_cobbler: 1
puppet_auto_setup: 0
sign_puppet_certs_automatically: 0
puppetca_path: &/usr/bin/puppet&
remove_old_puppet_certs_automatically: 0
manage_dhcp: 1
#cobbler接管DHCP,默认为0,此处修改以后需要修改对应/etc/cobbler/dhcp.template模板
manage_dns: 0
bind_chroot_path: &&
bind_master: 127.0.0.1
manage_tftpd: 1
manage_rsync: 1 #接管rsync,无需额外配置rsync
manage_forward_zones: []
manage_reverse_zones: []
next_server: 192.168.11.252 #本机ip地址
power_management_default_type: 'ipmitool'
power_template_dir: &/etc/cobbler/power&
pxe_just_once: 0
pxe_template_dir: &/etc/cobbler/pxe&
consoles: &/var/consoles&
redhat_management_type: &off&
redhat_management_server: &xmlrpc.&
redhat_management_key: &&
redhat_management_permissive: 0
register_new_installs: 0
reposync_flags: &-l -n -d&
restart_dns: 1
restart_dhcp: 1
run_install_triggers: 1
scm_track_enabled: 0
scm_track_mode: &git&
server: 192.168.11.252 #本机ip地址
client_use_localhost: 0
client_use_https: 0
snippetsdir: /var/lib/cobbler/snippets
template_remote_kickstarts: 0
virt_auto_boot: 1
webdir: /var/www/cobbler
xmlrpc_port: 25151
yum_post_install_mirror: 1
yum_distro_priority: 1
yumdownloader_flags: &--resolve&
serializer_pretty_json: 0
replicate_rsync_options: &-avzH&
replicate_repo_rsync_options: &-avzH&
always_write_dhcp_entries: 0
proxy_url_ext: &&
proxy_url_int: &&
4、修改/etc/cobbler/modules.conf
[root@cobbler-server ~]#&cat /etc/cobbler/modules.conf |grep '^[^#]'
[authentication]
module = authn_configfile
[authorization]
module = authz_allowall
module = manage_bind
module = manage_isc #如果是dnsmasq就应该为manage_dnsmasq
module = manage_in_tftpd
5、修改/etc/cobbler/dhcp.template
[root@localhost cobbler]# cat /etc/cobbler/dhcp.template |grep '^[^#]'
ddns-update-
ignore client-
set vendorclass = option vendor-class-
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.11.0&netmask 255.255.255.0 {
&&&&&option routers &&&&&&&&&&&&192.168.11.252;
&&&&&option domain-name-servers 192.168.11.252;
&&&&&option subnet-mask &&&&&&&&255.255.255.0;
&&&&&range dynamic-bootp &&&&&&&192.168.11.100 192.168.11.200;
&&&&&default-lease-time &&&&&&&&21600;
&&&&&max-lease-time &&&&&&&&&&&&43200;
&&&&&next-server &&&&&&&&&&&&&&&$next_
&&&&&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 could be subnet if your dhcp tags line up with your subnets
&&&&## or really any valid dhcpd.conf construct ... if you only use the
&&&&## default dhcp tag in cobbler, the group block can be deleted for a
&&&&## flat configuration
&&&&&&&&#for mac in $dhcp_tags[$dhcp_tag].keys():
&&&&&&&&&&&&#set iface = $dhcp_tags[$dhcp_tag][$mac]
&&&&host $iface.name {
&&&&&&&&hardware ethernet $
&&&&&&&&#if $iface.ip_address:
&&&&&&&&fixed-address $iface.ip_
&&&&&&&&#end if
&&&&&&&&#if $iface.hostname:
&&&&&&&&option host-name &$iface.hostname&;
&&&&&&&&#end if
&&&&&&&&#if $iface.netmask:
&&&&&&&&option subnet-mask $iface.
&&&&&&&&#end if
&&&&&&&&#if $iface.gateway:
&&&&&&&&option routers $iface.
&&&&&&&&#end if
&&&&&&&&#if $iface.enable_gpxe:
&&&&&&&&if exists user-class and option user-class = &gPXE& {
&&&&&&&&&&&&filename &http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner&;
&&&&&&&&} else if exists user-class and option user-class = &iPXE& {
&&&&&&&&&&&&filename &http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner&;
&&&&&&&&} else {
&&&&&&&&&&&&filename &undionly.kpxe&;
&&&&&&&&#else
&&&&&&&&filename &$iface.filename&;
&&&&&&&&#end if
&&&&&&&&## Cobbler defaults to $next_server, but some users
&&&&&&&&## may like to use $iface.system.server for proxied setups
&&&&&&&&next-server $next_
&&&&&&&&## next-server $iface.next_
&&&&&&&&#end for
6、重启cobbler httpd服务
[root@cobbler-server ~]# systemctl restart cobblerd
[root@cobbler-server ~]# systemctl restart httpd
四、检查cobbler配置
[root@cobbler-server ~]# 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
2 : 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
Restart cobblerd and then run 'cobbler sync' to apply changes.
以上两点都可以忽略
第二点是修改部署系统默认的root密码
若提示enabled rsyncd or use systemctl to start rsyncd.service
是叫你把rsync加到开机启动
[root@cobbler-server ~]# systemctl enable rsyncd
执行以上命令后就不会出现这个提示了
五、导入镜像并查看导入情况
1、导入镜像
[root@cobbler-server ~]#&mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@cobbler-server&~]#cobbler import --path=/mnt/cdrom/ --name=ubuntu-12.04.5
--arch=x86_64
task started: _221950_import
task started (id=Media import, time=Fri Oct &7 22:19:50 2016)
Found a candidate signature: breed=freebsd, version=10.1
Found a candidate signature: breed=freebsd, version=10.0
Found a candidate signature: breed=freebsd, version=8.3
Found a candidate signature: breed=freebsd, version=8.2
Found a candidate signature: breed=freebsd, version=8.4
Found a candidate signature: breed=freebsd, version=10.2
Found a candidate signature: breed=freebsd, version=9.0
Found a candidate signature: breed=freebsd, version=9.1
Found a candidate signature: breed=freebsd, version=9.2
Found a candidate signature: breed=freebsd, version=9.3
Found a candidate signature: breed=ubuntu, version=precise
running: /usr/bin/file /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64/dists/precise/Release
received on stdout: /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64/dists/precise/Release: ASCII text
received on stderr:
Found a matching signature: breed=ubuntu, version=precise
Adding distros from path /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64:
creating new distro: ubuntu-12.04.5-x86_64
trying symlink: /var/www/cobbler/ks_mirror/ubuntu-12.04.5-x86_64 -& /var/www/cobbler/links/ubuntu-12.04.5-x86_64
creating new profile: ubuntu-12.04.5-x86_64
associating repos
checking for apt repo(s)
adding apt repo for ubuntu-12.04.5-x86_64
Added repos for ubuntu-12.04.5-x86_64
*** TASK COMPLETE ***
有些镜像是不支持的,不支持就会导入错误
查看导入的镜像和使用到的kickstart文件信息
[root@cobbler-server ~]#&cobbler distro list
&&&CentOS-7.2-x86_64
&&&ESXi-6.0.0-x86_64
&&&ubuntu-12.04.5-x86_64
[root@cobbler-server ~]#&cobbler profile report
Name &&&&&&&&&&&&&&&&&&&&&&&&&&: ESXi-6.0.0-x86_64
TFTP Boot Files &&&&&&&&&&&&&&&: {}
Comment &&&&&&&&&&&&&&&&&&&&&&&:
DHCP Tag &&&&&&&&&&&&&&&&&&&&&&: default
Distribution &&&&&&&&&&&&&&&&&&: ESXi-6.0.0-x86_64
Enable gPXE? &&&&&&&&&&&&&&&&&&: 0
Enable PXE Menu? &&&&&&&&&&&&&&: 1
Fetchable Files &&&&&&&&&&&&&&&: {}
Kernel Options &&&&&&&&&&&&&&&&: {}
Kernel Options (Post Install) &: {}
Kickstart &&&&&&&&&&&&&&&&&&&&&: /var/lib/cobbler/kickstarts/sample_esxi5.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
Name &&&&&&&&&&&&&&&&&&&&&&&&&&: CentOS-7.2-x86_64
TFTP Boot Files &&&&&&&&&&&&&&&: {}
Comment &&&&&&&&&&&&&&&&&&&&&&&:
DHCP Tag &&&&&&&&&&&&&&&&&&&&&&: default
Distribution &&&&&&&&&&&&&&&&&&: CentOS-7.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
Name &&&&&&&&&&&&&&&&&&&&&&&&&&: ubuntu-12.04.5-x86_64
TFTP Boot Files &&&&&&&&&&&&&&&: {}
Comment &&&&&&&&&&&&&&&&&&&&&&&:
DHCP Tag &&&&&&&&&&&&&&&&&&&&&&: default
Distribution &&&&&&&&&&&&&&&&&&: ubuntu-12.04.5-x86_64
Enable gPXE? &&&&&&&&&&&&&&&&&&: 0
Enable PXE Menu? &&&&&&&&&&&&&&: 1
Fetchable Files &&&&&&&&&&&&&&&: {}
Kernel Options &&&&&&&&&&&&&&&&: {}
Kernel Options (Post Install) &: {}
Kickstart &&&&&&&&&&&&&&&&&&&&&: /var/lib/cobbler/kickstarts/sample.seed
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
六、编辑seed文件
1、普通分区配置
[root@cobbler-server ~]#&grep &^[^#]& /var/lib/cobbler/kickstarts/sample.seed
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/variantcode string
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string $myhostname
d-i time/zone string US/Eastern
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server &string
d-i mirror/country string manual
d-i mirror/http/hostname string $http_server
d-i mirror/http/directory string $install_source_directory
d-i mirror/http/proxy string
d-i live-installer/net-image string http://$http_server/cobbler/links/$distro_name/install/filesystem.squashfs
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select fsm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/expert_recipe string \
24 linux-swap method{ swap } \
format{ } \
48 ext4 method{ format } \
mountpoint{ /home } \
format{ } use_filesystem{ } filesystem{ ext4 } \
10240 ext4 method{ format } \
mountpoint{ / } \
format{ } use_filesystem{ } filesystem{ ext4 } \
options/relatime{ relatime } \
ext4 method{ format } \
mountpoint{ /tmp } \
format{ } use_filesystem{ } filesystem{ ext4 } \
options/relatime{ relatime } \
1 000 ext4 method{ format } \
mountpoint{ /www } \
format{ } use_filesystem{ } filesystem{ ext4 } \
options/relatime{ relatime } \
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman/choose_partition \
select Finish partitioning and write changes to disk
d-i passwd/root-login boolean true
d-i passwd/root-password-crypted password $default_password_crypted
d-i passwd/make-user boolean false
$SNIPPET('preseed_apt_repo_config')
d-i pkgsel/include string ntp ssh wget vim
d-i debian-installer/add-kernel-opts string $kernel_options_post
d-i finish-install/reboot_in_progress note
d-i preseed/early_command string wget -O- \
&&&http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_early_default | \
&&&/bin/sh -s
d-i preseed/late_command string wget -O- \
&&&http://$http_server/cblr/svc/op/script/$what/$name/?script=preseed_late_default | \
&&&chroot /target /bin/sh -s
2、lvm分区配置
绿色标记部分是最重要的,定制分区的配置,以上是普通分区方式
如果是lvm分区方式,用以下配置
d-i partman-auto/disk string /dev/sda#指定磁盘
d-i partman-auto/method string lvm#分区格式lvm还是普通分区还是raid
d-i partman-auto/choose_recipe select fsm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto-lvm/no_boot boolean true
d-i partman-auto-lvm/new_vg_name string vg0
d-i partman-auto/expert_recipe string \
24 linux-swap method{ swap } \
format{ } $lvmok{ } lv_name{ swap } \
48 ext4 method{ lvm } \
$lvmok{ } mountpoint{ /home } lv_name{ home } \
format{ } use_filesystem{ } filesystem{ ext4 } \
10240 ext4 method{ lvm } \
$lvmok{ } mountpoint{ / } lv_name{ root } \
format{ } use_filesystem{ } filesystem{ ext4 } \
options/relatime{ relatime } \
ext4 method{ lvm } \
$lvmok{ } mountpoint{ /tmp } lv_name{ tmp } \
format{ } use_filesystem{ } filesystem{ ext4 } \
options/relatime{ relatime } \
1 000 ext4 method{ lvm } \
$lvmok{ } mountpoint{ /www } lv_name{ www } \
format{ } use_filesystem{ } filesystem{ ext4 } \
options/relatime{ relatime } \
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman/choose_partition \
&&&&select Finish partitioning and write changes to disk &&&#保存分区
$lvmok{ }必须存在,不然安装会报错无法继续
不存在这个选项cobbler又会报错
{'code': u'VFFSL(SL,&lvmok&,True)',
&&'exc_val': NotFound(u&cannot find 'lvmok'&,),
&&'lineCol': (60, 11),
&&'rawCode': u'$lvmok',
&&'time': 'Sun Oct &9 23:43:14 2016'}]
不知道是不是cobbler的bug
七、注意事项
1、1 000 ext4 method{ lvm } \这三个数字分别代表最少1M,权重,最多M
如果把剩余的都分配就用三个-1,即-1 -1 -1 ext4 method{ lvm } \
2、d-i partman-auto/choose_recipe select fsm:fsm随意命名,但必须和d-i
partman-auto/expert_recipe string fsm :: 这个fsm对应
3、seed文件中不能有中文哪怕是注释,不然会报错
4、每次修改/etc/cobbler/setting配置后需要执行cobbler sync进行同步
5、对于esxi的支持,默认不支持esxi6,但是可以用esxi5的kickstart文件,部分不兼容,但仍能全自动安装
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:1017次
排名:千里之外urey_pp 的BLOG
用户名:urey_pp
文章数:304
评论数:605
访问量:452619
注册日期:
阅读量:5863
阅读量:12276
阅读量:388990
阅读量:1080072
51CTO推荐博文
1.Cobbler是什么?Cobbler是一个Linux安装服务器,能够快速设置好网络安装环境。它实现了许多与Linux相关的任务的自动化和组合,因此你在部署新的(操作)系统或更改已经存在的操作系统时不需要在繁多的命令和应用程序之间来回切换。Cobbler能帮助(用户、管理者)置备和管理DNS、DHCP、软件包更新、电源管理、配置管理以及更多。“Cobbler is a Linux installation server that allows for rapid setup of network installation environments. It glues together and automates many associated Linux tasks so you do not have to hop between many various commands and applications when deploying new systems, and, in some cases, changing existing ones. Cobbler can help with provisioning, managing DNS and DHCP, package updates, power management, configuration management orchestration, and much more.” -- 更多介绍:1)Wiki:&2)其他:3)Kickstart:4)PXE:2.为什么使用Cobbler?Cobbler之所以存在一定是有道理的,如果在这之前,想实现通过网络自动安装操作系统,就必须使用手动使用kickstart+PXE,而Cobbler将这两者封装在自己软件中,通过编译安装或者yum的方式就能将这些功能集成在一起,因此假如你想实现网络安装多个操作系统,相比手动去做kickstart+PXE来说,Cobbler是一个更好的选择。除此之外Cobbler还能在虚拟化环境中进行安装,支持 Xen, qemu, KVM, 部分VMware相类似的虚拟化类型,由一个名字叫做“koan(kickstart-over-a-network)”实现。在配置管理方面除了内置的轻量级配置管理系统外,还能集成其他配置管理系统,如Puppet。Cobbler是由Python语言所编写,在管理方面除了命令行界面还支持Web管理以及API支持,除此之外还有其他高级功能,如制作安装镜像(image)、fence电源管理等。3.如何使用Cobbler ?1)安装Cobbler要想使用Cobbler当然要先安装它。在Ubuntu系统中安装Cobbler只需要执行安装命令,而在CentOS系统中要安装Cobbler只要有了epel那一切也并不复杂,当然也可以像fuel一样,将Cobbler装入docker容器中。Ubuntu:sudo&apt-get&install&cobbler&cobbler-webCentOS:#&install&epel&repo&&&
yum&install&http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm&&&&
#&cobbler&&&&
yum&install&cobbler&cobbler-web&-y2)配置Cobbler接下来需要配置Cobbler的配置文件,主要根据“cobbler check”命令的结果按照提示去做,还是比较轻松的。步骤如下:a.主要修改/etc/cobbler/settings,将/etc/cobbler/settings配置文件中的next_server和server设置成Cobbler服务器的IP地址。ipaddr=$(ip&addr&show&to&0.0.0.0/0&scope&global&|&awk&'/[[:space:]]inet&/&{&print&gensub("/.*","","g",$2)&}')&&&
operationfile=/etc/cobbler/settings&&&&
bakoperationfile=$operationfile$(date&+-%F-%H-%M-%S)"~"&&&&
cp&$operationfile&$bakoperationfile&&&&
chown&-R&--reference=$operationfile&$bakoperationfile&&&&
chcon&-R&--reference=$operationfile&$bakoperationfile&&&&
sed&-i&"s/next_server:&127.0.0.1/next_server:&$ipaddr/g"&&$operationfile&&&&
sed&-i&"s/server:&127.0.0.1/server:&$ipaddr/g"&$operationfile将/etc/xinetd.d/rsync和/etc/xinetd.d/tftp中的disable = yes改为disable=no。b.获取boot loader尽管Cobbler提供了“cobbler get-loaders ”命令来从网络上自动下载最新可用的loader,但因为Cobbler网址变更的原因变得不再可用,因此只能从github或早期已经安装好了的Cobbler服务器(例如fuel)上获取。github地址:转换方法:http://www.cobblerd.org/loaders/README&to&/var/lib/cobbler/loaders/README&&&&&
http://www.cobblerd.org/loaders/COPYING.elilo&to&/var/lib/cobbler/loaders/COPYING.elilo&&&&&
http://www.cobblerd.org/loaders/COPYING.yaboot&to&/var/lib/cobbler/loaders/COPYING.yaboot&&&&&
http://www.cobblerd.org/loaders/COPYING.syslinux&to&/var/lib/cobbler/loaders/COPYING.syslinux&&&&&
http://www.cobblerd.org/loaders/elilo-3.8-ia64.efi&to&/var/lib/cobbler/loaders/elilo-ia64.efi&&&&&
http://www.cobblerd.org/loaders/yaboot-1.3.14-12&to&/var/lib/cobbler/loaders/yaboot&&&&&
http://www.cobblerd.org/loaders/pxelinux.0-3.86&to&/var/lib/cobbler/loaders/pxelinux.0&&&&&
http://www.cobblerd.org/loaders/menu.c32-3.86&to&/var/lib/cobbler/loaders/menu.c32&&&&&
http://www.cobblerd.org/loaders/grub-0.97-x86.efi&to&/var/lib/cobbler/loaders/grub-x86.efi&&&&&
http://www.cobblerd.org/loaders/grub-0.97-x86_64.efi&to&/var/lib/cobbler/loaders/grub-x86_64.efi通常用到的就是pxelinux.0。c.安装其他的一些必要的组件yum&install&debmirror&pykickstart&fence-agents&cman&-y&&&
yum&install&dhcp&dhcp-devel&-y&&&&
yum&install&syslinuxd.修改模板如果用Cobbler管理DHCP就编辑/etc/cobbler/dhcp.template,同时将/etc/cobbler/settings中manage_dhcp: 0的设置为manage_dhcp: 1,建议修改示例:subnet&10.20.0.0&netmask&255.255.255.0&{&&&
&&&&&option&routers&&&&&&&&&&&&&10.20.0.2;&&&&
&&&&&option&domain-name-servers&114.114.114.114,&8.8.4.4;&&&&
&&&&&option&subnet-mask&&&&&&&&&255.255.255.0;&&&&
&&&&&range&dynamic-bootp&&&&&&&&10.20.0.200&10.20.0.210;&&&&
&&&&&default-lease-time&&&&&&&&&21600;&&&&
&&&&&max-lease-time&&&&&&&&&&&&&43200;&&&&
&&&&&next-server&&&&&&&&&&&&&&&&$next_如果用Cobbler管理tftp就编辑/etc/cobbler/tftpd.template,同时将/etc/cobbler/settings中manage_tftp: 0的设置为manage_tftp: 1,建议修改如果用Cobbler管理rsync就编辑/etc/cobbler/rsync.template,同时将/etc/cobbler/settings中manage_rsync: 0的设置为manage_rsync: 1如果用Cobbler管理dns就编辑 /etc/cobbler/dnsmasq.template,同时将/etc/cobbler/settings中manage_dns: 0的设置为manage_dns: 1,此项也能管理DHCPe.启用、关闭相关服务并留意结果setenforce&0&&&
service&httpd&start&&&&
service&cobblerd&start&&&&
service&xinetd&start&&&&
service&iptables&stop&&&&
ps&-ef&|&grep&$(lsof&|&grep&tftp&|&grep&xinetd&|&awk&'{print&$2}')&&&&
ps&-ef&|&grep&dhcp&|&grep&-v&grep&&&&
cobbler&check&&&&
cobbler&syncf.导入操作系统安装镜像mount&-t&iso9660&CentOS-6.6-x86_64-minimal.iso&/mnt&-o&loop,ro&&&
cobbler&import&--path=/mnt&--name=CentOS-6.6-x86_64-minimal如果有做好的kickstart文件,则可以执行cobbler import --path=/mnt --name=CentOS-6.6-x86_64-minimal --kickstart=KICKSTART_FILE如果没有做好的kickstart文件也不要紧,只需要知道密码是什么即可,默认kickstart和密码是在/etc/cobbler/settings中定义的:default_kickstart: /var/lib/cobbler/kickstarts/default.ks在CentOS系统中,每次手动安装完一个操作系统后都会在用户家目录下生成一个ks文件,可以以此参考。default_password_crypted: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac."密码可以由命令生成或者使用默认的“cobber”密码。cobbler&distro&list&&&
cobbler&sync注释:cobbler的命令帮助系统是cobbler Chelp,如cobbler import Chelpg.测试cobbler条件:a).网络中没有其他DHCP服务器,例如在VMware Workstation中进行测试,可以将VMware Workstation的DHCP服务关闭。b).要安装操作系统的客户机要与Cobbler同一个网络,且客户机支持PXE网络启动,这通常需要客户机的BIOS支持。h.调试相关命令cobbler check相关日志:跟DHCP、tftp相关的日志,/var/log/messagescobbler的日志:/var/log/cobbler/cobbler.log以下是一些成功的截图 图1 客户机安装过程中Cobbler主机上的一些成功日志 图2 客户机在自动无人干预安装过程中 图3 客户机完成自动安装,已可以登录 图4 Cobbler的Web管理界面,其地址一般是,用户名cobbler,密码cobbler。附 其他不错的可参考资料运维自动化之 Cobbler 系统安装使用详解 使用Cobbler自动化和管理系统安装 运维自动化之Cobbler系统安装详解 end本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)}

我要回帖

更多关于 centos7 系统安装教程 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信