Using packer.io to build your own BIG-IP Vagrant boxes
I've been using Hashicorp's toolchain for some time now, and in the past I've posted articles about building Vagrant boxes using the BIG-IP OVA image. Since then, I've done a bit more work on the topic for the python SDK we're working on, and from that worked spawned a more complete set of packer files.
Packer, if you're not aware, is a tool from Hashicorp that can be used to build machine images for a variety of platforms. My interests lie in using it to create Vagrant images of BIG-IP so that I can spin instances up and down as needed to develop tools that integrate with BIG-IP.
What I've done is put together a set of packer templates that one can use for creating their own BIG-IP boxes.
The difference between these templates and the earlier OVA examples that I posted is that, IMHO, these templates are more "pure". They use the ISOs of BIG-IP instead of the OVAs and, therefore, allow you to customize the image to a degree that is not possible with the OVAs. For example, the OVAs that work are limited to a single disk (our problem or Virtualbox's problem, but regardless). You may have a need for more than that for some wacky reason.
The templates repo above also has more versions of BIG-IP than I was capable of posting here in a code snippet. I've included the tools necessary to get things "vagrant-ized" as well. The remaining limitation on these images is that you cannot install Virtualbox guest additions. I'll post a follow-up article here in the future on the Vagrantfiles we have to make use of these boxes.
If you'll check out the above Github repo, you'll see some neat stuff.
- Versions from 11.5.4 to infinity...AND BEYOND!
- Hotfix versions baked in to a single image...so no more manually installing hotfixes
- New versions when they're made publicly available
- How me, myself, and I would customize a BIG-IP for use in another tool like this
This repo needed to see the light of day. It's one of those burning questions that I myself would keep stumbling over on a variety of forums; ours and Virtualboxes included. "How do I do X with BIG-IP in Y?".
So how do I use it?
The easiest way to get started is to clone the contents of the Github repository to a local machine, and then make sure that you have packer and Virtualbox installed.
Afterwards, change into any of the directories of your choice and take a look at the contained README.md file.
Each file contains instructions on how to get going. In a nutshell it boils down to
- Download your BIG-IP ISO images from downloads.f5.com
- Put them in the
directory of your template of choicesoftware/
- Run
packer build template.json
- Sit back and drink coffee
The builds can take some time depending on the beastly-ness of your computer. Figure that you'll need at least 4Gig of RAM available just for BIG-IP. After the process finishes running though, you should have a fancy new Vagrant box sitting in your template directoy. You can
vagrant up
this file into VE goodness.
Some extra thoughts
I hope the above repo provides enough guidance to fellow tech enthusiasts to get creative with BIG-IP in a ABSOLUTELY UNSUPPORTED kind of way... 😛
You're going to run into some issues that, at the time of this writing, are a "way of life" for VE images. Namely, the issue of licensing. Our licensing model for VE is not conducive (AFAIK) to the development model of "livestock vs pets". Especially in the Vagrant world where you routinely start and destroy instances left and right.
A thought I had on that particular issue is the use of iWorkflow for license pools. I don't actually know if this is possible, but I think it's likely to work?? If not that route, then I am not sure to what extent we plan to sell recycleable-like licenses for development purposes. That's not my area of expertise so consider this just me speaking out loud.
In conclusion
In any event, go forth and check it out if it piques your interest. If you liked this article and want to see more like it, lemme know in the comments. We use this method to develop the F5 Python SDK. Also, drop by their repo and file feature requests and issues. We're a loosely knit group of engineers with a common passion for building useful tools.
Enjoy!
- Thomas_A__McGonHistoric F5 Account
Hi New SE here. Glad to see Vagrant and VirtualBox on DevCentral. Long time user of both. I am afraid I am running into some trouble.
The cleanup.sh script were you do the dd's error'd out with the following error message: virtualbox-iso: dd: error writing ‘/EMPTY’: No space left on device I found a packer article that said to add | true to the end of the dd lines, but that didn't help: dd if=/dev/zero of=/EMPTY bs=1M | true
I have since commented out the dd lines, but I am still unable to build a vagrant box. I can run through the build, but am getting the following error at the last stage: ==> Some builds didn't complete successfully and had errors: --> BIGIP-12.1.1.0.0.184: Timeout while waiting for machine to shut down.
I would love to use Vagrant and VirtualBox, any recommendations on how I might proceed.