Forum Discussion
Johnmec_45780
Nimbostratus
Mar 30, 2005BIGIP remote config file transfer
Hi !
I hope this has not been asked already..
Is there any way to easily transfer and load bigip main config files (bigip_base.conf and bigip.conf) from a remote host? I mean a way to do it programmatically, using iControl and/or perhaps some other Perl module?
Thanks!
David
11 Replies
- David, The System::ConfigSync interface contains a method to do just this. Take a look at the download_file() and upload_file() methods.
FileTransferContext download_file( in String file_name, in long chunk_size, inout long file_offset ); void upload_file( in String file_name, in FileTransferContext file_context );
We also have the methods upload_configuration() and download_configuration() that are shortcuts for downloading the full configuration archives (*.ucs files).
As for sample code, you are in luck! Take a peek at the /sdk/samples/soap/perl/soaplite/System/ConfigSync.pl sample application. It illustrates most of the methods in the ConfigSync interface including the download_file() and upload_file() methods.
As for the bigip.conf file, if you run the script as follows
./ConfigSync.pl bigip_address 443 username password download_file /config/bigip.conf bigip.conf
it will download the bigip.conf file into the local directory.
-Joe - Loc_Pham_101863Historic F5 AccountI'd also add that while we do have methods to save the bigip.conf and bigip_base.conf (ConfigSync::save_configuration), and to transfer these configuration files (ConfigSync::download/upload_file), we don't have a method to actually load these configuration files individually, yet. :-(
We've added a new method (ConfigSync::load_configuration) to do just that in the next release, 9.2.0 (or whatever it'll be called).
For now, you'll have to save the configuration as an UCS archive using ConfigSync::save_configuration (SAVE_FULL), transfer the files using ConfigSync::download/upload_configuration, and then call ConfigSync::install_configuration to do this.
Regards,
Loc - Johnmec_45780
Nimbostratus
Thank you guys for all the info and the fast response!
I'll start trying those.
David - Johnmec_45780
Nimbostratus
Hi !
I have a problem. I tried uploading bigip_base.conf and other text files with $ConfigSync->upload_file following the code scheme given in iControl-9.0\sdk\samples\soap\perl\soaplite\System\ConfigSync.pl. I am running the script from a windows machine.
I managed to upload the files but when I edited them with vi I could only see numbers or character codes. I am afraid there is some problem with the binary format for the file or something weird happens in BIGIPs.
Debugging shows that the read bytes are correct right until the line in which $ConfigSync->upload_file is called. I am trying a similar piece of code to that used in upload() in iControl-9.0\sdk\samples\soap\perl\soaplite\System\ConfigSync.pl with the only difference of calling upload_file instead of upload_configuration (and the change for the parameter file_name.
Thanks,
David - Can you give the exact parameters you are passing? All the code does is send a base64 encoded version of the file data. We have verified that this works with text and binary based files as the content is preserved byte for byte (if you use the API properly). I'll post some sample code in a bit that illustrates the upload_file() and download_file() methods after I test it again with one of the bigip_base.conf files on my system.
-Joe - Darn those smilies! I've updated the previous post with corrected text so that the smilies don't show up.
-Joe - Johnmec_45780
Nimbostratus
Hi,
Thanks for the fast response. I am just trying with method identical to the uploadConfiguration method in the ConfigSync.pl sample script.
The only changes I have made is replacing the config_name named parameter by file_name (as the upload_file seems to require).
I also commented $file_data because I did not know what was the use for that line..
$file_data =
$FileTransferContext = { file_data => $file_data, chain_type => $chain_type };
$soap_response = $ConfigSync->upload_file
(
SOAP::Data->name(file_name => $remoteName),
SOAP::Data->name(file_context => $FileTransferContext)
SOAP::Data->name(file_data => $file_data),
SOAP::Data->name(chain_type => $chain_type)
);
Thanks
David - Sorry about that. I'll make sure the samples in the SDK get updated.
-Joe - Loc_Pham_101863Historic F5 AccountHi David,
9.2 will be the next major release, where this support has already been checked in.
We'll probably have a minor release some time before then to include hotfixes and such, so it's unlikely an enhancement is allowed in there. However, if you really, really need to have this before 9.2, please go to our Support to create a case for this, and we'll see what we can do.
Thanks,
Loc - MarkRidao_64126
Nimbostratus
All - quick question. What is the maximum file size that can be sent?
