on
23-Aug-2016
09:45
- edited on
05-Jun-2023
22:49
by
JimmyPackets
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.
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.
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.
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.
Once booted, the BIG-IP that I pre-create for you will have the following characteristics
admin/admin
.net1
and net2
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
.
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!