Add a USB disk to a XenServer

I’ve been playing around and setting up my home lab (see another post coming up) to create my own test lab for Citrix.

I’ve got a 1 TB disk in my server but it runs out of diskspace very quickly when you are creating multiple VM’s and test machines. So I thought why not attach an extra USB disk to my server. In this way I can place some XenDesktop machines on the external drive and keep the internal drive for my permanent test VM’s.

Well that was easier thought than executed.

I’ve connected my USB disk to the server and did a “fdisk –l” to see if the USB disk was recognized.

 

XS-fdisk

Fortunately it was recognized and I continued on to creating a Storage Repository (SR).

I created the SR with the following command on the console of my XenServer:

“xe sr-create name-label="USB750GB" content-type=user type=lvm device-config:device=/dev/sdb1”

xs-xe-sr

After this the USB disk is usable and seen in the XenCenter console.

xs-overview

Should this command not work you can always use the following command to create the SR:

“mkfs -V -t ext3 /dev/sdb1” (Note that the –V is in uppercase if the lower case gives an error). sdb1 is the drive assignment of my USB drive. With the “fdisk –l” command you can see what assignment your USB drive has.

But before this was accomplished I ran into the problem that another disk I was using as USB drive was not working properly. Therefor I could create a SR and see the disk in XenCenter but when trying to copy or create a disk in XenServer I’d receive an error that the SR was unavailable. So that was about half a day of troubleshooting because I was in the middle of installing and configuring XenDesktop. In another post I’ll explain what tools and steps you can take to troubleshoot XenDesktop issues.

3 thoughts on “Add a USB disk to a XenServer”

    1. reply to myself 🙂
      right click on the drive, click “copy UUID to clipboard”.
      (my UUID is “8393e892-6999-1bed-739c-2fd78459e0fc” )
      run this command:
      xe sr-forget uuid=8393e892-6999-1bed-739c-2fd78459e0fc

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.