之前配置过PXE,但是安装过程中还是需要手工操作,今天尝试了一下无人值守(即添加一些额外的配置),确实方便了一些。
配置如下:
tftp:
-
service tftp
-
{
-
socket_type = dgram
-
protocol = udp
-
wait = yes
-
user = root
-
server = /usr/sbin/in.tftpd
-
server_args = -s /var/lib/tftpboot -c
-
disable = no
-
per_source = 11
-
cps = 100 2
-
flags = IPv4
-
}
dhcp:
-
ddns-update-style none;
-
allow booting;
-
allow bootp;
-
authoritative;
-
subnet 192.168.1.0 netmask 255.255.255.0 {
-
option routers 192.168.1.1;
-
option subnet-mask 255.255.255.0;
-
range 192.168.1.101 192.168.1.254;
-
next-server 192.168.1.103; //
-
-
filename "pxelinux.0";
-
}
NFS:
vim /etc/exports
-
/var/lib/tftpboot/ *(rw,sync,no_subtree_check)
-
/var/lib/tftpboot/images/xenserver *(rw,sync,no_subtree_check)
vim /var/lib/tftpboot/pxelinux.cfg/default如下:
-
default menu.c32
-
prompt 0
-
timeout 300
-
ONTIMEOUT local
-
-
MENU TITLE Welcome to KaedeRukawa's PXE
-
LABEL XenServer Install
-
MENU LABEL XenServer Install
-
KERNEL mboot.c32
-
append images/xenserver/xen.gz dom0_max_vcpus=8 dom0_mem=4096M com1=115200,8n1 console=com1,vga --- images/xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=nfs://192.168.1.103:/var/lib/tftpboot/answerfile.xml install --- images/xenserver/install.img
此处,网上的其他帖子上说格式如:nfs:192.168.1.103...,没有两个斜杠,这样配置走不通,会报错如下:
Did not start {ftp,http,nfs}://,please refer to your user guide,or contact a Technical...
此外,还需要注意,这个路径/var/lib/tftpboot/还必须通过nfs共享,即在 vim /etc/exports中添加相应路径,然后重启nfs服务即可。
如果没有配置nfs,也可以通过配置http,此处书写格式如下:
append images/xenserver/xen.gz dom0_max_vcpus=8 dom0_mem=4096M com1=115200,8n1 console=com1,vga --- images/xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0
answerfile= install --- images/xenserver/install.img
answerfile.xml如下:
-
<?xml version="1.0"?>
-
<installation srtype="ext">
-
<primary-disk>sda</primary-disk>
-
<keymap>us</keymap>
-
<root-password>yourpassword</root-password>
-
<source type="nfs">192.168.1.103:/var/lib/tftpboot/images/xenserver</source>
-
<admin-interface name="eth0" proto="dhcp" />
-
<timezone>Asia/Shanghai</timezone>
-
</installation>
answerfile中各个子段的解释如下:
阅读(2615) | 评论(0) | 转发(0) |