Vagrantfiles for BIG-IP

This article is a follow-up to the previous article I posted about using packer.io to build BIG-IP images. In the previous article, we built a custom image in BIG-IP. You may have added spice to the default packer template I provided, or not. Either way, now you're interested in booting it up in Vagrant. That's what this article will cover.

Requirements

There are a couple of tools that you'll need to have installed before continuing. They are

With these tools installed, the next thing you will need is a copy of the various F5 Vagrantfiles that I have put together. You can find these files in the Github repo here

Additionally, you'll need a license to use during startup of said BIG-IP.

Booting a VM

Vagrant provides you with the ability to create reproducible development environments. So, with that in mind, the BIG-IPs that we instantiate here are only relevant for development purposes. I use them for the Python f5-sdk as well as the Ansible modules. With Vagrant and Virtualbox, I can snapshot my VMs before I turf them. This is super handy and a major time saver when you're in the thick of it debugging some new integration with BIG-IP. I'll frequently get my BIG-IP in a situation where it is easier to just restore a snapshot than delete the whole thing, re-build it, etc etc. Such a waste of time!

So let's open up a CLI and change to any of the given directories that come in the

f5-vagrant-files
repo. We'll use bigip-12.1.0 for the sake of argument.

$> cd bigip-12.1.0

Now, I am assuming here that you have already done the grunt work of using our packer templates to create a Vagrant box for yourself. With this box in hand, you have two choices.

  1. Copy/move the box into the current working directory
  2. Change the
    v.vm.box
    line to point to some other location (on disk, a URL, etc)

We'll just use a local copy on disk. I'll leave the other forms as an exercise for the user.

The Vagrantfile, by default, looks for the Vagrant box in our current working directory, so let's put it there if you have not yet done that.

$> ls
BIGIP-12.1.0.0.0.1434.box       README.md          Vagrantfile

Ok, with that out of the way, and our license key in hand, we can boot up an instance of the BIG-IP with vagrant using the following command. Note that I am going to use the super-secret-squirrel-developer license key

xxxx-xxxx-xxxx-xxxx-xxxxxxx
to boot mine because that's what super-secret-squirrel-developers do. Replace my key with your key.

$> BIGIP_LICENSE=xxxx-xxxx-xxxx-xxxx-xxxxxxx vagrant up

That one command is all that is necessary to bring up the BIG-IP.

So what do I get?

Once booted, the BIG-IP that I pre-create for you will have the following characteristics

  1. Web UI accessible on https://localhost:10443 with the default credentials
    admin/admin
    .
  2. The Setup utility will have been disabled, so you'll land right in the familiar BIG-IP UI
  3. Two interfaces for connecting things.
    1. The first has IP address 10.2.2.2/24
    2. The second has IP address 10.2.3.2/24
  4. Two VLANs on those 2 interfaces, named
    net1
    and
    net2
  5. 4 gig of RAM allocated to the device
  6. 2 CPUs
  7. No shared volume mounted. This is a limitation of BIG-IP since it does not come with the developer tools needed to install the Virtualbox Guest Additions (gcc, kernel headers, etc).

Additionally, you can use

vagrant ssh
to connect to it, or open the Virtualbox UI and connect directly to the console with the insecure credentials
root/default
.

Conclusion

By now you should have a good idea of how to connect to your BIG-IP and do "stuff" with it. The sort of "stuff" I do is related to integrations, and so I only ever use this form of BIG-IP as a development tool. It would likely be a bad idea to use this form of kicking a BIG-IP to roll something out to production.

If you do not want to repeatedly provide a license key, you can set the Vagrantfile's

BIGIP_LICENSE
variable that you see at the top to be your key. One would frown upon this method though, unless one could guarantee that that Vagrantfile would never leave your organization. Doing so might expose your license key to unwanted parties.

Hope that helps you roll out a BIG-IP easier!

Updated Jun 06, 2023
Version 2.0

Was this article helpful?

No CommentsBe the first to comment