bsd-cloudinit

FreeBSD on OpenStack: cloud-init scripts for FreeBSD

This project is maintained by pellaeon

FreeBSD on OpenStack

There has not been a complete solution to run FreeBSD instances on OpenStack, until now.

With bsd-cloudinit and bsd-cloudinit-installer, you could build a FreeBSD VM image that takes advantage of the cloud environment.

Components

The entire project to run FreeBSD on OpenStack is called Feng Li Su (鳳梨酥), a kind of cuboid-shaped sweet Taiwanese pastry with soft crust and pineapple fillings.

bsd-cloudinit-installer installs bsd-cloudinit, and make /etc/rc.local invoke bsd-cloudinit at first boot.

bsd-cloudinit

bsd-cloudinit is a Python script based on cloudbase-init that do various tasks to prepare the FreeBSD instance for cloud environment.

Features:

bsd-cloudinit-installer

A shell script to transform VM into OpenStack VM Template and installs bsd-cloudinit

Features:

Built image

We have experimental built images available for download.

You can use the following command to upload the image to Glance

glance image-create --name "FreeBSD 9.2" --disk-format qcow2 \
 --container-format bare < freebsd-9.2-fls-cloudimage-v3.img

bsd-cloudinit will inject your SSH public key into the instance, just log in with username freebsd.

The root password is fenglisu.

Build a FreeBSD VM image for OpenStack

If you would like to build your own image, follow the guides below.

bsd-cloudinit-installer is the VM image maker, it transforms a VM into a OpenStack VM image.

Install FreeBSD via virt-manager

First you'll have to install a normal FreeBSD (version 9.2 and 10.0 are tested) VM via virt-manager or similiar tools.

Before booting into the installation CD, configure the VM's disk and network to use VIRTIO. Since FreeBSD 9.2 it should be able to detect it correctly.

The virtual disk size should be as small as possible, so it'll be quicker to deploy and upload. FreeBSD requires root partition to be at least 1GB, so you should create a virtual disk slightly larger than 1GB. (We use 1.1GB in our released experimental images.)

The root partition must be the last partition on the disk, so that bsd-cloudinit could grow the partition on first boot.

There should be no need for SWAP. (there is no SWAP in the official Ubuntu cloud images either) But if you want SWAP, always make sure / is on the last partition.

After installation completes, do the following actions as root to prepare the VM for transformation.

VIRTIO

If you installed on VIRTIO disk, there should be nothing to worry about. To make sure, disk names in /etc/fstab should be vtbd.

Output to OpenStack console log

echo 'console="comconsole,vidconsole"' >> /boot/loader.conf

Bootloader menu delay

echo 'autoboot_delay="1"' >> /boot/loader.conf

Download and execute bsd-cloudinit-installer

The installer will bootstrap PKGNG for you and install the following packages:

fetch https://raw.github.com/pellaeon/bsd-cloudinit-installer/master/installer.sh
chmod +x installer.sh
./installer.sh

After this step, the VM is no longer a normal VM and not suitable for use with virt-manager.

Follow instruction of the installer to clean command history.

Shutdown

shutdown -p now

After shutting down, the VM's virtual disk is ready to be deployed in OpenStack, just upload it to Glance

glance image-create --name "FreeBSD 9.2" --disk-format qcow2 \
 --container-format bare < freebsd-9.2-fls-cloudimage-v3.img

Then the image is ready to be deployed! Launch an instance to test it!

Planned Features

Changelog

Authors and Contributors

bsd-cloudinit is built by @pellaeon, @apua, @iblis17 from Information Technology Service Center of National Chiao Tung University in Taiwan.

This project is based on cloudbase-init, we share most of non-OS-specific code.

Donation

If you like our project, please consider sending Bitcoin to 17sei77Rt29wQ7cx4hqznQ2esMA49Fj9KQ