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.
Comments (12)
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...
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!!!
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.
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?
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??
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.
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.
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?
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
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.
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
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