.. on Linux
Openfiler (x86 & x86_64) iSCSI in Xen
A nice all round NAS/SAN storage system for small businesses fits well into a virtualised infrastructure, a seperate nic is recommended but for a small business a shared core and a reasonable allocation of memory is all that is required. There has been a disk image domU release for openfiler however this official release was version 1.0 and had only a x86 kernel (meaning that x64 xen builds would complain). Here is a simple how-to to having a complete NAS and SAN (using iSCSI) solution using xen.
1. Download domU filesystem image for openfiler (ensure correct architecture is downloaded) At current time openfiler-2.3-x86_64.tar.gz
2. Create a root filesystem for openfiler to live on:
- lvcreate -L 5G -n openfiler rootdg
- dd if=/dev/zero of=/export/openfiler.img seek=5G count=1
These will create either a 5GB logical volume or a 5G disk image to use as a disk for the openfiler filesystem
3. Create a filesystem on the disk/image. This is down with mkfs [path to file system/disk image]
4. Label the filesystem, which is required for the fstab for openfiler. This is done with e2label [path to file system/disk image]
5. Mount the new filesystem and extract the archive into it. If it is the logical volume then directly mount it (e.g. /mnt) or if a disk image a loop back mount will be required (e.g mount -o loop /export/home/openfiler.img /mnt). Copy the archive into the mount, then change directory to the mount and untar the archive (e.g. tar xvf openfiler-2.3-x86_64.tar.gz)
6. Unmount the filesystem and create a second 100mb filesystem. This second filesystem will be used as swap so needs a swap fs creating on it (e.g. mkswap /path/to/swap[fs/img])
7. Create xen config file (this example will need paths altering)
memory = ’256′
kernel=‘/boot-a/vmlinuz-2.6.20-xenU’
disk = [ ‘tap:aio:/dev/rootdg/openfiler,xvda1,w’, ‘tap:aio:/dev/rootdg/openfiler_swap,xvda1,w’ ]
vif = [ ” ]
root="/dev/xvda1 ro"
#bootloader = ‘/usr/bin/pygrub’
on_reboot = ‘restart’
on_crash = ‘restart’
8. Start the xen image with a (e.g. xm create -c /path/to/configfile) and there you go, follow the install instructions from the relevant place on openfilers website to configure and finish the setup.
Note: Obviously this example has no extra disk space attached, it would make sense to add a large third disk to the xen config file. So that openfiler then can use that to allocate space as NFS/SMB or iSCSI etc..
| Print article | This entry was posted by dan on July 31, 2008 at 9:50 am, and is filed under Computers. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 1 year ago
Hi, just thought I’d add a couple info that might be useful:
1) to label your disk/file.img:
e2label /path/to/file.img root or
2) Where can I find vmlinuz-2.6.20-xenU specified in the config file?
Well, once unpacked openfiler.tar.gz somewhere /path/to/unpacked/openfiler look into the boot directofy and copy files:
config-XXXX.xen.domU
System.map-XXXX.xen.domU
vmlinuz-XXXX.xen.domU
vmlinux-XXXX.xen.domU
to /boot-a/
In my case the files where:
vmlinuz-2.6.21.7-3.20.smp.gcc3.4.x86_64.xen.domU
etc
Regards
about 1 year ago
always appreciated
about 1 year ago
I cannot understand why these simple instructions couldn’t be present in openfiler’s site.
Thank you very much.
about 1 year ago
I used your configuration too. Many thanks
But I got problems with the network and so I used
vif = [ "mac=00:16:3e:5f:df:6a,bridge=xenbr0" ]
instead of your vif option!
But without your instructions, I would have failed.