<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fragged! &#187; Citrix XenServer</title>
	<atom:link href="http://fragged.nu/tag/citrix-xenserver/feed/" rel="self" type="application/rss+xml" />
	<link>http://fragged.nu</link>
	<description>computer related stuff, with a light sprinkle of hobbies</description>
	<lastBuildDate>Tue, 01 May 2012 16:54:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>XenServer on less than 16GB discs</title>
		<link>http://fragged.nu/2010/10/xenserver-on-less-than-16gb-discs/</link>
		<comments>http://fragged.nu/2010/10/xenserver-on-less-than-16gb-discs/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 07:55:12 +0000</pubDate>
		<dc:creator>Simon Juul Larsen</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Citrix XenServer]]></category>

		<guid isPermaLink="false">http://fragged.nu/?p=343</guid>
		<description><![CDATA[Following this HowTo you are able to boot &#8220;Citrix XenServer 5.5 Upd 2&#8243; on an HP 4GB SD-Card put into the internal slot of an HP DL380G6 server. This may also work using other hardware, even with other USB devices like disks or even sticks. The key is, that normally install targets are only shown [...]]]></description>
			<content:encoded><![CDATA[<p>Following this HowTo you are able to boot &#8220;Citrix XenServer 5.5 Upd 2&#8243; on an HP 4GB SD-Card put into the internal slot of an HP DL380G6 server. This may also work using other hardware, even with other USB devices like disks or even sticks.<br />
The key is, that normally install targets are only shown if they are a least 16Gb, because Citrix assumes that the local disk must also store some virtual machines. In SAN environments this is not necessary because XenServer itself only needs about 2Gb of storage. The other point is that the kernels initial Ramdisk needs driver support for the USB bootdevice</p>
<p><strong>1. Prepare your Hardware to boot from USB</strong></p>
<p>Setup your computers BIOS to boot from CD first, then USB. Maybe it&#8217;s wise to disable any other storage controllers.</p>
<p><strong>2. Boot from XenServer installation CD</strong></p>
<p>Wait until the Welcome-Screen and the &#8220;boot: &#8221; prompt at the screen bottom appears. Then type &#8220;shell&#8221; and hit enter. This will prevent the installer from being startet automatically. After a while you end up in a Linux shell.</p>
<p><strong><span id="more-343"></span>3. Patch installer to allow installation on targets with a size less than 16Gb</strong></p>
<p>Open the installers preferences file by typing:</p>
<p>vi /opt/xensource/installer/constants.py</p>
<p>If its opened, search for the line containing &#8220;min_primary_disk_size = 16 #GB&#8221; by typing (followed by enter):</p>
<p>:s/min_primary_disk</p>
<p>Change the value &#8220;16&#8243; into whatever you want (should not be less than 3Gb) and save the changes typing:</p>
<p>:wq</p>
<p>Now you are at the shell-prompt again.</p>
<p><strong>4. Continue installation</strong></p>
<p>Start the installer by typing:</p>
<p>/opt/xensource/installer/init</p>
<p>Continue installation as usual and you will find your USB/SD device in the available targets list. Use this and go on. Keep in mind that USB devices are slower than disks, so it may take longer as you expect. After the installation is done, the installer quits and you are in the shell again.</p>
<p><strong>5. Prepare installed version to boot from USB/SD</strong></p>
<p>The next steps are needed to tell the Kernel that there is a USB device as root disk, otherwise it continously reboots because of not finding a root partition.</p>
<p>mkdir /tmp/sda</p>
<p>mount -t ext3 /dev/sda1 /tmp/sda</p>
<p>chmod -R 664 /sys/block</p>
<p>cp -R /sys/block /tmp/sda/sys/</p>
<p># Ignore I/O errors</p>
<p>chroot /tmp/sda</p>
<p>cd /boot</p>
<p>mv initrd-2.6.18-128.1.6.el5.xs5.5.0.505.1024xen.img initrd-2.6.18-128.1.6.el5.xs5.5.0.505.1024xen.img.old</p>
<p>mkinitrd &#8211;with-usb initrd-2.6.18-128.1.6.el5.xs5.5.0.505.1024xen.img 2.6.18-128.1.6.el5.xs5.5.0.505.1024xen</p>
<p><strong>6. Reboot and enjoy !</strong></p>
<p>Now just reboot the server and it should simply boot from the USB/SD device.</p>
<p>You&#8217;re done!</p>
<p><strong>Conclusion</strong></p>
<p>Note: You need to do this on every XenServer you provide. Even if it is not much work to do, if you are familar with Linux you could patch the installer on the CD and create a customized one doing all this for you.</p>
<p>Alternatively you could buy a special HP or DELL version doing the same, but they are expensive. So why waste money</p>
<p>Grabbed from: <a href="http://community.spiceworks.com/how_to/show/1168">http://community.spiceworks.com/how_to/show/1168</a></p>
<p>Thanks Oliver!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffragged.nu%2F2010%2F10%2Fxenserver-on-less-than-16gb-discs%2F&amp;title=XenServer%20on%20less%20than%2016GB%20discs" id="wpa2a_2"><img src="http://fragged.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://fragged.nu/2010/10/xenserver-on-less-than-16gb-discs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding iSCSI storage repositories to XenServer</title>
		<link>http://fragged.nu/2009/08/adding-iscsi-storage-repositories-to-xenserver/</link>
		<comments>http://fragged.nu/2009/08/adding-iscsi-storage-repositories-to-xenserver/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 12:18:59 +0000</pubDate>
		<dc:creator>Simon Juul Larsen</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Citrix XenServer]]></category>

		<guid isPermaLink="false">http://fragged.nu/?p=130</guid>
		<description><![CDATA[When adding an iSCSI Storage Repository  (SR) to Citrix Xenserver, remember the following checkpoints: Use a dedicated interface for storage traffic. This is done by right-clicking on a host in the XenCenter GUI, and selecting &#8220;Mangement Interfaces&#8230;&#8221;. Create a new interface, giving it a good name such as &#8220;iSCSI LAN 10.x.x.x&#8221;. Set the IP address [...]]]></description>
			<content:encoded><![CDATA[<p>When adding an iSCSI Storage Repository  (SR) to Citrix Xenserver, remember the following checkpoints:</p>
<ul>
<li><strong>Use a dedicated interface for storage traffic. </strong><br />
This is done by right-clicking on a host in the XenCenter GUI, and selecting &#8220;Mangement Interfaces&#8230;&#8221;.<br />
Create a new interface, giving it a good name such as &#8220;iSCSI LAN 10.x.x.x&#8221;.<br />
Set the IP address of the new interface.<br />
Do this for all XenServer hosts that require access to the iSCSI shared storage.<br />
Remember that all hosts should have access to the same iSCSI LAN(s).</li>
<li><strong>Give each XenServer host a meaningfull iSCSI IQN (name).</strong><br />
This is done on the General tab on each XenServer host.<br />
Click Properties, and  then change the iSCSI IQN.<br />
This will help you in identifying each host when allowing their access on the SAN.</li>
<li><strong> Map volumes to all XenServer hosts.</strong><br />
On your preferred iSCSI SAN, create a volume and map it to all XenServer Hosts.<br />
Remember to map to the same LUN # for each XenServer Host. So if using LUN # 10 for Volume_1, use this for all of your hosts, as identified by their iSCSI IQN&#8217;s.<br />
Remember to map all XenServer hosts to every volume you intend to use for &#8220;agile&#8221; VM&#8217;s at pool level.</li>
<li><strong> Create the new SR on a pool level.</strong><br />
Right click your pool in the XenCenter GIU, and select  New Storage Repository&#8230;<br />
Select iSCSI. Enter a good descriptive name. Enter the IP address of the SAN controller that has ownership of the vdisk in question.<br />
Click Discover IQNs. Make sure that the correct controller (which has ownership of the vdisk) is selected.<br />
Click Discover LUNs, and select your desired LUN.<br />
Click Finish.</li>
</ul>
<p>Once you start populating your SR with Virtual Disks, make sure you give them all a name, and a description. This is very helpfull if you have to re-build your XenServer farm.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffragged.nu%2F2009%2F08%2Fadding-iscsi-storage-repositories-to-xenserver%2F&amp;title=Adding%20iSCSI%20storage%20repositories%20to%20XenServer" id="wpa2a_4"><img src="http://fragged.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://fragged.nu/2009/08/adding-iscsi-storage-repositories-to-xenserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-arrange Network Interface Cards in XenServer</title>
		<link>http://fragged.nu/2009/08/re-arrange-network-interface-cards-in-xenserver/</link>
		<comments>http://fragged.nu/2009/08/re-arrange-network-interface-cards-in-xenserver/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 10:58:53 +0000</pubDate>
		<dc:creator>Simon Juul Larsen</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Citrix XenServer]]></category>

		<guid isPermaLink="false">http://fragged.nu/?p=124</guid>
		<description><![CDATA[While adding multiple Network Interface Cards (NICs) to a XenServer host, I needed to re-arrange them so their logical naming (eth0, eth1, eth2 etc&#8230;) matched that of their physical order. Here&#8217;s a quick guide how to do that. Before adding your NICs to your XenServer host, note the MAC addresses of each port. You might [...]]]></description>
			<content:encoded><![CDATA[<p>While adding multiple Network Interface Cards (NICs) to a XenServer host, I needed to re-arrange them so their logical naming (eth0, eth1, eth2 etc&#8230;) matched that of their physical order.</p>
<p>Here&#8217;s a quick guide how to do that.</p>
<ol>
<li>Before adding your NICs to your XenServer host, note the MAC addresses of each port. You might also want to put this on a label, and affix it to the bracket itself, so you can determine the MAC of the NIC by looking at the rear of the server.</li>
<li>Add your NICs to your XenServer host. Note where you position each card, so you know which MAC goes where.</li>
<li>Boot XenServer.</li>
<li>From the shell (Hit Alt+F3 after boot has finished), type in:<br />
<code>xe pif-scan host-uuid=&lt;tab-complete your hosts UUID&gt;</code></li>
<li>This will scan for new NICs, and enumerate them as Physical Interfaces (PIFs).</li>
<li>Determine the order and UUIDs of the new PIFs, by running:<br />
<code>xe pif-list</code></li>
<li>This will return the uuid, device (which is actually device-name) and other info about each PIF. Check whether the device (-name) fits what you had planned. Eg. if it says eth2, and that&#8217;s what you wanted, just leave it. If you wanted it to be eth1, continue.</li>
<li>Remove the PIF from XenServer, by running:<br />
<code>xe pif-forget uuid=&lt;UUID of PIF you want to remove&gt;</code></li>
<li>Add the PIF again, by running:<br />
<code>xe pif-introduce host-uuid=&lt;UUID of your host&gt; mac=&lt;the MAC you noted earlier, seperate octets with :&gt; device=eth&lt;x&gt;</code></li>
<li>For example:<br />
<code>xe pif-introduce host-uuid=8c5bcb04-184b-4523-b870-5d3a5804ca67 mac=00:19:5b:5a:2d:a6 device=eth3</code></li>
<li>After this, your new PIF might show up with unknown device and vendor. While merely cosmetic, a reboot of your XenServer host should fix this.</li>
</ol>
<p>I was able to use D-Link DGE-528T cards, using the above, even though they aren&#8217;t officially supported on XenServer. Well&#8230; 2 out of 3 cards worked when placed in a single XenServer host. All 3 cards were detected, and named using the above method. 1 of the cards was unable to recieve an IP for the management interface, using DHCP.</p>
<p>This was tested on XenServer 5.0 update 3.</p>
<p>Thanks to <a href="http://tiri-virtual-infrastructure-howtos.blogspot.com/2009/01/xen-neues-physikalisches-interface-ethx.html" target="_blank">tiris blog</a> for pointing me in the right direction on this.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffragged.nu%2F2009%2F08%2Fre-arrange-network-interface-cards-in-xenserver%2F&amp;title=Re-arrange%20Network%20Interface%20Cards%20in%20XenServer" id="wpa2a_6"><img src="http://fragged.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://fragged.nu/2009/08/re-arrange-network-interface-cards-in-xenserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and running XenServer on a USB device</title>
		<link>http://fragged.nu/2009/05/installing-and-running-xenserver-on-an-external-usb-drive/</link>
		<comments>http://fragged.nu/2009/05/installing-and-running-xenserver-on-an-external-usb-drive/#comments</comments>
		<pubDate>Sun, 31 May 2009 09:13:55 +0000</pubDate>
		<dc:creator>Simon Juul Larsen</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Citrix XenServer]]></category>

		<guid isPermaLink="false">http://www.fragged.nu/?p=85</guid>
		<description><![CDATA[Applies to: Citrix XenServer 4.1, 5.0, 5.5 beta, possibly newer builds as well Problem: Installing and running Citrix XenServer directly from a USB- or flash-drive. This article was posted by Chris Wolf on VirtualizationReview.com. I thought I&#8217;d keep a copy here, and supplement it with my own discoveries. The article was written for XenServer 4.1, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Applies to:</strong><br />
Citrix XenServer 4.1, 5.0, 5.5 beta, possibly newer builds as well</p>
<p><strong>Problem:</strong><br />
Installing and running Citrix XenServer directly from a USB- or flash-drive.</p>
<p>This article was posted by <a href="http://www.chriswolf.com" target="_blank">Chris Wolf </a>on <a href="http://virtualizationreview.com/articles/2008/05/09/installing-and-running-xenserver-41-on-an-external-usb-drive.aspx" target="_blank">VirtualizationReview.com</a>.</p>
<p>I thought I&#8217;d keep a copy here, and supplement it with my own discoveries. The article was written for XenServer 4.1, but I find it works just as well on 5.0 and even 5.5 beta.</p>
<p>Remember that the USB device <strong>must</strong> be 16GB or more. 16GB flash drives work fine, just don&#8217;t try and run VM&#8217;s from them (performance).</p>
<blockquote><p><em>By Chris Wolf - 05/09/2008</em><br />
<strong> With a few tweaks, you can run XenServer from an external USB drive.</strong></p>
<p>I often get asked about running hypervisors from portable storage devices and in this column, I&#8217;d like to talk about a method for installing and running XenServer 4.1 from a portable USB hard drive. This is useful if you are testing multiple hypervisor solutions and do not want to multi-boot the hypervisors on local server storage. Since <a href="http://xenserver.citrix.vivoconcepts.com/prg/form/download_xenserver_express_4_1.cfm" target="_blank">XenServer Express Edition is free</a>, you can evaluate the product for as long as you like and eventually upgrade the license if you want to unlock the product&#8217;s enterprise-class features.</p>
<p>Of course, the physical host server is going to need to meet <a href="http://www.citrix.com/English/ps2/products/feature.asp?contentID=1297950" target="_blank">XenServer 4.1&#8242;s system requirements</a>. Servers with support for hardware-assisted virtualization (one of XenServer&#8217;s hardware requirements) should also support USB device boot. Many USB flash drives offer enough storage space for a XenServer installation (16GB is required per the official requirements). Note that the actual software installation will only consume about 2GB. However, keep in mind that USB flash drives perform considerably slower than traditional hard disks. So if performance is a consideration, I highly recommend using a 2.5&#8243; external USB drive. In preparation for this article, I used a Seagate external USB 2.0 40 GB hard disk.</p>
<p>While not required, I disabled all internal hard disks in the test server&#8217;s BIOS so that the XenServer installation would only see the external USB drive. This prevents accidentally installing XenServer on an internal server hard disk.<span id="more-85"></span></p>
<p>At this point, you should be ready to install XenServer 4.1. You can do so by following the installations steps documented in the <a href="http://docs.xensource.com/XenServer/4.1.0/1.0/en_gb/installation.html#installation" target="_blank">XenServer 4.1 Installation Guide</a>. Note that you will only be prompted to select the installation drive if the system can see multiple attached drives. If you take the cautionary step to disable all locally attached physical drives, you will not see this option. If multiple drives are present, you will also be prompted to select the drive for virtual storage, which again should be the external USB drive.</p>
<p>Once the XenServer installation completes, you will be prompted to hit Enter to reboot the server. This is where the trouble will begin. USB support is not preloaded by the mkinitrd image, by default, which will eventually cause a kernel panic and automatic reboot when XenServer starts. Note that if you are not seeing XenServer boot, that&#8217;s probably because the USB drive was listed farther down in the boot order than another system drive. You can select to boot from the USB drive by clicking the hotkey to access the boot options menu and selecting to boot from the USB drive at that point. For example, the boot options menu on many Dell servers is accessed by hitting the F11 key when the server boots.</p>
<p>To get XenServer to successfully boot on an external USB drive, follow these steps:</p>
<ol>
<li>When the server boots, hit the hotkey for the boot options menu.</li>
<li>Ensure that the XenServer installation CD is in the CD-ROM drive.</li>
<li>In the boot options menu, select the option to boot from the CD-ROM.</li>
<li>As soon as the Welcome to XenServer setup screen loads, immediately press the F2 key to view the advanced setup options.</li>
<li>Now type shell and hit Enter.</li>
<li>When the system finishes booting, run the following command to create a temporary folder where you will mount the external USB drive:</li>
<p><code>mkdir /tmp/sda</code></p>
<li>You will now mount the USB drive to the temporary location. Note that I&#8217;m assuming the USB drive is the only drive attached to the system and therefore is mounted as /dev/sda. To mount the first partition of sda to the /tmp/sda folder, run this command:</li>
<p><code>mount -t ext3 /dev/sda1 /tmp/sda</code></p>
<li>You will now need to copy the sys/block drivers from the setup environment to the USB drive. However, you will first need to change the driver file permissions prior to the copy. To do this, run this command:</li>
<p><code>chmod -R 664 /sys/block</code></p>
<li>You can now copy the contents of /sys/block to the USB drive. To do this, run this command:</li>
<p><code>cp -R /sys/block/ /tmp/sda/sys/block/</code></p>
<p>Note: Disregard the resultant &#8220;Input/Output error&#8221; message. The file copy will complete successfully.</p>
<li>Next you need to change the root location to /tmp/sda. You can do this by running the command:</li>
<p><code>chroot /tmp/sda</code></p>
<li>Now let&#8217;s change to the /boot folder on the USB drive. To do this, run the command:</li>
<p><code>cd /boot</code></p>
<li>Now we will rename the original primary initrd image file because the new image file will have the same name as the original file for ease of configuration. To rename the primary initrd image file, run this command:</li>
<p><code>mv initrd-2.6.18-53.1.13.el5.xs4.1.0.254.273xen.img initrd-2.6.18-53.1.13.el5.xs4.1.0.254.273xen.img.old</code></p>
<li>Next, we&#8217;ll create a new initrd image that includes the USB driver. To do this, run this command:</li>
<p><code>mkinitrd --with-usb initrd-2.6.18-53.1.13.el5.xs4.1.0.254.273xen.img 2.6.18-53.1.13.el5.xs4.1.0.254.273xen</code></p>
<li>At this point, you will now be able to successfully boot XenServer from an external USB drive. To reboot, the server, type exit and hit Enter and then type reboot and press Enter. Remember to select the external USB drive from the boot options menu when the server boots.</li>
</ol>
</blockquote>
<p>I have never had to do the steps mentioned below, and I&#8217;ve been able to use the USB device as a Local Storage Repository just fine. I&#8217;ll leave it nonetheless.</p>
<blockquote><p>When the XenServer system successfully boots, you should see that the post installation script that XenServer attempts to run will fail. The post install script will try and configure the third partition created during the XenServer installation as a data store for VM files, but will fail in the process. Since the script fails to add a local data store, you&#8217;ll just need to do this manually. Note that this assumes that you have enough additional storage on the external USB drive for VM storage.<br />
If you plan to use local storage for VMs, follow these steps:</p>
<ol>
<li>Login to the XenServer console using the root account and the root account password you specified when you installed XenServer.</li>
<li>Run fdisk -l to view the available partitions on the attached USB drive. The command execution and output is shown below:</li>
<p><code>[root@xensrv1 ~]# fdisk -l<br />
Disk /dev/sda: 40.0 GB, 40007761920 bytes<br />
64 heads, 32 sectors/track, 38154 cylinders<br />
Units = cylinders of 2048 * 512 = 1048576 bytes<br />
Device Boot  Start   End   Blocks Id System<br />
/dev/sda1    *      1  3907  4000752 83 Linux<br />
/dev/sda2        3908  7814  4000768 83 Linux<br />
/dev/sda3        7815 38154 31068160 83 Linux</code></p>
<li>As you can see, most of the drive&#8217;s storage blocks are allocated to /dev/sda3. This is the partition you will configure as a local data store for VM files. Next, you need to query the host universal unique identifier (UUID) which is generated when XenServer is installed. To do this, run this command:</li>
<p><code>cat /etc/xensource-inventory<br />
The command execution and its output is shown here:<br />
[root@xensrv1 /]# cat /etc/xensource-inventory<br />
PRODUCT_BRAND='XenServer'<br />
PRODUCT_NAME='xenenterprise'<br />
PRODUCT_VERSION='4.1.0'<br />
BUILD_NUMBER='7843p'<br />
KERNEL_VERSION='2.6.18-53.1.13.el5.xs4.1.0.254.273xen'<br />
XEN_VERSION='3.1.0'<br />
INSTALLATION_DATE='2008-05-05 17:44:15.745293'<br />
PRIMARY_DISK='/dev/sda'<br />
BACKUP_PARTITION='/dev/sda2'<br />
INSTALLATION_UUID='d3e7e1e6-80f3-4241-a6cf-3bf83971c0e6'<br />
CONTROL_DOMAIN_UUID='3e5b935a-c14e-4059-aae5-45bb87b8b864'<br />
DEFAULT_SR_PHYSDEVS='/dev/sda3'<br />
DOM0_MEM='752'<br />
MANAGEMENT_INTERFACE='xenbr0'</code></p>
<li>Note the INSTALLATION_UUID value listed in the cat command&#8217;s output. You will need it to create the new local storage repository. You can now add the local storage repository by using the xe sr-create command with the following syntax:</li>
</ol>
<p><code>xe sr-create content-type="localSR" host-uuid= type=ext device-config-device= shared=false name-label ""<br />
On my test system, the following values were used:<br />
INSTALLATION_UUID: d3e7e1e6-80f3-4241-a6cf-3bf83971c0e6<br />
Disk partition: /dev/sda3<br />
Friendly label: "Local USB Storage"</code><br />
The full command used to configure the local storage repository in my test environment is shown below:<br />
<code>[root@xensrv1 /]# xe sr-create content-type="localSR" host-uuid=d3e7e1e6-80f3-4241-a6cf-3bf83971c0e6 type=ext device-config-device=/dev/sda3 shared=false name-label "Local USB Storage"</code><br />
The remaining configuration can be performed with the XenCenter management server, which can be installed on any Windows system in your environment. XenCenter is the GUI-based central administration tool for XenServer environments. You can get more information on XenCenter on the <a href="http://citrix.com/English/ps2/products/product.asp?contentID=683148" target="_blank">Citrix XenServer page</a>.</p>
<p>You should now be able to login to XenCenter and manage the new XenServer with its available local USB storage. At this point, you are ready to install a VM on the local storage. Of course, if you do not have additional room on the local disk, you can configure network storage (i.e. NFS, iSCSI, Fibre Channel) and store VM files on the network storage array.<br />
Now you can create a new VM by clicking the &#8220;New VM&#8221; object in the XenCenter toolbar and entering the required information in the New VM wizard.<br />
When you&#8217;re done testing, just shut down any running VMs and shut down the XenServer. If you disabled any local hard disks in the system BIOS, just re-enable them and your test server is returned to its original configuration.</p></blockquote>
<p>So the really really <strong>really</strong> short version would be:</p>
<ol>
<li>Boot from XenServer install CD.</li>
<li>Install to USB device. Add Linux support if needed.</li>
<li>Reboot, leaving CD in drive.</li>
<li>Boot from install CD again.</li>
<li>Hit F2 to view advanced options.</li>
</ol>
<p>Enter the following: (<span style="text-decoration: underline;">underlined</span> items are variable)<br />
<code><br />
shell<br />
mkdir /tmp/sda<br />
mount -t ext3 /dev/sd<span style="text-decoration: underline;">a3</span> /tmp/sda<br />
chmod -R 664 /sys/block<br />
cp -R /sys/block/ /tmp/sda/sys/block/<br />
chroot /tmp/sda<br />
cd /boot<br />
mv initrd-<span style="text-decoration: underline;">2.6.18-53.1.13.el5.xs4.1.0.254.273</span>xen.img initrd-<span style="text-decoration: underline;">2.6.18-53.1.13.el5.xs4.1.0.254.273</span>xen.img.old<br />
mkinitrd --with-usb initrd-<span style="text-decoration: underline;">2.6.18-53.1.13.el5.xs4.1.0.254.273</span>xen.img <span style="text-decoration: underline;">2.6.18-53.1.13.el5.xs4.1.0.254.273</span>xen<br />
</code></p>
<ol>
<li>Remove CD.</li>
<li>Hit Ctrl+Alt+Del to reboot.</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffragged.nu%2F2009%2F05%2Finstalling-and-running-xenserver-on-an-external-usb-drive%2F&amp;title=Installing%20and%20running%20XenServer%20on%20a%20USB%20device" id="wpa2a_8"><img src="http://fragged.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://fragged.nu/2009/05/installing-and-running-xenserver-on-an-external-usb-drive/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Making a tape drive available to a guest via iSCSI</title>
		<link>http://fragged.nu/2009/05/making-a-tape-drive-available-to-a-guest-via-iscsi/</link>
		<comments>http://fragged.nu/2009/05/making-a-tape-drive-available-to-a-guest-via-iscsi/#comments</comments>
		<pubDate>Sat, 30 May 2009 20:25:18 +0000</pubDate>
		<dc:creator>Simon Juul Larsen</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Citrix XenServer]]></category>

		<guid isPermaLink="false">http://www.fragged.nu/?p=47</guid>
		<description><![CDATA[Applies to: Citrix XenServer 4.1, 5.0, 5.5 (beta) Problem: Making a tape-device located in the XenServer host available to a guest Virtual Machine. This article has been taken from WLUG.org.nz/XenNotes, I just want to keep a copy here for my own convenience. A BIG thanks to the guys at WLUG for figuring this out and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Applies to:</strong><br />
Citrix XenServer 4.1, 5.0, 5.5 (beta)</p>
<p><strong>Problem:</strong><br />
Making a tape-device located in the XenServer host available to a guest Virtual Machine.</p>
<p>This article has been taken from <a href="http://www.wlug.org.nz/XenNotes" target="_blank">WLUG.org.nz/XenNotes</a>, I just want to keep a copy here for my own convenience. <img src='http://fragged.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  A BIG thanks to the guys at WLUG for figuring this out and making it easy to understand for mere mortals like me.</p>
<blockquote><p>This is specifically for Citrix XenServer, although the principles will of course work in other Xen implementations.</p>
<p>I recently had a scenario where I was replacing two Windows servers with XenServer guests. This was fine, but we needed a way to backup to the existing SCSI DDS4 DAT drive. After failing to make PCI passthrough work, I settled on the much nicer method of providing the tape drive via an iSCSI target on the XenServer Host (Dom0). Here is how I achieved this.</p>
<p>Note 1: This is totally unsupported by Citrix.<br />
Note 2: I&#8217;ve used the XenServer terminology &#8220;host&#8221; instead of Dom0, as this applies to the Citrix commercial implementation of Xen. It will probably work fine on OSS Xen, but you can just install the normal kernel dev packages and ignore the DDK stuff.<br />
Note 3: This is for XenServer 4.1.0, but the principles are the same for previous versions. Just ensure you understand each step rather than following blindly.<br />
Note 4: You&#8217;ll need to enable yum repositories. Do this by editing <em>/etc/yum.repos.d/CentOS-Base.repo</em>, and set &#8220;<em>enabled=1</em>&#8221; for the Base, Updates and Addons repositories. You should also do this on the DDK VM.</p>
<ul>
<li>Download the Xen 4.1 DDK (Driver Development Kit) from citrix.com</li>
<li>The DDK is an ISO containing a VM with a development environment. Import it to your Xen host, and start it.<span id="more-47"></span></li>
<li>Download iscsitarget 0.4.14 (you MUST use this version, as the patch for rawio support will not cleanly apply to 0.4.15) from <a href="http://optusnet.dl.sourceforge.net/sourceforge/iscsitarget/iscsitarget-0.4.14.tar.gz" target="_blank">http://optusnet.dl.sourceforge.net/sourceforge/iscsitarget/iscsitarget-0.4.14.tar.gz</a> into your DDK VM.</li>
<li>Download the patch for rawio support from <a href="http://sourceforge.net/mailarchive/attachment.php?list_name=iscsitarget-devel&amp;message_id=1170171101.2822.23.camel@localhost.localdomain&amp;counter=1" target="_blank">http://sourceforge.net/mailarchive/attachment.php?list_name=iscsitarget-devel&amp;message_id=1170171101.2822.23.camel@localhost.localdomain&amp;counter=1</a> into your DDK VM (assuming you&#8217;re saving it in /tmp)</li>
<li>Now do the following:</li>
</ul>
<p><code>yum install kernel-devel bison flex<br />
tar -zxvf iscsitarget-0.4.14.tar.gz<br />
cd iscsitarget-0.4.14<br />
patch -p0 &lt; /tmp/raw.p<br />
make</code></p>
<ul>
<li>scp the entire iscsitarget-0.4.14 directory to your destination Xen host, and on that host (after enabling the base repo in <em>/etc/yum.repos.d/CentOS-Base.repo</em>, as noted in Note 4) do:</li>
</ul>
<p><code><br />
yum install make gcc<br />
cd iscsitarget-0.4.14<br />
make install<br />
mkdir /lib/modules/`uname -r`/kernel/iscsi<br />
cp kernel/iscsi_trgt.ko /lib/modules/`uname -r`/kernel/iscsi<br />
depmod -aq</code></p>
<p>The last three steps are required because <em>make install</em> will not copy the kernel module correctly outside the target environment.</p>
<ul>
<li>Now edit your /etc/ietd.conf and configure the tape as per the following example snippet (<em>cat /proc/scsi/scsi</em> for the correct HCIL values for your SCSI tape drive, this is an example only):</li>
</ul>
<p><code>Target iqn.2007-04.com.example:tape0<br />
Lun 0 H=1,C=0,I=6,L=0,Type=rawio<br />
Type 1</code></p>
<ul>
<li>Save and do <em>/etc/init.d/iscsi-target start</em></li>
<li>Modify <em>/etc/sysconfig/iptables</em> to allow port 3260 tcp from the IP addresses running the initiator.</li>
<li>Attach to the target using the initiator of your choice.</li>
</ul>
</blockquote>
<p><strong>Alternative download locations (from this site):</strong></p>
<ul>
<li><a href="http://www.fragged.nu/wp-content/raw.p">raw.p</a></li>
<li><a href="http://fragged.nu/wp-content/uploads/2009/05/iscsitarget-0414tar.gz">iscsitarget-0414tar.gz</a></li>
</ul>
<p><strong>Personal notes:<br />
<span style="font-weight: normal;">I have been using <a href="http://www.rocketdivision.com/port.html" target="_blank">RocketDivisions &#8220;StarPort iSCSI Initiator&#8221;</a> on the guest VM, in conjunction with Backup Exec 12.5, with success, the free version is enough.</span></strong></p>
<p>This has been working in test-environments using Backup Exec 12.5 running on Windows Server 2003 (32-bit/64-bit) and Windows Server 2008 (32-bit/64-bit). With one note: Everytime I tried installing Symantecs tape-device drivers, the VM would BSOD. So just stick with the auto-detected Windows drivers and you should be good.</p>
<p>For some controllers, the XenServer host likes to assign the tapedevice a new HCIL -ID on each boot&#8230; I haven&#8217;t found anyway around this yet, so if you do, please let me know. <img src='http://fragged.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m thinking maybe some wiz can make a script that will cat /proc/scsi/scsi at boot, enter this into /etc/ietd.conf and the restart the iSCSItarget service?</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ffragged.nu%2F2009%2F05%2Fmaking-a-tape-drive-available-to-a-guest-via-iscsi%2F&amp;title=Making%20a%20tape%20drive%20available%20to%20a%20guest%20via%20iSCSI" id="wpa2a_10"><img src="http://fragged.nu/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://fragged.nu/2009/05/making-a-tape-drive-available-to-a-guest-via-iscsi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

