LOGO

Network Boot PXE Automated Citrix Xen Installation

May 13, 2013
Network Boot PXE Automated Citrix Xen Installation

Automated Citrix-Xen Hypervisor Installation via PXE

Do you find yourself desiring a streamlined process for deploying your Hypervisor? The traditional method of using installation media and manually responding to prompts can be time-consuming. This article details how to utilize PXE booting to automate a Citrix-Xen installation.

Understanding PXE Boot

PXE, or Preboot Execution Environment, allows a computer to boot directly from a network interface, rather than relying on a local storage device. This capability is crucial for automated deployments.

By leveraging PXE, the installation process can be initiated with a single button press, eliminating the need for physical media and repetitive configuration steps.

Automating Citrix-Xen Installation

HTG provides a guide on implementing a PXE-based automated installation for Citrix-Xen. This method significantly reduces the administrative overhead associated with Hypervisor deployment.

The process involves configuring a PXE server and preparing an automated installation image for Citrix-Xen. This image contains all the necessary files and answers to installation questions.

Benefits of PXE-Based Installation

  • Reduced Deployment Time: Installations are completed much faster.
  • Simplified Management: Eliminates the need to manage physical installation media.
  • Consistency: Ensures a standardized configuration across all deployments.
  • Remote Deployment: Enables installation on machines without local optical drives.

The automation offered by PXE booting, as explained by HTG, represents a substantial improvement in the efficiency of Citrix-Xen Hypervisor deployments.

Photo Credit: Pink Sherbet Photography via Compfight cc

Introduction

Previously, we demonstrated the functionality of PXE and provided instructions for a straightforward server setup using FOG. This guide builds upon that existing FOG infrastructure to incorporate a menu option for the automated installation of a Citrix-Xen server.

Similar to the process outlined in the Ubuntu live from FOG tutorial, the installation process isn't exclusively PXE-based. It initiates with PXE booting, where essential files like the kernel and initial ram disk (initrd) are delivered via PXE. However, subsequent steps involve downloading necessary files over HTTP.

While the Citrix-Xen installation guide and knowledge base document this method, a readily reproducible, step-by-step recipe is often lacking. We aim to provide precisely that today.

The core elements of this guide are:

  • Making the installation CD files accessible through HTTP.
  • Developing an automated answers file.
  • Configuring the PXE files and adding a corresponding menu entry.

Leveraging the established FOG foundation simplifies this process considerably.

Let’s begin.

XenServer 6.1 Installation via HTTP

Leveraging the FOG project’s existing infrastructure provides a readily available web server, capable of delivering the necessary installation files.

Instead of utilizing ISO loopback mounting, as demonstrated in the Ubuntu guide, we will directly copy the installation files. This approach preserves the flexibility to integrate supplemental packages during the installation procedure.

Preparing the Directory

The following command creates the directory structure that will house the installation files:

mkdir -p /var/www/xenserver61/

This command ensures that the necessary parent directories are also created if they do not already exist.

Copying Installation Files

The complete contents of the XenServer 6.1 installation CD should now be copied into the newly created directory.

It’s worth noting that you are free to establish a directory for each significant version of Citrix XenServer. For instance, a dedicated directory has been maintained for each major release since version 5.0.

This organizational strategy facilitates easier management and deployment of different XenServer versions.

Automated Installation File (Optional)

This step is designated as optional, as manual installation remains a viable path. Should you choose to forego automated installation, you will be required to respond to the installation prompts directly. A key distinction will be the installation source selection; you'll need to specify "HTTP" rather than "local media" and input the address manually.

To maintain the possibility of utilizing a mounted install CD as a loopback device, the answer file will be placed in the webserver's root directory.

The answer file can be created using the following command:

nano /var/www/xen-answerfile-61

The file's content should be structured as follows:

<!--?xml version="1.0"?--><?xml version="1.0"?><installation mode="fresh" srtype="lvm"><primary-disk>sda</primary-disk><keymap>us</keymap><root-password>password</root-password><source type="url">http://192.f.o.g/xenserver61/</source><ntp-server>192.n.t.p</ntp-server><admin-interface name="eth0" proto="dhcp" /><timezone>Asia/Jerusalem</timezone></installation>

Remember to modify the "timezone", "root-password", and "source url" values to align with your specific needs and configuration.

PXE Files

As previously indicated, certain files originating from the installation CD are required to be accessible within our TFTP directory.

The creation of this TFTP directory, which will serve as the repository for these files, can be accomplished using the following command:

mkdir -p /tftpboot/howtogeek/xenserver/xen61

Subsequently, the necessary files can be copied from either the CD or the www directory with this command:

cp -av /var/www/xenserver61/boot/xen.gz /tftpboot/howtogeek/xenserver/xen61/cp -av /var/www/xenserver61/boot/vmlinuz /tftpboot/howtogeek/xenserver/xen61/cp -av /var/www/xenserver61/install.img /tftpboot/howtogeek/xenserver/xen61/cp -av /var/www/xenserver61/boot/pxelinux/mboot.c32 /tftpboot/howtogeek/xenserver/xen61/

It is important to note that the "mboot.c32" module, the final file copied, must exhibit compatibility with the version of PXElinux utilized by your FOG environment.

Incompatibility will result in a failure of the boot process.

This module can be readily sourced from the Syslinux package if needed.

PXE Boot Menu Expansion

Previously in the FOG documentation, the possibility of incorporating sub-directories for enhanced menu organization was mentioned. A pre-existing template menu file was also provided to facilitate this future expansion. Let's proceed by creating a new menu entry through duplication of the template file:

cp -av /tftpboot/howtogeek/menus/template.cfg /tftpboot/howtogeek/menus/xen.cfg

To modify this new menu entry, use the following command:

nano /tftpboot/howtogeek/menus/xen.cfg

Subsequently, add the following configuration to the file's contents:

label Citrix XenServer 6.1#MENU DEFAULT#MENU PASSWDkernel xenserver/xen61/mboot.c32append howtogeek/xenserver/xen61/xen.gz dom0_max_vcpus=4 dom0_mem=1024M console=vga --- howtogeek/xenserver/xen61/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile=http://192.f.o.g/xen-answerfile-61 install --- howtogeek/xenserver/xen61/install.img

Remember to adjust the IP address within the configuration to reflect the correct address of your FOG server, ensuring the answer file can be accessed.

It's important to note that the "DEFAULT" and "PASSWD" options are initially commented out, as their applicability varies depending on the specific environment. However, activating these directives is strongly recommended, as unauthorized OS installations can potentially lead to significant system disruptions.

Now, integrate the newly created menu into the primary menu by editing the default configuration file:

nano /tftpboot/pxelinux.cfg/default

Append the following lines to the file's content:

LABEL XenMENU LABEL XenKERNEL vesamenu.c32APPEND howtogeek/menus/xen.cfg

The placement of this entry is significant. It is advisable to position it above the "fog.local" label for optimal menu organization.

With these steps completed, the configuration should be fully functional. Enjoy the expanded PXE boot menu!

May the power of FOG be with you…

#Citrix Xen#PXE#network boot#automated installation#virtualization#server deployment