XCP 1.6 – XENCenter – FreeBSD 9.1-RELEASE

XenFuPanda_NoLogo_1332x1246

Time to ditch OpenStack, too bloated, too heavy for my small lab…
If you have the pleasure of having a multiple server setup,
OpenStack might be the way to go.. but for a single Virutalizing host, XCP with a XENCenter is definitely the way to go.

But everything can’t be easy, so here are my little story getting XCP 1.6 up and running with a FreeBSD 9.1-RELEASE VM.

NAS4Free – NFS – Error 32!

First off, I need to get some NFS share up and running to host my ISO library and VMs… My trusty old NAS4Free to the rescue, but yet again, not with out difficulties. I use ZFS on my NAS4Free, so I though, well let’s create a new dataset for XEN, and create two sub directories under this dataset, should be breeze.. With default settings, this do not work well..

If you try mounting the NFS share directly from the XCP host, it works, but trough XENCenter or xsconsole, it will fail. You can create the Storage volumes but it will stay deatched….

If you have the SR UUID, you can try this:

#>xe pbd-list sr-uuid=SRUUID_FOR_THE_STORAGE
#>xe pbd-plug uuid=UUID_FROM_THE_LIST_ABOVE

You will then get a SR_BACKEND_FAILURE_73 NFS mount error opterr=mount failed with return code 32 

The problem is that you need to set the option

All dirs  Export all the directories in the specified path.
To use subdirectories, you must mount each directories. (e.g. mount -t nfs host:/mnt/path/subdir /path/to/mount)

 


XCP tries to mount the SR directly, and does not work without the “Export all sub directories”.
First problem solved, now to the next problem.

Installing a FreeBSD

Well, this step was not that bad… Just choose the “other media” template when creating a new VM,
And selected the `FreeBSD-9.1-RELEASE-amd64-dvd1.iso` (witch you downloaded too your ISO lib on the NAS)

Do a normal install, but remember to to install `src` you need that for the next step.
I’ve tried the freebsd handbook way, using sysinstall, to install the src after install, and i’ve tried subversion,
sysinstall just fails, and subversion is to much work.. get the dvd iso version, and install src during the setup. (will save you a lot of headaces)

XENHVM kernel

Not to bad, if you just follow a and old post from 20011 –> 2011-06-11-freebsd-xenhvm
Since you allready have the VM up and running you only need the following steps.

  1. Log into the VM as root and type:
    cd /usr/src
    make buildkernel KERNCONF=XENHVM
    make installkernel KERNCONF=XENHVM
    

    Don’t reboot yet! You need to adjust your boot options slightly.

  2. Edit /etc/fstab and convert the substring “ada0” into “ad0”
  3. Edit /etc/rc.conf and conver the substring “ifconfig_re0” into “ifconfig_xn0”

And your set!

xenbusb_nop_confighook_cb timeout

Crap, I really thought I was on to something here now.. Well after installing the XENHVM kernel,
the VM will not start, it halts with timeouts on what seems to be the cdrom….
You will get a 60sec timeout, 120sec timeout and so on.. the VM will never boot.

There are some patches out there, but nothing seems to be working yet….
And the only workaround I found, and that actual works, is to remove the DVD-ROM….

Workaround: http://support.citrix.com/article/CTX132411

Wopiduu.. you have a FreeBSD DomU VM!

 

2 Coments

  • pive20/04/2013

    Thank you! At last, I have my FreeBSD vm running now!

  • cclein11/05/2013

    Great Job. Got this running yesterday. I found this as well:

    http://wiki.xen.org/wiki/FreeBSD_64-bit_HVM_on_XCP

    I was able to get the xenserver tools reporting.

  • Leave a Comments