Adding PXE Support for FreeBSD Guests to bhyve

Project description

My project will add basic PXE support to bhyve for FreeBSD guests. Though PXE is the most accurate term to describe the idea, it is slightly misleading. My work will take place in bhyveload, the bhyve userspace loader, which is a fork of FreeBSD's standard boot loader. I will add support for basic DHCP, and loading the kernel, loader.conf (boot time configuration), and modules from a remote TFTP server specified either in the DHCP “next-server” field, or in a bhyve tunable. Once the kernel and modules are loaded bhyve may simply start execution of the kernel as usual.

This project would be benefit bhyve users in a number of ways. First it would allow running a centralized kernel build across a host's FreeBSD virtual machines. If you run a custom kernel, only a single rebuild would be required. If you run the generic one, you only need to patch a single kernel. This project also opens the door to running VM's without virtual hard drives. It could also allow for using a previous GSOC project for PXE automated installations in bhyve.

The feature would make it possible to deliver a common set of kernels to all of the virtual machines across multiple bhyve instances as they boot. For example, if I had a "Web Server" and a "Database server", I could specify in DHCP that they require a different kernel or different modules loaded at boot. All my kernels are still in one place though, I don't have to rebuild the kernels on each bhyve host, just once on the TFTP server.

Approach to solving the problem

I think that the problem can be broken into its individual pieces fairly easily:

After these parts are working individually, I think it should be much easier to introduce it into bhyve.

Deliverables

The following features will be implemented:

If there is time:

Milestones

Here are my milestones for the project. I hope to get alot done in the hackers lounge at BSDCan.

Test Plan

It is fairly easy to test the final product. When we can can boot a FreeBSD VM in bhyve via a tftp loader.conf / kernel / modules, it is working.

This section is still in flux.

The Code

https://socsvn.freebsd.org/socsvn/soc2015/sdouglas/

SummerOfCode2015/PXEbhyve (last edited 2015-05-26 01:48:47 by StevenDouglas)