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.
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.
sudo apt-get install apache2 isc-dhcp-server tftpd-hpa
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
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"; }
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
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
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>
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
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
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.
If you have the XCP CD, the process to setup PXE is almost identical to the process used forXenServer outline above.
For more details see:
http://docs.vmd.citrix.com/XenServer/6.0.0/1.0/en_gb/installation.html#pxe_boot_install
http://xen.org/files/XenCloud/installation.pdf
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
标签: xenserverpxe批量部署自动化安装无人值守it |
分类:PXE/Kickstart |