There are two methods for doing this:

  • Method 1: EASY: Install debian with xenserver template, then install OVM on it.
  • Method 2: HARD: Install using and official OMV Iso file.

I don't know the "cons" of using an initial debian install as the base. May effect upgrade-ability of OMV?

You can find both below.

Before I get started... a quick note on Xenserver direct disk access

Whenever I tell people I run a file server in xenserver, the first question is, "how do you handle storage? Do you use virtual drives? Can you do direct disk access?"

I use direct disk access. With xenserver, you can do this without any special hardware and without using some sort of virtualization passthrough (with VT-D hardware).

You basically trick xenserver in to thinking your internal drives are external/usb drives.

Here is a link on how to do it: http://techblog.conglomer.net/sata-direct-local-disk-access-on-xenserver/

The PROBLEM with doing this is that you can not take snapshots of a VM that has those drives attached to it. That just means I have to backup my system like a normal linux system (rsnapshot, attic backup, duplicity, something....

Not a big problem... but it was anoying to me at first... but now I'm over it :).

Method 1 - Install Debian, then OMV

Initial Install

Follow this guide to install debian and xentools:
http://www.ebayram.net/how-to-install-debian-squeeze-on-xenserver/

I used:

  • 1024mg RAM
  • 16GB hard drive

Like so:

My notes from the install:

  • I used the whole drive and did it all in one partition and did NOT use LVM.

Install Xentools

  • click on your VM and go to the console tab. In the dvd drive dropdown, select xs-tools.iso
  • run these commands:

Mount drive, go to the install folder, run install sh:

mount /dev/cdrom /mnt
cd /mnt/Linux
./install.sh
reboot

Add OMV:
http://forums.openmediavault.org/viewtopic.php?f=12&t=2140

echo "deb http://packages.openmediavault.org/public sardaukar main" > /etc/apt/sources.list.d/openmediavault.list
apt-get update
apt-get install openmediavault-keyring postfix
apt-get update
apt-get install openmediavault
omv-initsystem
reboot
  • Login to OMV at your IP (user: admin, pass: openmediavault)
  • Do stuff...

Method 2 - Install using Official OMV iso (Hard)

Initial Install

TIP: Name your VM something simple for now, no spaces or weird characters. I used openmediavault as the name.

Configure SSH for a new user

  • Login to OMV at your IP (user: admin, pass: openmediavault)
  • Add a user, add them to the ssh, sudo, users groups Enable SSH (under services).
  • You have to hit save AND apply
    • IE. after you hit save, wait a couple seconds and a yellow bar will appear at the top asking you to apply the configuration
    • or depending on your version.. the green "apply" circle up next to "english" in the upper right.

Convert OMV from a xen HVM to PV

This step is required so that:

  • We can add more than 1 drive (you can add 3 drives in HVM, but only if you update the kernel to 3.2, which may not be recommended).
  • better performace
  • networking acts like a normal DOMU that your used to.

NOTE: omv-extras lets you use a 3.2 kernel. I have not tested this, but it may not install a xen version of the 3.2 kernel and could break your system.

This info is basically taken from:
http://sanoojmanangat.wordpress.com/2011/03/13/%E2%80%9Cconverting-hvm-to-pv-debian-using-xencitrix%E2%80%9D/

Step1 - Install a xen kernel

apt-get install aptitude
aptitude search xen
apt-get install linux-image-2.6-xen-amd64

Step2 - Get some information about the kernel

cat /boot/grub/grub.cfg

Copy the menuentry sections for use later. I copied a section that looked like:

menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64' --class debian --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set 0d00ea02-58ef-4d49-8b5a-1f02bce1e060
        echo    'Loading Linux 2.6.32-5-xen-amd64 ...'
        linux   /boot/vmlinuz-2.6.32-5-xen-amd64 root=UUID=0d00ea02-58ef-4d49-8b5a-1f02bce1e060 ro  quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-2.6.32-5-xen-amd64
}

All you need the the last few lines:

linux   /boot/vmlinuz-2.6.32-5-xen-amd64 root=UUID=0d00ea02-58ef-4d49-8b5a-1f02bce1e060 ro  quiet
echo    'Loading initial ramdisk ...'
initrd  /boot/initrd.img-2.6.32-5-xen-amd64

The information you will need from these lines are:

  • the kernel: /boot/vmlinuz-2.6.32-5-xen-amd64
  • the kernel options: root=UUID=0d00ea02-58ef-4d49-8b5a-1f02bce1e060 ro quiet
  • the ramdisk: /boot/initrd.img-2.6.32-5-xen-amd64

Install Xentools

  • click on your VM and go to the console tab. In the dvd drive dropdown, select xs-tools.iso
  • run these commands:

Mount drive, go to the install folder, run install sh:

mount /dev/cdrom /mnt
cd /mnt/Linux
./install.sh
reboot

Now shutdown your VM

The script

ON YOUR DOM0 (xenserver) Create a script called makepv.sh with the following contents:

#!/bin/bash
confirm() {
echo -n "$1 OK [Y/n]?"
read ANSWER
if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ -z "$ANSWER" ]
then
eval $1
echo "...parameter set"
else
echo "...parameter NOT set"
fi
}
if [ -z $1 ]
then
echo -n "Name of VM [l for list]: "
read VM
else
VM=$1
fi
if [ "$VM" == "l" ] || [ "$VM" == "L" ]
then
xe vm-list | grep name-label | grep -v "Control domain"
exit
fi
echo ""
echo "Looking up UUID for VM $VM"
UUID=$(xe vm-list name-label=$VM params=uuid --minimal)
if [ -z $UUID ]
then
echo "No UUID found for $VM."
exit 0
fi
echo ""
echo "UUID=$UUID"
echo ""
echo "Setting parameters for VM $VM"
confirm "xe vm-param-set uuid=$UUID HVM-boot-policy="
confirm "xe vm-param-set uuid=$UUID PV-bootloader=pygrub"
echo ""
echo -n "Specify path to Kernel (e.g. /boot/vmlinuz...): "
read KERNEL_PATH
echo ""
echo -n "Specify Kernel arguments (root=UUID=... ro quiet): "
read KERNEL_ARGS
echo ""
echo -n "Specify path to ramdisk (e.g. /boot/initrd...): "
read RAMDISK_PATH
echo ""
confirm "xe vm-param-set uuid=$UUID PV-bootloader-args=\"--kernel=$KERNEL_PATH --ramdisk=$RAMDISK_PATH\""
echo ""
confirm "xe vm-param-set uuid=$UUID PV-args=\"$KERNEL_ARGS console=hvc0 xencons=hvc0\""
echo ""
echo "List of discs for VM $VM"
xe vm-disk-list uuid=$UUID
echo ""
echo "Looking up UUID for VBD of VM $VM"
VBD=$(xe vm-disk-list uuid=$UUID | grep -A1 VBD | tail -n 1 | cut -f2 -d: | sed "s/ *//g")
if [ -z $VBD ]
then
echo "No VBD UUID found for $VBD."
exit 0
fi
echo "VBD UUID=$VBD"
echo ""
echo "Setting parameters for VBD $VBD"
confirm "xe vbd-param-set uuid=$VBD bootable=true"
exit 0
  • Make the script executable: chmod +x makepv.sh
  • Run the script: bash makepv.sh nameofVM. The name of my VM is openmediavault so my command is bash makepv.sh openmediavault.
  • The script will ask you for the kernel, ramdisk and kernel options info we collected earlier.

Done

Boot your OMV virtual machine and your good to go.

What to do next:

  • Update your admin password
  • update your system (apt-get update then apt-get upgrade)
  • install omv-extras b/c it has some good stuff (snapraid, greyhole, btsync, etc...)