• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  •  Sign In
The Citrix Blog
Personal Blog
Michael O'Neill
Related Tags
posted by Michael O'Neill

Summary

This article describes how to create a local NFS-based ISO Library on a XenServer host. This procedure will destroy the Local Storage Repository and replace it with an NFS share.

**DISCLAIMER**

CHANGES TO THE DOMAIN 0 VM ON A XENSERVER HOST MAY RENDER THE HOST UNSUPPORTED. This procedure describes several changes to the XenServer host's configuration that may cause it to become unsupported.

Better Option

A better option to obtain this same functionality would be to build a hosted NFS server VM and connect the shared ISO Library to the hosted VM.

References:

- How To Change the Default Storage Repository to File-based VHD-on-EXT3 http://support.citrix.com/article/ctx116324

- Allow NFS through iptables on a RedHat system http://pario.no/2008/01/15/allow-nfs-through-iptables-on-a-redhat-system/

Procedure:

Step 1.

First, install XenServer Enterprise on the system with the default Logical Volume Manager (LVM)-backed storage repository (SR).

 

Step 2.

Next, we need to remove the LVM-backed Local Storage repository.

*NOTE* If you have virtual machines (VMs) on your existing local LVM-backed SR please backup (export) and afterwards delete them before continuing.

a. Find the default SR device ID, universal unique identifier (UUID), and remove the default SR.
i.              Log on to the XenServer server console.
ii.             Type the following command to display information about your default SR.

# xe sr-list type=lvm

 
Make a note of the default UUID.

In this case, the SR UUID = 63276e9a-4d15-dd2e-f437-599d6c01e4b4

iii.             Determine the UUID for your default SR's physical block device (PBD) using the following command:

# xe pbd-list sr-uuid=your SR UUID

 
Make a note of the PBD UUID.

In this case, the PBD UUID = 28f63f05-a5b4-96df-072a-f7232acefb24

iv.           Disconnect the Local Storage SR using the following command:

# xe pbd-unplug uuid=your PBD UUID

 
At this point, the Local Storage SR should show as disconnected in the XenCenter console denoted with a red exclamation point.
 
v.  Now remove the Local Storage SR using the following command:

# xe sr-destroy uuid=your SR UUID

 
 At this point, the Local Storage SR should show as removed in the XenCenter console.
 
 

Now if we issue the #xe sr-list type-lvm command, we can see that the Local Storage SR no longer exists...

 

...but if we issue the # fdisk --l command, we can see that we have a nice empty partition on which to build our NFS share.

 

b.     The next step is to ready this partition for an NFS share by installing a file system on it.

i.      Install file system on /dev/sda3

# mkfs -t ext3 /dev/sda3
Step 3.

Now let's make sure the NFS service is started and set to export our share. NFS exports from a server are controlled by the file /etc/exports. Each line begins with the path of a directory to be exported, followed by a space-separated list of allowed clients.

a.     First create a mount point and mount the new disk.

# mkdir /mnt/nfs

# mount --t ext3 /dev/sda3 /mnt/nfs

b.     Confirm that it is mounted with the mount command.
c.     Edit the /etc/exports  file  and add something like the following:

This will allow all clients on the subnet to attach to the share.

d.     Next start the NFS service.
 
Step 4.

Now we can work on opening up the firewall. XenServer ships with a firewall enabled and running. There are a couple of ways to 'open' the firewall.

a.     The Lazy Man's way is to turn off the firewall altogether. (THIS IS NOT RECOMMENDED)

i.    Simply stop the iptables service
b.     The better way is to open the ports on the firewall.

This command will show the ports that are actively being used by services that NFS will need.
c.     We can now make entries to the /etc/sysconfig/iptables to open those ports to allow communication. (In my case I only needed to open ports 111  and 2049 - portmapper and nfs)
 

Step 5.

We can now attach our NFS share to the XenServer pool as a NFS based ISO SR.
...and there she be!
Copy some files up to the share and you're ready to go.

Labels

nfs nfs Delete
storage storage Delete
iso iso Delete
sr sr Delete
xenserver xenserver Delete
lang-eng lang-eng Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jun 17

    Anonymous says:

    This doesent work in the new Xenserver 5  it sayes that the NFS Version i...

    This doesent work in the new Xenserver 5

     it sayes that the NFS Version is unsupported...

  2. Jun 24

    Anonymous says:

    This doesent work in the new Xenserver 5.5 either  it sayes that the NFS V...

    This doesent work in the new Xenserver 5.5 either 

    it sayes that the NFS Version is unsupported... STILL!!!

  3. Jun 30

    Toomas Aas says:

    I don't know why it doesn't work for mr. Anonymous, but it has worked for me in ...

    I don't know why it doesn't work for mr. Anonymous, but it has worked for me in 5.0.0 Update 2, 5.0.0 Update 3 and is also working in 5.5.0.

  4. Jun 30

    Michael O'Neill says:

    yup - I have confirmed tested good on 5.5 also. in step 3, does the NFS service...

    yup - I have confirmed tested good on 5.5 also.

    in step 3, does the NFS service start?

  5. Jun 30

    Jake Wicks says:

    Everything seems to work for me, but when coming to create the ISO share, i get ...

    Everything seems to work for me, but when coming to create the ISO share, i get this error:

    "Creating SR

    unable to mount the directory specified in device configuration request"

    I anyone able to help me with this??

  6. Jul 08

    Anonymous says:

    This is what I get in my Xen5.5 ENT.  While trying to create NFS VHD stora...

    This is what I get in my Xen5.5 ENT. 

    While trying to create NFS VHD storage via XenCenter5.5
    "The NFS server version is unsupported. Check your settings and try again."

    While trying to create NFS ISO Librarystorage via XenCenter5.5
    "Unable to mount the directory specified in device configuration request. Check your setting and try again."

    Any help to resolve this issue is appreciated. 

  7. Jul 15

    Anonymous says:

    I have heard rumors that there is a kernel bug causing this.  However my ke...

    I have heard rumors that there is a kernel bug causing this.  However my kernel skills really preclude me from verifying whether or not this is the real cause.

    I have xen 5.0 hotfix 3.  I can mount the iso locally (mount 127.0.0.1:/isoshare /mnt) without a problem.  But when I try to mount it from another server in the pool I get errno 111 and connection refused.  I had no problems with Xen 4 and I think it was worknig with 5.0.0 but don't quote me.

    Hosting a local iso repository SHOULD be a supported configuration.  It beats having it sit elsewhere on the network or even on a local nfs VM.

    I wish they would fix this.

  8. Jul 21

    Anonymous says:

    Same issues. As i try to create teh NFS ISO Library, it says "Unable to mount ...

    Same issues. As i try to create teh NFS ISO Library, it says

    "Unable to mount the directory specified in device configuration request. Check your setting and try again."

    I had this working in 5.0. Trying this on a new fresh build of 5.5 and it fails.Anyone fix it?

    1. Jul 21

      Anonymous says:

      As a troubleshooting step, try turning off the firewall on the XenServer host. ...

      As a troubleshooting step, try turning off the firewall on the XenServer host.

       #service iptables stop

  9. Aug 07

    Anonymous says:

    Had the same Problem and just added the iptable rules tcp/udp port 111/2049 and ...

    Had the same Problem and just added the iptable rules tcp/udp port 111/2049 and it works now fine.

    1. Sep 01

      Anonymous says:

      if you want to mount the nfs-sr also on other machines than the xenserver which ...

      if you want to mount the nfs-sr also on other machines than the xenserver which exports it, you need to remove the "-l" from the file /etc/sysconfig/portmap. without this, the portmap service is only listening on localhost

  10. Nov 13

    Anonymous says:

    Same issue here, Xen 5.5.0 (Build Date: 2009-06-06, Build Number: 15119p) Tried...

    Same issue here, Xen 5.5.0 (Build Date: 2009-06-06, Build Number: 15119p)

    Tried with iptables on/off, tried adding xen IP to /etc/exports and explicitly set rw, tried a bunch of How-tos from the internet to set up nfs... nothing seems to work

Add Comment