Forum Discussion

verlocs_96134's avatar
verlocs_96134
Icon for Nimbostratus rankNimbostratus
Aug 16, 2012

VirtualServer:add_profile cannot set a new client protocol profile

I've been writing a script that will need to replace the protocol profile (both server and client) on a large number of existing virtual servers.

 

 

I've found that when you attempt to add a server or client protocol profile to a virtual server that already has different ones specified, you get a duplicate entry error. Okay, so I script to first REMOVE the protocol profile, which was itself complicated as there's no "remove profile by type" command.

 

 

So I remove the existing protocol profiles from the virtual server, and attempt to add again, and boom, duplicate profile error.

 

 

When I removed the protocol profiles, F5 re-added the default protocol profile for the client protocol profile and the server protocol profile inherits the client.

 

 

 

As far as I'm aware right now, the only way in the API to alter the client protocol profile is to destroy the virtual server entirely and recreate it. But in the UI it's possible to change it. I know the value has to be SOMETHING at all times, it can't be empty, but there is no "set profile" for virtual server, only add and remove.

 

 

The api only gives me the ability to add and remove and yet it's adding the object I want to remove to replace in a subsequent add call.

 

 

4 Replies

  • The wrinkle I remember here is that the system internally adds a default profile when you delete the last profile on the VS. It sounds like that is what you are experiencing.

     

     

    If you have version 11 or later of BIG-IP, you could get around this problem by using a transaction: remove the profiles and add the ones you want, all in the same transaction. (We generally try not to require the use of transactions in the iControl interface, so we try and put in "convenience methods" that do all the stuff you'd put into the transaction, even if those methods are sometime regrettably complex, but we have not yet added replace methods to most of the interfaces in which they'd be appropriate.)
    • Prakash_Krishna's avatar
      Prakash_Krishna
      Icon for Nimbostratus rankNimbostratus
      Hi Todd and All, I tried with transactions also by putting "remove and add" profiles into the same transaction, even then getting same error.And i am following the same thing like "verlocs"(remove profile followed by add profiles) It helps me only in executing the subsequent commands when i get the error in add profile, but i just wanted to modify the protocols and profiles of a particular Virtual server. Do i have any other option to overcome this. Regards, Prakash.K
    • HankLiu_159320's avatar
      HankLiu_159320
      Icon for Nimbostratus rankNimbostratus
      Hello! Just checking if you ever found a solution to this? I'm running into the same problem.
    • Dhana_02_288024's avatar
      Dhana_02_288024
      Icon for Nimbostratus rankNimbostratus

      I am running in to the same problem, After running remove and add I am getting the duplicate entry.

       

      If any one know the solution please post it.