Monday, August 13, 2012

Hyper-V Integration Components for FreeBSD – Patchfiles

Call me old fashioned, but I’d much prefer a patchset than having to install a version control package and suck down a source code check out. So please find a patchset for the Hyper-V integration components for the following versions of FreeBSD:

FreeBSD 8.2 Hyper-V Integration Components Patchset

FreeBSD 8.3 Hyper-V Integration Components Patchset

FreeBSD 9.0 Hyper-V Integration Components Patchset

FreeBSD 9.1-BETA1 Hyper-V Integration Components Patchset

Download the patchset, then issue:

patch –p –d /usr/src < <patchsetfile>

to patch the source tree, followed by:

cd /usr/src; make kernel KERNCONF=HYPERV_VM INSTKERNNAME=kernel.HYPERV

to install the Hyper-V enabled kernel to /boot/kernel.HYPERV.

Before booting to the Hyper-V enabled kernel it’s best to use GEOM labels to mount the partitions. Follow the instructions here to do this. This makes it easy for you to quickly swap between a Hyper-V enabled kernel and a non-Hyper-V enabled kernel – the reason being the Fast IDE storage driver presents itself as a SCSI driver, changing the device node path which prevents /etc/fstab from working correctly.

It’s worth noting that although I’ve fixed the modules from compiling (compared with the git clone source I pulled down), loading them from a non-Hyper-V enabled kernel will cause a kernel panic. So you need the integration components compiled into the kernel via the HYPERV kernel option.

The other problem I’ve found is that the network driver mostly works for UDP traffic, but regularly stalls on TCP traffic. Hadn’t had a chance to debug it yet.

Very happy with the increased disk performance, the ability to get heartbeat information and the ability to cleanly shut down the guests from the Hyper-V host. Looking forward to KVP communication and a working network driver.

17 comments:

Anonymous said...

This is for RELENG_8_3 (RELEASE) version or and for RELENG_8 ? If i update after patching RELENG_8_3 on RELENG_8 whot hapends ?
sory for bad english.

stryqx said...

@anonymous - I created the patches against the source code for the releases. If you're using freebsd-update, csup or similar tool to keep your source code up-to-date, then it would be best to re-apply the patch to fix up the modified files in the Freebsd source tree.
Your English is fine. It's much better than me trying to communicate in your native language.

Anonymous said...

FreeBSD 8.3 stable patched by "FreeBSD 8.3 Hyper-V Integration Components Patchset"

hn0 and hn1 interfaces:

PPPoE works fine, Apache 2.2.22 not working (pages open whery slowly - 2, 3 min and not fool)

de0 and de1 interfaces:

works great (apache too), but fool load TCP, UDP and PPPoE - big top CPU interrupts.

stryqx said...

@anonymous - thanks for the feedback. You've had more success with the network driver than me then. I haven't had a chance to look at why the network driver is faulty.

Anonymous said...

...I correct the pregoing message:
1. on hn0 interface
http://192.168.0.1/manual (apache) works, but some buggly (sometimes doesn't open)
2. on hn0 interface
https://192.168.0.1/manual doesn't work - 2, 3 min we wait for connection and the page not completely opens (distorted).
3. on de0 interface - all OK.

Anonymous said...

...an on 9.1 - too it is identical.

Anonymous said...

From https://github.com/FreeBSDonHyper-V/freebsd/wiki/Build-the-kernel-with-the-HyperV-drivers of http://freebsdonhyper-v.github.com/ the git of FreeBSD 8.2 RELEASE - the same behavior as is described above.
The main concept of FreeBSD is are network operations, but this main function do not working that crosses out other done work in this direction (hyper-v integration) :(

Anonymous said...

Resolved
https://github.com/FreeBSDonHyper-V/freebsd/issues/65

Daniyar said...

any tips for 9.1 release?

Barry B. said...

Just an FYI for those reading, the network stall issues are long since fixed. The latest sources on github work quite nicely, I've been running a patched 9.1 on hyper-v for months with no problems. I'm soon going to try using the latest version and tools and see what improvements are in place, from what I've seen they've got kvp working.

Unknown said...

Patch error:
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -urN ../src.orig/sys/amd64/amd64/io_apic.c ./sys/amd64/amd64/io_apic.c
|--- ../src.orig/sys/amd64/amd64/io_apic.c 2012-03-03 17:15:13.000000000 +1100
|+++ ./sys/amd64/amd64/io_apic.c 2012-08-13 13:31:59.000000000 +1000
--------------------------

stryqx said...

@unknown I'd recommend grabbing the latest source from github. There's lots of fixes and it's not far from being committed to the FreeBSD source tree.

tiaguera said...

hey man... i need a patch to freebsd 9.2 but i dont found... you know something about that? thanx!

Anonymous said...

ye, i need the patch for freebsd 9.2 too. Please help!

stryqx said...

Hi Anonymous. I've not had the time to revisit the Hyper-V patches yet. Hopefully I will have some time this weekend or next to update the patchset and see if it works with x86 builds too (I need this myself to migrate some old 4.x installs).

Anonymous said...

Have you had a chance to generate updated patchsets? It'd be helpful if you have.

Thank you,
Gabriel

stryqx said...

Hi Gabriel,

No I haven't. They're now integrated into the source code and works out of the box for FreeBSD 10.0 x64 and can be kernel loaded or custom kernel for FreeBSD 10.0 x86.
I don't know when I'll get to updated patches for previous versions.