参照官方文档
http://support.citrix.com/article/CTX128826
Citrix XenServer ® 6.2.0 安装指南 附录 C. PXE 引导安装
在设置 XenServer 安装介质之前,需要配置 TFTP 和 DHCP 服务器,配置参考http://support.citrix.com/article/CTX128826
这里,我给出自己的配置
1 centos7.1上安装与配置TFTP服务器
安装:
yum install -y tftp-server tftp xinetd
配置:
修改配置文件/etc/xinetd.d/tftp
将disable的值设为no
[root@centos71-pxe pxelinux.cfg]# cat /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
}
配置文件注意两个参数,disable参数的值控制是否关闭tftp服务器,默认是关闭的,我们要将它打开、server_args的值指出了tftp服务器传递文件的根目录,上面为/var/lib/tftpboot
systemctl enable xinetd.service
systemctl restart xinetd.service
2 centos7.1上安装与配置DHCP服务器
安装:
yum install -y dhcp
配置:
修改/etc/dhcp/dhcpd.conf
这里初始只有一段提示文字
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
我配置了自己的环境,读者可以根据自己的实际环境进行配置
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.120 192.168.1.130;
option routers 192.168.1.79;
next-server 192.168.1.71;
filename "pxelinux.0";
}
配置完后
systemctl enable dhcpd.service
systemctl restart dhcpd.service
3 nfs配置
这里参考我的另一篇博客
http://blog.youkuaiyun.com/wenwenxiong/article/details/48445005
我的配置是在192.168.1.71的/home/mnt下放XenServer6.2的iso安装文件
在192.168.1.71的/home/nfs下存放answerfile.xml文件
4 为安装XenServer6.2配置tftp服务器的文件根目录
配置 TFTP 服务器:
1. 在 /var/lib/tftpboot 目录中,创建一个名为 xenserver 的新目录。
2. 将 mboot.c32 和 pxelinux.0 文件从 /home/mnt(也就是XenServer的iso文件夹里面) 目录复制到 /var/lib/tftpboot 目录。
注意:
Citrix 强烈建议您使用来自同一个来源(例如,来自同一个 XenServer ISO)的
mboot.c32 和 pxelinux.0 文件。
3. 从 XenServer 安装介质上,将文件 install.img(位于根目录)、vmlinuz 和 xen.gz(位于
/boot 目录)复制到 TFTP 服务器上的新 /var/lib/tftpboot/xenserver 目录。
4. 在 /var/lib/tftpboot 目录中,创建名为 pxelinux.cfg 的新目录。
5. 在 pxelinux.cfg 目录中,创建名为 default 的新配置文件。
此文件的内容取决于您对 PXE 引导环境的配置。下面列出了两个示例配置。第一个示例配置在从
TFTP 服务器引导的任何计算机上启动安装过程,并让您手动响应安装提示。第二个示例配置执行
无人参与的安装。
注意:
以下示例说明如何将安装程序配置为在物理控制台 tty0 上运行。要使用其他默认设
置,应确保您要使用的控制台在最右侧。
我的第一个示例,手动响应提示
default xenserver
label xenserver
kernel mboot.c32
append xenserver/xen.gz dom0_max_vcpus=1-2 dom0_mem=752M,max:752M com1=115200,8n1 console=com1,vga --- xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0 --- xenserver/install.img
这里注意,从append开始后的都在同一行,当初我在这里犯过错。错误为安装界面出现dom0 kernel not specified checkloader configuration
我的第二个示例,无人参与的安装
default xenserver-auto
label xenserver-auto
kernel mboot.c32
append xenserver/xen.gz dom0_max_vcpus=1-2 dom0_mem=752M,max:752M com1=115200,8n1 console=com1,vga --- xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=nfs://192.168.1.71:/home/nfs/answerfile.xml install --- xenserver/install.img
同样,从append开始后的都在同一行。
这里多了answerfile=nfs://192.168.1.71:/home/nfs/answerfile.xml install
来使用answerfile.xml自动响应安装进行配置。
我的answerfile.xml为
[root@centos71-pxe pxelinux.cfg]# cat /home/nfs/answerfile.xml
<?xml version="1.0"?>
<installation srtype="ext">
<primary-disk>sda</primary-disk>
<keymap>us</keymap>
<root-password>engine</root-password>
<source type="nfs">192.168.1.71:/home/mnt</source>
<admin-interface name="eth0" proto="dhcp"/>
<timezone>Asia/Shanghai</timezone>
</installation>
这些元素在Citrix XenServer ® 6.2.0 安装指南 附录 C. PXE 引导安装中都有说明。
注意:
如果您希望启用精简置备,则可以将 srtype 属性指定为 ext。如果未指定此属
性,默认本地存储类型将为 LVM。精简置备将本地存储类型设置为 EXT3 并启用本
地缓存,以便 XenDesktop 能够正常运行。
这里,我提醒大家注意
default的配置文件与answerfile.xml的配置文件中nfs设置的区别
answerfile=nfs://192.168.1.71:/home/nfs/answerfile.xml
<source type="nfs">192.168.1.71:/home/mnt</source>
我在这里犯过错,错误为安装界面出现need more than 2 values to unpack。
至此,启动客户机并可自动从网络自动安装XenServer6.2
http://support.citrix.com/article/CTX128826
Citrix XenServer ® 6.2.0 安装指南 附录 C. PXE 引导安装
在设置 XenServer 安装介质之前,需要配置 TFTP 和 DHCP 服务器,配置参考http://support.citrix.com/article/CTX128826
这里,我给出自己的配置
1 centos7.1上安装与配置TFTP服务器
安装:
yum install -y tftp-server tftp xinetd
配置:
修改配置文件/etc/xinetd.d/tftp
将disable的值设为no
[root@centos71-pxe pxelinux.cfg]# cat /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
}
配置文件注意两个参数,disable参数的值控制是否关闭tftp服务器,默认是关闭的,我们要将它打开、server_args的值指出了tftp服务器传递文件的根目录,上面为/var/lib/tftpboot
systemctl enable xinetd.service
systemctl restart xinetd.service
2 centos7.1上安装与配置DHCP服务器
安装:
yum install -y dhcp
配置:
修改/etc/dhcp/dhcpd.conf
这里初始只有一段提示文字
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
我配置了自己的环境,读者可以根据自己的实际环境进行配置
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.120 192.168.1.130;
option routers 192.168.1.79;
next-server 192.168.1.71;
filename "pxelinux.0";
}
配置完后
systemctl enable dhcpd.service
systemctl restart dhcpd.service
3 nfs配置
这里参考我的另一篇博客
http://blog.youkuaiyun.com/wenwenxiong/article/details/48445005
我的配置是在192.168.1.71的/home/mnt下放XenServer6.2的iso安装文件
在192.168.1.71的/home/nfs下存放answerfile.xml文件
4 为安装XenServer6.2配置tftp服务器的文件根目录
配置 TFTP 服务器:
1. 在 /var/lib/tftpboot 目录中,创建一个名为 xenserver 的新目录。
2. 将 mboot.c32 和 pxelinux.0 文件从 /home/mnt(也就是XenServer的iso文件夹里面) 目录复制到 /var/lib/tftpboot 目录。
注意:
Citrix 强烈建议您使用来自同一个来源(例如,来自同一个 XenServer ISO)的
mboot.c32 和 pxelinux.0 文件。
3. 从 XenServer 安装介质上,将文件 install.img(位于根目录)、vmlinuz 和 xen.gz(位于
/boot 目录)复制到 TFTP 服务器上的新 /var/lib/tftpboot/xenserver 目录。
4. 在 /var/lib/tftpboot 目录中,创建名为 pxelinux.cfg 的新目录。
5. 在 pxelinux.cfg 目录中,创建名为 default 的新配置文件。
此文件的内容取决于您对 PXE 引导环境的配置。下面列出了两个示例配置。第一个示例配置在从
TFTP 服务器引导的任何计算机上启动安装过程,并让您手动响应安装提示。第二个示例配置执行
无人参与的安装。
注意:
以下示例说明如何将安装程序配置为在物理控制台 tty0 上运行。要使用其他默认设
置,应确保您要使用的控制台在最右侧。
我的第一个示例,手动响应提示
default xenserver
label xenserver
kernel mboot.c32
append xenserver/xen.gz dom0_max_vcpus=1-2 dom0_mem=752M,max:752M com1=115200,8n1 console=com1,vga --- xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0 --- xenserver/install.img
这里注意,从append开始后的都在同一行,当初我在这里犯过错。错误为安装界面出现dom0 kernel not specified checkloader configuration
我的第二个示例,无人参与的安装
default xenserver-auto
label xenserver-auto
kernel mboot.c32
append xenserver/xen.gz dom0_max_vcpus=1-2 dom0_mem=752M,max:752M com1=115200,8n1 console=com1,vga --- xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=nfs://192.168.1.71:/home/nfs/answerfile.xml install --- xenserver/install.img
同样,从append开始后的都在同一行。
这里多了answerfile=nfs://192.168.1.71:/home/nfs/answerfile.xml install
来使用answerfile.xml自动响应安装进行配置。
我的answerfile.xml为
[root@centos71-pxe pxelinux.cfg]# cat /home/nfs/answerfile.xml
<?xml version="1.0"?>
<installation srtype="ext">
<primary-disk>sda</primary-disk>
<keymap>us</keymap>
<root-password>engine</root-password>
<source type="nfs">192.168.1.71:/home/mnt</source>
<admin-interface name="eth0" proto="dhcp"/>
<timezone>Asia/Shanghai</timezone>
</installation>
这些元素在Citrix XenServer ® 6.2.0 安装指南 附录 C. PXE 引导安装中都有说明。
注意:
如果您希望启用精简置备,则可以将 srtype 属性指定为 ext。如果未指定此属
性,默认本地存储类型将为 LVM。精简置备将本地存储类型设置为 EXT3 并启用本
地缓存,以便 XenDesktop 能够正常运行。
这里,我提醒大家注意
default的配置文件与answerfile.xml的配置文件中nfs设置的区别
answerfile=nfs://192.168.1.71:/home/nfs/answerfile.xml
<source type="nfs">192.168.1.71:/home/mnt</source>
我在这里犯过错,错误为安装界面出现need more than 2 values to unpack。
至此,启动客户机并可自动从网络自动安装XenServer6.2