Forum Discussion

vgeorge_113186's avatar
vgeorge_113186
Icon for Nimbostratus rankNimbostratus
Feb 07, 2012

creation of LocalLB::VirtualServer not reflecting in /config/*.conf files

I am creating a LocalLB::VirtualServer & it successfully created. I can see the newly created Virtual Server in the GUI. But I am unable to see the difference in /config/*.conf files.

 

 

Basically I want see what diff's are making the creation of a LocalLB virtualServer on configuration files. can somebody help me out. I am using Pycontrol & iControl APIs for doing the same. pasted the code below

 

 

 

!/bin/env python

 

 

import os

 

import time

 

import pycontrol.pycontrol as pycontrol

 

 

import util

 

 

Required SOAP namespace

 

WSDL = ['LocalLB.VirtualServer', 'LocalLB.VirtualAddressV2', 'System.ConfigSync', 'System.SystemInfo']

 

 

USER = 'admin'

 

PASS = 'infoblox'

 

HOST1 = '10.39.9.5'

 

 

b = pycontrol.BIGIP(hostname=HOST1, username=USER, password=PASS, fromurl=True, wsdls=WSDL, debug=False)

 

VERSION = b.System.SystemInfo.get_version()

 

 

v = b.LocalLB.VirtualServer

 

 

VIRTUAL_SVR_NAME = 'vs_11_11_11_11_53_gtm'

 

 

def Create_Virtual_Server():

 

b.LocalLB.VirtualServer.create(

 

vs_def = v.typefactory.create('Common.VirtualServerDefinition')

 

vs_def.name = VIRTUAL_SVR_NAME

 

vs_def.address = '11.11.11.11'

 

vs_def.port = 53

 

proto = v.typefactory.create('Common.ProtocolType')

 

vs_def.protocol = proto.PROTOCOL_UDP

 

vs_def_seq = v.typefactory.create('Common.VirtualServerSequence')

 

vs_def_seq.item = [vs_def]

 

context = v.typefactory.create('LocalLB.ProfileContextType')

 

prof = v.typefactory.create('LocalLB.VirtualServer.VirtualServerProfile')

 

prof.profile_context = context.PROFILE_CONTEXT_TYPE_ALL

 

prof.profile_name = 'udp_gtm_dns'

 

prof_dns= v.typefactory.create('LocalLB.VirtualServer.VirtualServerProfile')

 

prof_dns.profile_name = 'dns'

 

prof_seq = v.typefactory.create('LocalLB.VirtualServer.VirtualServerProfileSequence')

 

prof_seq.item = [prof, prof_dns ]

 

v.create(

 

definitions = vs_def_seq,

 

wildmasks=['255.255.255.255'],

 

resources=[[]],

 

profiles=[prof_seq] )

 

 

def main():

 

 

Create_Virtual_Server()

 

 

main()

 

 

  • iControl, by default, doesn't flush the configuration to disk (ie, /config/bigip.conf, bigip_base.conf). The reason is as simple in that it takes too long. If you have a large configuration, saving to disk can take seconds and when you are trying to make numerous API method calls, a couple seconds between calls can be very painful.

     

     

    When you are good with the changes you've made, you will have to call the System.ConfigSync.save_configuration() method to force a flush to disk.

     

     

    -Joe

     

  • So, uh, does it eventually flush it to disk, even if you don't do System.ConfigSync.save_configuration()? [That would seem to be our observation...] Slightly confused by your answer...
  • Hi mhite!

     

    No, one must do a System.ConfigSync.save_configuration() call to save the config change you've made.

     

    It is quite slow.
  • Posted By mhite on 02/07/2012 09:24 AM

     

    So, uh, does it eventually flush it to disk, even if you don't do System.ConfigSync.save_configuration()? [That would seem to be our observation...] Slightly confused by your answer...

     

    If you go into the GUI and make a change, it will then flush the running time configuration to disk on each page save. So, if you make iControl changes, and then someone changes a setting in the GUI, it will then get flushed to disk. But, if you are just modifying the config via iControl, then it shouldn't flush without you calling the save_configuration() method.

     

     

    -Joe

     

  • Posted By snovakov on 02/07/2012 09:39 AM

     

    Hi mhite!

     

    No, one must do a System.ConfigSync.save_configuration() call to save the config change you've made.

     

    It is quite slow, mostly because (as I found out the other day), the 'SaveMode' type that is listed as 'SAVE_HIGH_LEVEL_CONFIG' is not supported anymore, at least in the Perl version of iControl that I am using (10.2.0).

     

    I have to use the 'SAVE_FULL' mode, which can take quite long if the configuration is "large" on the F5 Big IP box you're targeting.

     

    I just checked the code for v10.2 and from what I can tell, System.ConfigSync.save_configuration() supports the SAVE_FULL, SAVE_HIGH_LEVEL_CONFIG, and SAVE_BASE_LEVEL_CONFIG parameters. For SAVE_HIGH_LEVEL_CONFIG, it will issue a "bigpipe save" command. For SAVE_BASE_LEVEL_CONFIG, it will issue a "bigpipe base save" command. For SAVE_FULL, it does some other calls to "bigpipe config save" with optional encryption parameters.

     

     

    For v11 and above, it uses the tmsh equivalents.

     

     

    Are you seeing errors when trying to run save_configuration() with SAVE_BASE_LEVEL_CONFIG?

     

     

    -Joe

     

  • Sorry, Joe.

     

    I believe I was confusing the configSync() method and the configSave() method:

     

     

    When I tried using a 'sync_flag' argument of 'CONFIGSTNC_BASIC', I got:

     

     

    SOAP-ENV:Server :Exception caught in System::urn:iControl:System/ConfigSync::synchronize_configuration() Exception: Common::OperationFailed primary_error_code : 16908289 (0x01020001) secondary_error_code : 0 error_string : Error synchronizing configuration: 012e0049:3: The requested command (config sync min) is no longer supported.

     

     

    ~ snovakov

     

     

  • Joe,

     

     

    Thanks for the informative posting on this.

     

    Doesn't the SAVE_FULL do a 'bigpipe config save all'?

     

     

    ~ snovakov

     

  • Yes, but there's a separate entry path if you call the save_encrypted_configuration() method where it append passphrase info.

     

     

    -Joe

     

  • I observed that System.ConfigSync.save_configuration() is works with v11 devices but it doesn't flush in the case of v10 devices. any info?