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)
[code lang="bash"]
name = 'openfiler-xen'
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'
[/code]
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..
Read MoreSun Cluster 3.2 in Vmware (Fusion)
Some quick notes regarding getting a cluster working in vmware on the mac
Each VM will require:
3 or more Nics
1 or more root disks
512MB or more ram
On the first virtual machine also add a load of extra scsi disks these I created in the parent directory so that I could see them. The next step is to then right click on the Solaris Cluster Node A and “Show Package Contents”. Inside the Node ‘Package’ will be a .vmx file, this is a text file that contains the configuration information for this particular Virtual machine.
Open the vmx file and look for the scsi information (specifically that relating to the extra scsi disks we added) this will need copying. Then open Node B and add this scsi information to it’s vmx file (sometimes absolute paths are required)
[code lang="bash"]scsi0:2.present = "TRUE"
scsi0:2.fileName = "../SCSI_Disk1.vmdk"
scsi0:3.present = "TRUE"
scsi0:3.fileName = "../SCSI_Disk2.vmdk"
scsi0:4.present = "TRUE"
scsi0:4.fileName = "../SCSI_Disk3.vmdk"
scsi0:5.present = "TRUE"
scsi0:5.fileName = "../SCSI_Disk4.vmdk
[/code]
This will have both nodes pointing to the same scsi disks, in essence this would be shared scsi storage. When one of these nodes is starts it will create a bunch of .lck files that will mean that the scsi devices are locked to one particular virtual machine. Either manually delete these lck files or script something to remove them.
[code lang="bash"]
#!/bin/bash
# Script to remove locks on Disk Images
# Dan - 27/3/08
# --------------------
SCSI_LOCKS=( SCSI_Disk1.vmdk.lck SCSI_Disk2.vmdk.lck SCSI_Disk3.vmdk.lck SCSI_Disk4.vmdk.lck )
for (( i = 0 ; i < ${#SCSI_LOCKS[@]} ; i++ ))
do
echo "Checking for" ${SCSI_LOCKS[$i]}
if test -s ${SCSI_LOCKS[$i]}
then
echo "found " ${SCSI_LOCKS[$i]}
rm -R ${SCSI_LOCKS[$i]}
else
echo "" $i
fi
done
[/code]


