Forum Discussion

jan_de_wachter_'s avatar
jan_de_wachter_
Icon for Nimbostratus rankNimbostratus
Sep 26, 2016

Changing a LTM policy using iApp (or tmsh) in version 12.1

We are installing V12.1 on our F5 but have the folowwing problem. How can we change LTM policies (add rule to a policy) using a sel-written iApp.

 

We are running VCMP with multiple guests which have multiple partitions.

 

The way for treating policies has changed. A policy mus be in Draft status to be changed, and after having changed it must be published.

 

The problem we have is that we can't create a copy in draft from the published library using tmsh commands (using the guy it works, but we need our iApp to create VSes following our standard).

 

We want to modify the policy tst-infrabel-.NE in partition Infrabel

 

create ltm policy /Infrabel/Drafts/tst-infrabel-.NET create-draft gives error: 01070734:3: Configuration error: Can't associate Policy (/Infrabel/Drafts/Drafts/tst-infrabel-.NET) folder does not exist

 

create ltm policy /Infrabel/tst-infrabel-.NET create-draft gives error: 01020066:3: The requested Policy (/Infrabel/tst-infrabel-.NET) already exists in partition Infrabel.

 

create ltm policy tst-infrabel-.NET create-draft gives error:01020066:3: The requested Policy (/Infrabel/tst-infrabel-.NET) already exists in partition Infrabel.

 

What do I miss here?

 

  • Hi Jan, if you use the "legacy" parameter in your tmsh command, it will use the pre-12.1 syntax. You shouldn't need to specify a drafts folder.

     

    thanks

     

    Mike

     

  • mikeshimkus_111's avatar
    mikeshimkus_111
    Historic F5 Account

    Hi Jan, if you use the "legacy" parameter in your tmsh command, it will use the pre-12.1 syntax. You shouldn't need to specify a drafts folder.

     

    thanks

     

    Mike

     

    • jan_de_wachter_'s avatar
      jan_de_wachter_
      Icon for Nimbostratus rankNimbostratus

      Mike, Thanks. I added the legacy keyword, and indeed it works!

       

      if {$Version_v12 == "1"} { set vpol "ltm policy /Infrabel/$::new__env$vpol1 { legacy rules add { $vapp { actions add { $vrule } conditions add { 0 { http-host values { $vapp } } } ordinal 1 } } }" }

       

      tmsh::create $vpol

       

      Thanks a lot, it works fine, but it stays a work-around.

       

      In my opinion, the 12.1 way should be working also:

       

      -create draft from published policy

       

      -modify draft

       

      -publish draft

       

      Jan