http://my.oschina.net/sharelinux/blog/118511
03
|
1.可以使用RHEL6.0自带kickstart工具创建模板:ks.cfg
|
04
|
******************************************************
|
05
|
#platform=x86, AMD64, or Intel EM64T
|
07
|
# Firewall configuration
|
09
|
# Install OS instead of upgrade
|
11
|
# Use network installation
|
12
|
url --url="ftp://192.168.0.254/pub/rhel6/dvd"
|
14
|
rootpw --plaintext westos
|
16
|
network --bootproto=dhcp --device=eth0 --onboot=on
|
17
|
# System authorization information
|
18
|
auth --useshadow --passalgo=md5
|
19
|
# Use text mode install
|
25
|
# SELinux configuration
|
27
|
# Do not configure the X Window System
|
29
|
# Installation logging level
|
31
|
# Reboot after installation
|
34
|
timezone Asia/Chongqing
|
35
|
# System bootloader configuration
|
36
|
bootloader --location=mbr
|
37
|
# Clear the Master Boot Record
|
39
|
# Partition clearing information
|
40
|
clearpart --all --initlabel
|
41
|
# Disk partitioning information
|
42
|
part /boot --fstype="ext4" --size=200
|
43
|
part / --fstype="ext4" --size=6000
|
44
|
part swap --fstype="swap" --size=1000
|
48
|
cat > test.repo << end
|
54
|
mkdir -p /var/cache/yum/x86_64/6Server ;
|
64
|
******************************************************
|
68
|
dd if=/dev/zero of=/var/lib/libvirt/images/server.img bs=1G count=8
|
69
|
virt-install --vnc --noautoconsole --name=server --ram=512 --arch=x86_64 --vcpus=1 --os-type=linux --os-variant=rhel6 --hvm --accelerate --disk=/var/lib/libvirt/images/server.img size=8G --location=ftp://192.168.0.254/pub/rhel6/dvd --extra-args="ks=" && virt-install --autostart server
|
73
|
#function: add test servers
|
75
|
echo "input servers Num you need :"
|
79
|
for((i=1;i<=$Num;i++))
|
81
|
dd if=/dev/zero of=/var/lib/libvirt/images/server$i.img bs=1G count=8
|
85
|
--ram=512 --arch=x86_64 \
|
86
|
--vcpus=1 --os-type=linux \
|
89
|
--disk=/var/lib/libvirt/images/server$i.img size=8G \
|
90
|
--location=ftp://192.168.0.254/pub/rhel6/dvd \
|
91
|
--extra-args="ks=" > /dev/null
|
92
|
echo "server$i created ok!"
|
阅读(674) | 评论(0) | 转发(0) |