Linux运维自动化工具 Cobbler(2)

received on stderr:
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 ***

shell > service xinetd restart
停止 xinetd: [确定]
正在启动 xinetd: [确定]
shell > service cobblerd restart
Stopping cobbler daemon: [确定]
Starting cobbler daemon: [确定]

三、导入安装源

shell > mount /dev/cdrom /mnt/

shell > cobbler import --path=/mnt/ --arch=x86_64 --name=CentOS-6.6-minimal

## 输出信息略(Cobbler 将镜像拷贝一份放在 /var/www/cobbler/ks_mirror/Centos-6.6-minimal-x86_64 目录下)
 (同时会创建一个名为 Centos-6.6-minimal-x86_64 的发布版本及 profile 文件)

shell > cobbler list
distros:
Centos-6.6-minimal-x86_64

profiles:
Centos-6.6-minimal-x86_64

systems:

repos:

images:

mgmtclasses:

packages:

files:

四、创建 ks 文件

shell > vim /var/lib/cobbler/kickstarts/Centos-6.6_minimal-x86_64.ks

# platform=x86, AMD64, 或 Intel EM64T
# version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://192.168.214.10/cobbler/ks_mirror/Centos-6.6-minimal-x84_64/"
# Root password
rootpw --iscrypted $1$hk0MvN4A$Dz.sYvyDjac1.cMVTk9270
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
# System keyboard
keyboard us
# System language
lang zh_CN
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone --isUtc 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 --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=1024
part / --fstype="ext4" --grow --size=1

## 这是我安装了 system-config-kickstart 在图形界面生成的 ks 文件。
## 看到第一行注释行中有一个汉字了吗?就是这个汉字让我卡了两天...( 文件中不要有汉字 )

五、关联 ks 文件

shell > cobbler distro list
Centos-6.6-minimal-x86_64

## 有一个镜像

shell > cobbler profile report --name Centos-6.6-minimal-x86_64
Name : Centos-6.6-minimal-x86_64
TFTP Boot Files : {}
Comment :
DHCP Tag : default
Distribution : Centos-6.6-minimal-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 :
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 文件为 /var/lib/cobbler/kickstarts/sample_end.ks

shell > cobbler profile add --name=Centos-6.6-minimal --distro=Centos-6.6-minimal-x86_64 --kickstart=/var/lib/cobbler/kickstarts/Centos-6.6_minimal-x86_64.ks

## 关联后,再次查看是否关联成功

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6305ad7386157ea79726f1e8f235b725.html