TMSH config for a specific server

Is there a way to get the TMSH configuration for a specific virtual server in one command? So all the node, pool, monitor statements included as well. The idea is to be able to quickly ‘clone’ a vs config this way for use in our testing environment.

The way I do it now is saving an SCF file, copy/pasting the required config elements to a text file, making the required modifications for testing purposes, and then uploading that configuration to the LTM. Because this starts with a full config file, this is not hard, but as these bits are all over the config file there’s a good chance of missing things.

I think there is no single cmd, but I guess you can build a sequence a tmsh cmds which can be executed sequentially and repeatedly. Not sure if it’s better than your current option of loading the full config

for eg: build pools, then VS

tmsh create ltm pool test_pool { members add { 10.10.10.10:443 { address 10.10.10.10 } } } 

tmsh create ltm virtual test_vs { destination 20.20.20.20:https ip-protocol tcp mask 255.255.255.255 profiles add { http {} } pool test_pool }

Maybe you can use tmsh scripting? Haven’t worked with them myself but it might be useful in your case.

Jason Rahm’s article about tmsh scripts

Otherwise I’d suggest writing a shell script that invokes the appropriate tmsh commands.

One other thought, you could string Kunjan’s commands together with the ; operator if one-line is a must.

tmsh create ltm pool testPool ; tmsh create ltm virtual testVip pool testPool

 tmsh list ltm pool testPool ; tmsh list ltm virtual testVip
ltm pool testPool { }
ltm virtual testVip {
    destination 0.0.0.0:any
    mask any
    pool testPool
    profiles {
        fastL4 { }
    }
    source 0.0.0.0/0
    translate-address disabled
    translate-port disabled
    vlans-disabled
}

Kevin

Update on this: I talked to our F5 rep about this, and there is currently no easy way of doing it, other than through a selective copy/paste of the main config.

Have you considered using iApps?