Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Is .ucs file editable, if so how to compress it back ??

We copied the .ucs file from one 6900 machine to another lab 6900 machine. The changes we see are that of the License and the Registration key... now if we want to replicate just the configuration is it possible... one thing we did was we extracted one of the ucs file and then changed the details of the registrationkey file  and the bigip.license file in the /config folder of the extracted .ucs. How to compress it back and use this file....
3
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
It's a gzipped tar file... Should be simply...

1. Create a directory to old the contents of the archive
mkdir ucs

2. Change to the new ucs directory
cd ucs

3. extract the files from the archive
# gzip -dc /full/path/to/whatever.ucs | tar xvpf -

2. Edit whichever files you want...

3. Create a new ucs file
# tar cvf - * | gzip -c > /full/path/to/whatever_new.ucs


Note.
* The ucs directory is empty, so when/if the ucs file contents change, this method will still work (Because it'll all be relative to this new empty directory).

H
3
Comments on this Answer
Comment made 09-Mar-2015 by Stephan Manthey 3793
Hi Hamish, thanks for summarizing this (+1). As I´m not sure how relevant the tarball name is I would like to add an option to retain it. The name of the tarball in the zipped file starts with "configsync-" and has the extension ".im". The name can be retrieved i.e. as follows: gzip -N -l ../tobemodded.ucs | awk 'END {print $NF}' This will return i.e. "configsync-2.0-1-Linux-2.6.32279.19.1.6.5.8664.im" So for step #5 (after modifications) we can split it up to (sticking to the example): tar -cvf configsync-2.0-1-Linux-2.6.32279.19.1.6.5.8664.im * gzip -c < configsync-2.0-1-Linux-2.6.32279.19.1.6.5.8664.im > modded001.ucs For cross-plattform migrations it may be necessary to replace the license file and to use the no-platform-check option: tmsh load sys ucs modded001.ucs no-platform-check Thanks, Stephan PS: In case you are using an external editor to modify configuration files you need to make sure it will save the files in UNIX file format.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Should simply be an archive. Try zipping it up with winzip/winrar and changing the file extension to .ucs.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
As Chris said, a UCS is a tar archive, but I've had difficulties in the past trying to edit a file and rebuild the UCS archive. If you try it and it doesn't work, you could potentially use a single configuration file instead.

Keep in mind that if you copy a UCS from one unit to another with a different host name, only the shared configuration will be loaded during a 'b config install'. So the existing license and bigip_base.conf would be preserved. This should be a cleaner solution than manually editing the UCS files.

Aaron
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
I will try this and thanks guys for your replies.. very informative
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Sorry for my late reply which probably makes this post defunct, I have to agree with Hoolio, I too have had problems recompressing a .ucs archive and getting it to load back to the BigIP. The SCF is a good idea, but if you do want to work with the UCS, I normally take the approach of modifying the individual files (bigip.conf or whatever) and copying these back to the /config folder.

Then do a 'b verify load' - if any errors with the file we just copied over check the syntax, otherwise 'b load' to get the config running. Job done.

Chris
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
hey there, I want to use a ucs file as i'm using a GTM in the lab and want to populate the wide ip conf info from a prod box (as well as all its other config and an SCF won't give me the wide ip details).

re your suggestion of editing the conf files. Do you do this on a production box? I don't quite get how you pull this off on a live box.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Couldn't you just copy in the new wideip.conf and it will get synched to the other members of the group as the timestamp is newer?

Aaron
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I just want to say (Resurecting this post from the dead)

Hamish's method worked for an issue we were facing where somehow the ucs contained

pool and snatpool config (Bad practice by a previous engineer) that was named the same.

This method allowed me to edit the bigip.conf file and rezip it.

0