Forum Discussion

Horacio_36739's avatar
Horacio_36739
Icon for Nimbostratus rankNimbostratus
Aug 16, 2013

Change Virtual Server Profile

Hi!,

 

I'm trying to change the Http profile on a group of virtual servers using the icontrol snapin for powershell, but when i keep getting errors here is my code

 

$http_profile = New-Object iControl.LocalLBVirtualServerVirtualServerProfile $http_profile.profile_name = $profileName $http_profile.profile_context = "PROFILE_CONTEXT_TYPE_ALL" $http_profile = (,$http_profile)

 

(Get-F5.iControl).LocalLBVirtualServer.add_profile($VirtualServer,$http_profile)

 

When i execute this code i get the following error ..

 

"Exception caught in LocalLB::urn:iControl:LocalLB/VirtualServer::add_profile() Exception: Common::OperationFailed primary_error_code : 17236119 (0x01070097) secondary_error_code : 0 error_string : 01070097:3: Virtual server www.devstage1.test.com_https lists duplicate profiles."

 

Does anyone have any idea? or knows the correct way to perform this task?

 

Thanks,

 

Horacio

 

  • Hi Horacio,

     

    Sounds like a similar problem that you can run into when using TMSH. It will allow you to add a profile (making two profiles), but you must follow it up by removing the existing profile leaving only the "new" profile applied to the Virtual Server.

     

    I would suggest detecting what is there first, add your new profile, and then remove the existing/old profile to see if it clears up your issue since there is no "replace" option.

     

    Problematically it makes sense because some features (like cookie persistence and iRules (for the most part) require an HTTP Profile be applied to a Virtual Server.

     

    I'll have to try this out myself when I have time, but please let us know what your results are if you test the theory.

     

    Hope this helps.

     

  • Hi Horacio,

     

    Sounds like a similar problem that you can run into when using TMSH. It will allow you to add a profile (making two profiles), but you must follow it up by removing the existing profile leaving only the "new" profile applied to the Virtual Server.

     

    I would suggest detecting what is there first, add your new profile, and then remove the existing/old profile to see if it clears up your issue since there is no "replace" option.

     

    Problematically it makes sense because some features (like cookie persistence and iRules (for the most part) require an HTTP Profile be applied to a Virtual Server.

     

    I'll have to try this out myself when I have time, but please let us know what your results are if you test the theory.

     

    Hope this helps.

     

  • I encountered this on 13.1.1.4, when working with a virtual server. Removing the persistence profile, updating (and reloading the config from tmsh for good measure) worked. Then readding teh profile the same way (TMUI) and updating and reloading the config loaded as expected..