FreeBSD 10 On CloudStack + XenServer

FreeBSD-CURRENT has a ton of Hardware Assisted Virtualisation (HVM) fixes and enhancements to support the Xen Hypervisor. The 2 major issues that prevented CloudStack users from creating FreeBSD HVM templates on Xen have been addressed with the following commits…

  1. Revision 256423 – Allow FreeBSD to be booted from CDROM media on XenServer 6.2 and prior releases.
  2. Revision 256071 – Correct panic caused by attaching both Xen PV and HyperV virtualization aware drivers on Xen hypervisors that advertise support for some HyperV features.

FreeBSD 10 BETA2 and later onwards have these fixes and now work out of the box under CloudStack and XenServer with HVM support. To get started…

  1. Login to Apache CloudStack 4.2
  2. Register FreeBSD ISO from the “template” section. The OS Type must be set to “Other (64-bit). ISO images are available at http://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/10.0/. Currently at FreeBSD 10 BETA3 as of this writing.
    Screen Shot 2013-11-05 at 9.59.25 am
  3. Wait for the ISO to download
    Screen Shot 2013-11-05 at 2.33.33 pm
  4. Start the installationScreen Shot 2013-11-05 at 4.48.49 pm
  5. The network interface is detected at “xn0″Screen Shot 2013-11-05 at 4.55.52 pm
  6. Complete installationScreen Shot 2013-11-05 at 4.59.51 pm
  7. Create and register a template from the running instance
  8. Launch more instances
root@fbsd2:~ # dmesg |grep ^x
xen_et0: <Xen PV Clock> on motherboard
xenpci0: <Xen Platform Device> port 0xc000-0xc0ff mem 0xf2000000-0xf2ffffff irq 30
at device 3.0 on pci0
xenstore0: <XenStore> on xenpci0
xctrl0: <Xen Control Device> on xenstore0
xenbusb_front0: <Xen Frontend Devices> on xenstore0
xn0: <Virtual Network Interface> at device/vif/0 on xenbusb_front0
xn0: Ethernet address: 02:00:37:6d:00:05
xenbusb_back0: <Xen Backend Devices> on xenstore0
xn0: backend features: feature-sg feature-gso-tcp4
xbd0: 5120MB <Virtual Block Device> at device/vbd/768 on xenbusb_front0
xbd0: attaching as ada0
xbd0: features: write_barrier
xbd0: synchronize cache commands enabled.
root@fbsd2:~ # uname -a
FreeBSD fbsd2 10.0-BETA2 FreeBSD 10.0-BETA2 #0 r257166: Sat Oct 26 19:23:22 UTC 2013
root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

As of BETA2, there is still one pending issue. Shutting down the instance via the Stop Instance tab in CloudStack (or via XenCenter) will halt the OS but does not poweroff the instance with Xen tools running. This should get addressed in later releases. See kern/171118

References:

  1. CloudStack Installation Guide
  2. http://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-amd64/10.0/
  3. Earlier Blog Post on running FreeBSD On XenServer
  4. XenServer
  5. xen-tools port

Shanker Balan

Shanker Balan is a devops and infrastructure freelancer with over 14 years of industry experience in large scale Internet systems. He is available for both short term and long term projects on contract. Please use the Contact Form for any enquiry.

More Posts - Website

Follow Me:
TwitterLinkedIn

9 thoughts on “FreeBSD 10 On CloudStack + XenServer”

  1. Can you do a simple network test in your FBSD XenserverVM? Something like “wget -O /dev/null” from your LAN.

    In KVM I’ve found FBSD’s performance to be very disappointing despite them including VirtIO out of the box. The above command on a linux guest can saturate a 1 Gbps link, while the BSD one barely touches 25 Mbps..

  2. My speeds look Ok on FreeBSD 10 BETA4 running on XenServer 6.2

    $ sysctl kern.vm_guest
    kern.vm_guest: xen
    
    $ wget -O /dev/null http://192.168.65.1/FreeBSD-10.0-BETA4-amd64-20131130-r258774.qcow2
    --2013-12-12 14:46:01--  http://192.168.65.1/FreeBSD-10.0-BETA4-amd64-20131130-r258774.qcow2
    Connecting to 192.168.65.1:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 861798400 (822M) 
    Saving to: '/dev/null'
    
    100%[======================================>] 861,798,400 60.1MB/s   in 13s    
    
    2013-12-12 14:46:14 (61.0 MB/s) - '/dev/null' saved [861798400/861798400]
    
    $ uname -a
    FreeBSD freebsd10-beta4-amd64 10.0-BETA4 FreeBSD 10.0-BETA4 #0 r258774: Sun Dec  1 00:51:31 UTC 2013     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
    
  3. Thanks. It seems to suck consistently, just like in my KVM tests.
    My intention was to use FreeBSD machines as PF firewalls.. imagine my disappointment at the network “performance”.
    Hopefully as more and more people will use it and complain about it the devs will do something about it. :-)

  4. Hi Nux,

    My original testing was incorrect, I had a router in between which gave slower results.. I had updated my performance results and the FreeBSD instance had similar performance.

  5. Ok, test results on FreeBSD 10-RC1 under CloudStack/XenServer is also good.

    Connecting to 192.168.65.1:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 861798400 (822M) 
    Saving to: '/dev/null'
    
    100%[======================================>] 861,798,400 40.5MB/s   in 19s    
    
    2013-12-12 19:11:32 (42.8 MB/s) - '/dev/null' saved [861798400/861798400]
    
    FINISHED --2013-12-12 19:11:32--
    Total wall clock time: 19s
    Downloaded: 1 files, 822M in 19s (42.8 MB/s)
    root@freebsd10-amd64-xen:~ # 
    
  6. 42 MB/s is not bad, but a linux guest usually saturates a 1 Gbps link. I’m also curious at the load this VM puts on the hypervisor while transferring data.
    Cheers for sharing!

Leave a Reply