Thursday, February 7, 2013

Renaming F5 objects (in version 11)

You may have need to rename one or more objects in an F5 load balancer.  Unfortunately this cannot be accomplished through the GUI, but there is a way to do it on the F5 command line. You'll need a username that has access to the Unix command line (or what F5 calls the "Advanced Shell".



Once you've logged into the command line on the F5 system, change to the /config directory and edit the bigip.conf file using the pico command line editor.  (I suppose you could use vi too)



Make sure you understand the syntax in the configuration file before making any changes.  It's always a good idea to take a backup of the configuration file first.

Search for the name of the object that you want to rename.  Make sure to search for every occurrence of the object's name and replace it with the new name, otherwise you'll break the configuration file.

If you're using partitions on your F5, your configuration is broken up into multiple bigip.conf files.  The common partition is contained in /config/bigip.conf.  The other bigip.conf files are in subdirectories in the /config/partitions directory.  You may need to edit these files too.



When search for the name of the of an object, do it just by the object name, not the partition name.  You may notice that most object references have a partition name in front and be tempted to include the partition name (i.e. "/Windows/mail.thepacketmaster.com_prod_https_activesync")  If you do this you may miss the object name if it's referenced in an iRule without the partition name.  Always search by the object name without the partition or preceding slashes (i.e."mail.thepacketmaster.com_prod_https_activesync")  By doing this, you'll find any references to pools in iRules (and anywhere else in the config)


Once you're done with the changes you should verify the configuration is okay before trying to load it.  Type: tmsh load sys config verify partitions all



If everything is okay, there won't be any error messages.  Otherwise, the verification process will spit out an "Unexpected error" message and indicate the issue.

When you've confirmed there are no issues anywhere, you can load the configuration by typing:
tmsh load sys config partitions all



Your configuration is now updated and running!

One piece of advice in naming objects.  While it may seem redundant, it is useful to use keywords that identify the object type in it's name.  For example use "pool", "virtual_server", "ssl_client_profile".  Otherwise, you might have a pool called "thepacketmaster.com_https", and a virtual server and ssl profile by the same name.  That's all fine, but if you ever need to edit things in the bigip.conf and you do a search, you'll be matching all these different types of objects when you may only be looking for one.  It will just mean you'll have to be careful to identify the object name you're editing.