In our environment we use Altiris Deployment Solution (DS) to perform a completely automated server build. My deployment jobs configure the hardware, install the operating system, Citrix XenApp, and supporting applications. At the end is a server, ready to take applications. We are now in the process of virtualizing our XenApp servers on XenServer and I want to automate that process, as well. This guide will provide the instructions for performing an automated Citrix XenServer build, and end up with a XenServer installation with the Altiris agent installed and configured.
The XenServer installation guide shipped with the software, specifies how to perform an automated PXE installation of XenServer. For the record, that documentation has many, many mistakes, so if you follow it exactly you wonâ€™t get a working setup. Citrix seems to have just copied it from early Xen versions without updating it. The documentation assumes the use of a Linux server that will serve as a DHCP/PXE/HTTP server for the installation. We already have Altiris Deployment Solution, and I didnâ€™t want to have to reinvent the wheel, and have two disparate solutions; so I started working on getting the automated build working with Altiris. My solution will assume Altiris Deployment Solution 6.9 SP1 and XenServer 5.5.0, but you should be able to easily adjust for your environment.
The first step in the installation routine is to provide a location for the install files. The XenServer automated build process actually support http, ftp, and nfs for storage locations. I am using http because I already have it running for the Deployment Web Console.
If you donâ€™t already have IIS installed for the Deployment Web Console go ahead and install it now.
Navigate to the â€œDefault Web Siteâ€ home directory.
Create a directory called XenServer.
Within XenServer create a directory called 5.5.0.
Copy the packages.main directory from the XenServer install CD to 5.5.0.
Copy the packages.linux directory from the XenServer Linux CD to 5.5.0. (You can leave this step out if you never plan on running Linux guests.)
In IIS Manager, bring up the properties for the XenServer directory.
Under â€œHTTP Headersâ€, select â€œMIME Typesâ€¦â€ and enter the information below.
This step is needed for IIS to treat all .* files as binary files and allow them to be downloaded during the installation.
Configure and copy adlagent.conf from the AgentsAdlAgent directory of your DS eXpress share to the XenServer directory.
Copy Altiris-adlagent-2.6-65.x86_64.bin from the AgentsAdlAgent directory of your DS eXpress share to the XenServer directory.
The next step is to create the answer file that the XenServer installation process will use for the install. In my installation, I keep this answer file as simple as possible and use Altiris to perform the customizations. The next step is to create the answer file that will provide the configuration details for the base installation.
In the XenServer5.5.0 directory created earlier, create your answer file, â€œanswerfile.xmlâ€. Refer to Appendix B in the XenServer 5.5 Installation Guide pg. 32 for the syntax.
Included below is a working example you can use. Replace *SERVER* with the name or IP Address of your DS server. Also, since this file can be read by anyone, I highly recommend changing the root password at the very earliest occasion.
<admin-interface name="eth0" proto="dhcp"></admin-interface>
Now we will work on the installation scripts. This process involves two. The first script sets up the second script to be executed when the server reboots into the XenServer OS. The main reason for this is that during the installation process the target filesystem is actually mounted to /tmp/root. So any installations, such as the Altiris client, would actually install to the temporary filesystem setup by the installation environment. We remedy this by having the setup work done when the server reboots into the XenServer OS.
In the XenServer folder create post-install-setup.sh and insert the code below substituting *SERVER* for your DS name or IP Address.
As mentioned above, the root filesystem of the host is actually mounted to /tmp/root so by placing the post-install-script.sh in /tmp/root/etc/rc3.d we can have the script run on the first host boot.
In the XenServer folder create post-install-script.sh and insert the code below substituting *SERVER* with your DS name or IP Address.
This script downloads the agent files, installs the agent, copies the configuration file to the appropriate location and then deletes itself.
Now we will set up the PXE files to start the installation process.
Create a directory and copy the following files from the XenServer Installation CD: install.img, Bootxen.gz, and Bootvmlinuz.
Download Syslinux from http://www.kernel.org/pub/linux/utils/boot/syslinux/ and extract mboot.c32 and pxelinux.0 to the directory above.
Open the PXE Configuration Utility and create a new boot option.
Select Linux, x86, and user supplied.
Click â€œManual Boot Imageâ€¦â€ and select the directory created above.
Make a note of the â€œFinal Locationâ€. You will have to edit some files manually.
Navigate to the PXEMasterImagesMenuOptionXXX directory using the number designation from the â€œFinal Locationâ€.
In the X86PC directory create a directory called pxelinux.cfg. In this directory create a file called default and insert the content below substituting *SERVER* with your DS server name or IP Address.
append xen.gz dom0_mem=752M com1=115200,8n1 console=com1,tty --- vmlinuz console=ttyS0,115200n8 console=tty0 answerfile=http://
&lt;p align="justify"&gt;&lt;strong&gt;Note:&lt;/strong&gt; The append line, which is the last line, is one single, non-breaking, line. If you break up the line it will break the setup.&lt;/p&gt;<br /><br />
&lt;p align="left"&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp; Replicate the PXEMasterImagesMenuOptionXXX directory to PXEImagesMenuOptionXXX directory using the number designation. &lt;/p&gt;<br /><br />
&lt;h3&gt;&amp;nbsp;&lt;/h3&gt;<br /><br />
&lt;h3&gt;Conclusion&lt;/h3&gt;<br /><br />
&lt;p align="justify"&gt;&amp;nbsp;&lt;/p&gt;<br /><br />
&lt;p align="justify"&gt;Now with all of this setup you now have a working automated XenServer build. On your target server, boot the server. At the PXE menu, hit F8 and select â€œXenServer Automated Buildâ€. The server will have XenServer installed and automatically added to your DS console.&lt;/p&gt;<br /><br />
&lt;p align="justify"&gt;The selecting of the PXE boot boot menu has to be manual. You could have it boot into the menu by assigning the job, but since there is no agent in the installation environment it would just continuously boot into the PXE installation.&lt;/p&gt;<br /><br />
&lt;p align="justify"&gt;Since the hostname was not specified, it will default to localhost.localdomain. This also means that it will show up as localhost in the Altiris console.&amp;nbsp; For one system this is not really an issue. However, when&amp;nbsp; trying to set up a number of systems this can cause confusion. In a subsequent post,I will demonstrate a method for using an external reference, to provide to Altiris the information needed to correctly configure the systems. &lt;/p&gt;<br /><br />