pxe install XenServer

转自: http://wiki.openstack.org/XenServer/Install/PXE#The_Answer_File

PXE Install Server for XenServer

Why do I need this?

If you choose to use XenServer as the hypervisor for your OpenStack deployment, you probably want the install to be automatic. At Citrix, we find it useful to have a PXE server around, even in a simple development environment. It makes it much easier to start automating tests later on.

Ingredients

I am using the following:

  • # Xenserver 6.0.2
    Get the XenServer CD from the Citrix website and click "Try It", then select "Start a free XenServer trial". # Ubuntu 11.10 virtual machine as the PXE server. You may just as well use a physical machine.

On your Ubuntu 11.10 machine

Install the following packages

sudo apt-get install apache2 isc-dhcp-server tftpd-hpa

Edit /etc/network/interfaces

The interface eth1 on my machine is on a network called "Network 1". Please change the instructions below to match your network setup.

Ensure that your "Network 1" is isolated from any corporate network, to avoid any interference from our DHCP, PXE server.

auto eth1
iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.0.0
        network 192.168.0.0
        broadcast 192.168.0.255

Edit /etc/dhcp/dhcpd.conf and add the following

allow bootp;

use-host-decl-names true;
option domain-name "Network 1";
option domain-name-servers 192.168.0.1;
subnet 192.168.0.0 netmask 255.255.255.0 {
        range 192.168.0.100 192.168.0.200;
        filename "pxelinux.0";
}

tftpboot

Mount the iso you downloaded and copy over the following to your /var/lib/tftpboot folder:

cd <path to XenServer CD>
cp ./boot/pxelinux/mboot.c32 /var/lib/tftpboot
cp ./boot/pxelinux/pxelinux.0 /var/lib/tftpboot
mkdir -p /var/lib/tftpboot/xenserver
cp ./boot/vmlinuz /var/lib/tftpboot/xenserver
cp ./boot/xen.gz /var/lib/tftpboot/xenserver
cp ./install.img /var/lib/tftpboot/xenserver

pxelinux.cfg/default

mkdir /var/lib/tftpboot/pxelinux.cfg

Paste the following in /var/lib/tftpboot/pxelinux.cfg/default

default local
prompt 1
timeout 60

label local
        localboot 0

label install-xenserver
        kernel mboot.c32
        append xenserver/xen.gz dom0_max_vcpus=2 dom0_mem=752M com1=115200,8n1 console=com1,vga --- xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=http://192.168.0.1/answerfile install --- xenserver/install.img

The Answer File

You may use the sample answerfile below. This must be placed in /var/www/answerfile.

<?xml version="1.0"?>
<installation srtype="ext">
<primary-disk>sda</primary-disk>
<keymap>us</keymap>
<root-password>mypass</root-password>                      <=== fill this
<source type="url">http://192.168.0.1/xenserver/</source>
<ntp-server>IP address of my ntp server</ntp-server>       <=== fill this
<admin-interface name="eth0" proto="dhcp" />
<timezone>America/Los_Angeles</timezone>
</installation>

Copy packages* and XS-REPOSITORY-LIST to your webserver

cd <path to XenServer CD>
mkdir /var/www/xenserver      # path you gave in the answerfile
cp -r packages* /var/www/xenserver
cp XS-REPOSITORY-LIST /var/www/xenserver

Start services

sudo /etc/init.d/networking restart  #if you changed /network/interfaces
sudo /etc/init.d/isc-dhcp-server start
sudo /etc/init.d/tftpd-hpa start

Ready to run

On your target machine, ensure that boot sequence is set to boot from network. Reboot your machine. Ensure it acquires a DHCP address from your PXE server. At the boot prompt, enter install-xenserver and take a deep breath.

Installing XCP

If you have the XCP CD, the process to setup PXE is almost identical to the process used forXenServer outline above.

Further Reading

For more details see:


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


批量部署XenServer

(2012-05-04 09:46:21)
1.tftproot目录下创建xenserver60目录

2.复制pxelinux.0和mboot.c32到tftproot


3.复制XenServer6.0光盘中的\install.img,\boot\vmlinuz,\boot\xen.gz到xenserver60目录


4.在pxelinux.cfg中创建
:
   default xenserver60-ext3-auto
   label xenserver60-ext3-auto
   kernel mboot.c32
   append xenserver60/xen.gz dom0_max_vcpus=2 dom0_mem=752Mcom1=115200,8n1 console=com1,vga — xenserver60/vmlinuz xencons=hvcconsole=hvc0 console=tty0answerfile=ftp://[ip-address]/xenserver60/answerfiles/xs60-ext3answerfile_device=eth0 install —xenserver60/install.img

5.在web server的root目录下创建xenserver60\install目录,将XenServer6.0光盘中全部内容都复制到xenserver60\install目录中。


6.在webserver的root目录下创建xenserver60\answerfiles目录,在xenserver60\answerfiles中创建名为xs60-ext3的应答文件,内容如下:   

   <?xmlversion=”1.0″?>
   <installationsrtype=”ext”>
   <primary-disk>sda</primary-disk>
   <keymap>us</keymap>
   <root-password>[insertpassword]</root-password>
   <sourcetype=”url”>ftp://[ip-address]/xenserver60/install/</source>
   <admin-interface name=”eth0″ proto=”dhcp”/>
   <timezone>Europe/Amsterdam</timezone>
   </installation>

7.PXE启动安装即可。

answerfile的一些选项:

1.对于存放guestvm的分区,可选择ext3或是LVM
使用ext3----><installationsrtype=”ext”>
使用LVM----><installation>
2.如果机器上有多块硬盘想作为guestvm存放的分区,则可以增加
<guest-disk>sdb</guest-disk>
3.如果不想在answerfile中明文写出root密码,则可以删掉root-password这行,但是安装过程中需要人工手动输入密码。
4.可以增加额外的其他驱动或软件包,命令形式如下,中间的URL可以为ftp,http,NFS:
<driver-sourcetype=”url”>ftp://[ip-address]/xenserver60-suppl/hp-agents-xs/</driver-source>
5.类似kickstart文件,可以自定义安装以后执行的脚本postinstall.sh,内容如下
   #!/bin/sh
   [any command to execute]
将这个postinstall.sh存放在上边的webserver目录下,例如xenserver60/scripts,注意,这个文本必须是unix格式的。
在answerfile中增加如下一行:
<scriptstage=”filesystem-populated”type=”url”>ftp://[ip-address]/xenserver60/scripts/postinstall.sh</script>

参考文档:
http://vanhal-ict.nl/citrix-xenserver-6-0-pxe-installation

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PXE LiveOS是一种基于网络引导的技术,允许用户通过本地网络从服务器上启动和运行操作系统。PXE是Preboot Execution Environment的缩写,是一种网络引导协议,使计算机能够从网络中的服务器下载和安装操作系统。 PXE LiveOS的一个重要应用是创建可移动的操作系统环境。它允许用户使用PXE启动OS(操作系统)映像,而无需安装在本地计算机上。这对于需要在不同计算机上运行相同OS或定制化的操作系统环境的用户来说非常方便。 PXE LiveOS技术的实现步骤如下:首先,需要服务器上的PXE引导服务和操作系统映像。然后,在客户端计算机中启用PXE以引导网络,通过DHCP(动态主机配置协议)从服务器获取IP地址、网关和其他网络信息。然后,PXE客户端会连接到PXE服务器并下载操作系统映像。最后,操作系统在计算机上运行,用户就可以在PXE LiveOS环境中使用各种应用程序和功能。 PXE LiveOS的优点是简化了操作系统的部署和管理。它减少了操作系统安装的需要,节省了时间和资源。用户只需一台服务器存储OS映像,就可以在需要时随时运行各种操作系统。此外,由于操作系统是从网络上运行的,因此任何计算机在连接到网络后都可以使用这种方式来启动。 总之,PXE LiveOS是一种便捷的网络引导技术,可以帮助用户快速启动和运行操作系统。利用PXE LiveOS,用户能够创建可移动的操作系统环境,并在不同计算机上使用相同的操作系统。它简化了操作系统的部署和管理过程,节省了时间和资源。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值