Forum Discussion

PatrickSF_14757's avatar
PatrickSF_14757
Icon for Nimbostratus rankNimbostratus
Sep 15, 2014

tmsh to bigsuds - virtual server - associate a vlan and assign a persistence profile

Hi all

 

I've successfully ported tmsh LTM Pool creation statements to bigsuds, but partly succeeded for virtuals

 

I'm working with different bippipe versions but have only tested the following code on v10.2.4...

 

['BIG-IP_v10.2.4'] ['BIG-IP_v10.2.2'] ['BIG-IP_v11.2.1']

 

So, after a successful Virtual creation on all these bigpipe versions (has the expected pool member), I still cannot

 

  • assign/associate to an existing vlan
  • assign an existing persistence profile as default (no failback)
  • create a SNAT pool (how?)

Example tmsh statements I'm working to port to icontrol/bigsuds

 

1.

 

tmsh create /ltm virtual MY_VIRTUAL { destination 1.2.3.4:https pool MYPOOL vlans add { External Internal } vlans-enabled profiles add { tcp } persist replace-all-with { source_addr } fallback-persistence none }
  • corresponding code:
obj.LocalLB.VirtualServer.create(
   definitions = [{'name': [virtualname], 'address': [address], 'port': [port], 'protocol': 'PROTOCOL_TCP'}],
   wildmasks = ['255.255.255.255'],
   resources = [{'type': 'RESOURCE_TYPE_POOL', 'default_pool_name': [member_pool]}],
   profiles = [[{'profile_context': 'PROFILE_CONTEXT_TYPE_ALL', 'profile_name': 'tcp'}]])

** set_vlan: does not work

 

obj.LocalLB.VirtualServer.set_vlan( virtual_servers = [virtualname], vlans = [vlans] )

errors with

 

"Internal" is not a valid value for Common.VLANFilterList, expecting: state, vlans

** persistence: does not work:

 

b.LocalLB.VirtualServer.add_persistence_profile( virtual_servers = [virtualname], profiles = [[ {'profile_name': 'source_addr_SR', 'default_profile': 'true'} ]] )
  1. At a loss for SNAT pool creation (on terms of where to start)
tmsh create /ltm snat MY_SNAT_POOL translation 1.2.3.4 origins add { 5.6.7.8/32 } vlans-enabled vlans add { Internal }
tmsh modify /ltm snat-translation 1.2.3.4 { tcp-idle-timeout 300 udp-idle-timeout 300 ip-idle-timeout 300 }

Digging into this work is great and rewarding but sadly I'm getting dry...

 

Any help is greatly appreciated THks

 

Patrick

 

  • Managed to succeed in these areas soon after posting ... Sharing anyway, this might help someone down the road...

    • persistence : the string was missing the Partition prefix '/Common' ...
    b.LocalLB.VirtualServer.add_persistence_profile( virtual_servers = [virtualname], profiles = [[ {'profile_name': '/Common/source_addr', 'default_profile': 'true'} ]] )
    
    • set_vlans: had to fix / expand the vlans definition after a closer look at the API docs

    from

    obj.LocalLB.VirtualServer.set_vlan( virtual_servers = [virtualname], vlans = [vlans] )
    

    to

    obj.LocalLB.VirtualServer.set_vlan( virtual_servers = [virtualname], vlans = [{ 'state':'STATE_ENABLED', 'vlans':[vlans_list] }] )
    

    Note: vlans_list is picked up via the 'vlans' arg, a list of comma-separated vlans specified on the command line: I have set 2 vlans at once on this VS... Here is an excerpt of my create_vip function:

            vlans_list = []
            for vm in vlans.split(','):
                    vlans_list.append(vm)
    

    Almost there...

    What's left is to research around the snat pool creation

    v11: set_source_address_translation_snat_pool ? anything else?

    hopefully it's also v10 compat so I won't have to juggle between that and set_snat_pool (v9)...

    If you have examples to share, this is what I have to move from:

    tmsh create /ltm snat MY_SNAT_POOL translation 1.2.3.4 origins add { 5.6.7.8/32 } vlans-enabled vlans add { Internal }
    
    tmsh modify /ltm snat-translation 1.2.3.4 { tcp-idle-timeout 300 udp-idle-timeout 300 ip-idle-timeout 300 }
    

    Thks