Difference between revisions of "XenServer/Install/PXE"
Line 10: | Line 10: | ||
# Xenserver 6.0.2<<BR>>Get the [[XenServer]] CD from [http://www.citrix.com/XenServer here] and click "Try It", then select "Start a free [[XenServer]] trial". Or | # Xenserver 6.0.2<<BR>>Get the [[XenServer]] CD from [http://www.citrix.com/XenServer here] and click "Try It", then select "Start a free [[XenServer]] trial". Or | ||
+ | |||
<pre><nowiki> | <pre><nowiki> | ||
wget http://downloadns.citrix.com.edgesuite.net/6738/XenServer-6.0.2-install-cd.iso | wget http://downloadns.citrix.com.edgesuite.net/6738/XenServer-6.0.2-install-cd.iso | ||
Line 18: | Line 19: | ||
== On your Ubuntu 11.10 machine == | == On your Ubuntu 11.10 machine == | ||
=== Install the following packages === | === Install the following packages === | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
− | sudo apt-get install apache2 isc-dhcp-server tftpd-hpa | + | sudo apt-get install apache2 isc-dhcp-server tftpd-hpa |
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== Edit /etc/network/interfaces === | === 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. | ||
− | |||
<pre><nowiki>#!wiki caution | <pre><nowiki>#!wiki caution | ||
Line 42: | Line 41: | ||
broadcast 192.168.0.255 | broadcast 192.168.0.255 | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== Edit /etc/dhcp/dhcpd.conf and add the following === | === Edit /etc/dhcp/dhcpd.conf and add the following === | ||
Line 56: | Line 54: | ||
filename "pxelinux.0"; | filename "pxelinux.0"; | ||
} | } | ||
− | |||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== tftpboot === | === tftpboot === | ||
+ | Mount the iso you downloaded and copy over the following to your /var/lib/tftpboot folder: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
Line 73: | Line 69: | ||
cp ./install.img /var/lib/tftpboot/xenserver | cp ./install.img /var/lib/tftpboot/xenserver | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== pxelinux.cfg/default === | === pxelinux.cfg/default === | ||
Line 82: | Line 77: | ||
Paste the following in /var/lib/tftpboot/pxelinux.cfg/default | Paste the following in /var/lib/tftpboot/pxelinux.cfg/default | ||
+ | |||
<pre><nowiki> | <pre><nowiki> | ||
Line 95: | Line 91: | ||
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 | 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 | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== The Answer File === | === The Answer File === | ||
Line 106: | Line 101: | ||
<primary-disk>sda</primary-disk> | <primary-disk>sda</primary-disk> | ||
<keymap>us</keymap> | <keymap>us</keymap> | ||
− | <root-password>mypass</root-password> | + | <root-password>mypass</root-password> <=== fill this |
<source type="url">http://192.168.0.1/xenserver/</source> | <source type="url">http://192.168.0.1/xenserver/</source> | ||
− | <ntp-server>IP address of my ntp server</ntp-server> | + | <ntp-server>IP address of my ntp server</ntp-server> <=== fill this |
<admin-interface name="eth0" proto="dhcp" /> | <admin-interface name="eth0" proto="dhcp" /> | ||
<timezone>America/Los_Angeles</timezone> | <timezone>America/Los_Angeles</timezone> | ||
</installation> | </installation> | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== Copy packages* and XS-REPOSITORY-LIST to your webserver === | === Copy packages* and XS-REPOSITORY-LIST to your webserver === | ||
Line 123: | Line 117: | ||
cp XS-REPOSITORY-LIST /var/www/xenserver | cp XS-REPOSITORY-LIST /var/www/xenserver | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
=== Start services === | === Start services === | ||
Line 132: | Line 125: | ||
sudo /etc/init.d/tftpd-hpa start | sudo /etc/init.d/tftpd-hpa start | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
== Ready to run == | == Ready to run == | ||
− | On your target machine, ensure that boot sequence is set to boot from network. | + | 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. |
− | 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. |
Revision as of 01:06, 8 March 2012
<<TableOfContents()>>
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 here and click "Try It", then select "Start a free XenServer trial". Or
wget http://downloadns.citrix.com.edgesuite.net/6738/XenServer-6.0.2-install-cd.iso
- 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.
#!wiki caution Ensure that your "Network 1" is isolated from any corporate network, to avoid any interference from our DHCP 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.