Forum Discussion

Miguel_03_15449's avatar
Miguel_03_15449
Icon for Nimbostratus rankNimbostratus
May 18, 2014

Ruby IControl SOAP::FaultError - virtual server profile already exists in partition

Hello,

 

First time posting so I hope I can get some help on this. I'm trying to write a basic ruby script to create a Virtual Server and i'm running into this error:

Exception caught in LocalLB::urn:iControl:LocalLB/VirtualServer::create() (SOAP::FaultError) Exception: Common::OperationFailed primary_error_code : 16908390 (0x01020066) secondary_error_code : 0 error_string : 01020066:3: The requested virtual server profile (/test/test2vip.my.domain ) already exists in partition test.

 

My code basically looks like this:

 

--snip--

 

vipDefinition = [ { 'name' => virtual_server_name, 'address' => virtual_server_address, 'port' => virtual_server_port, 'protocol' => virtual_server_protocol } ]

 

wildmasks = [ '255.255.255.255' ]

 

resources = [ {'type' => 'RESOURCE_TYPE_POOL' } ]

 

vsprofile = [ { 'profile_type' => 'PROFILE_TYPE_TCP' , 'profile_context' => 'PROFILE_CONTEXT_TYPE_ALL', 'profile_name' => 'tcp' } ]

 

f5 = F5::IControl.new(bigip_address,bigip_user,bigip_pass,['Management.Folder','System.Session','LocalLB.VirtualServer']).get_interfaces

 

f5['LocalLB.VirtualServer'].create(vipDefinition,wildmasks,resources,vsprofile)

 

--snip--

 

If i set the profile definition to simply vsprofile = [ {'profile_type' => 'PROFILE_TYPE_TCP' } ] then the error it produces is "The requested profile (/test/) was not found."

 

I have tried all variation of the profile definition but I can't get the device to create the virtual server. I have tried different names, creating it under the /Common/ partition and the result is the same.

 

I'm clearly doing something wrong with the virtual server profile. Can someone please help me understand this?

 

Thank you

 

6 Replies

  • It would seem like it but I'm completely sure the virtual server doesnt exist. I checked manually using tmsh and the webui doesn't show it listed either.

     

    It's definitely not created. I also deleted the partition entirely and recreated it but the result is the same.

     

  • OK. Perhaps something to do with the possibility you're not specifying a partition? Can't see you creating/assigning a Pool either but perhaps both are just outside your snippet?

     

  • Thanks for your reply Yes, I'm setting the default partition just before this snippet:

     

    f5['System.Session'].set_active_folder('/test/')

     

    I'm not creating a pool but have experimented with the default_pool_name value as "None" (in resources) which my other virtual servers are currently using.

     

    I believe the problem i have is with my profile definition or my understanding of it. Can I assign a profile outside of my working partition? /Common/tcp for example?

     

    Also, do you know what the most basic profile i can assign is? I just want to get a vs created and work my way from there. I'm stuck.

     

  • I figured it out with help from having to explain this to an extra set of eyeballs.

     

    The definition for vsprofile i was using was incorrect. I'm still not totally clear on the values but this has gotten me passed this hangup.

     

    I set this it this way originally: vsprofile = [ { key = values} ] but it should be vsprofile = [ [ { key = value } ] ]. It requires an array of arrays of hashes, not just an array of hashes.

     

    A working vsprofile definition:

     

    vsprofile = [ [ { 'profile_context' => 'PROFILE_CONTEXT_TYPE_SERVER', 'profile_name' => 'tcp-lan-optimized' }, { 'profile_context' => 'PROFILE_CONTEXT_TYPE_CLIENT', 'profile_name' => 'tcp' } ] ]

     

    Why it gives that profile already exist error is beyond me.

     

    Thanks!