# virtual server set\_protocol doesn't work

**URL:** <https://community.f5.com/t/virtual-server-set-protocol-doesnt-work/39270>\
**Category:** Technical Forums\
**Tags:** icontrol, dev, devops\
**Created:** [June 25, 2009, 11:09pm UTC](https://community.f5.com/t/virtual-server-set-protocol-doesnt-work/39270 "2009-06-25T23:09:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lizhuh\_55036](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@lizhuh\_55036](https://community.f5.com/u/lizhuh_55036)\
**Post date:** [June 25, 2009, 11:09pm UTC](https://community.f5.com/t/virtual-server-set-protocol-doesnt-work/39270/1 "2009-06-25T23:09:31Z")

</div>

Hi,

From GUI, when protocol changes, the client profile changes accordingly.

However, if I do it through pyControl, no mattrer how I change the profiles first, set\_protocol always fails. Does anyone know how I can change virtual server’s protocol via pyControl?

Thanks.

---

<div class="post-metadata">

**Author:** ![L4L7\_53191](https://avatars.discourse-cdn.com/v4/letter/l/f475e1/32.png) [@L4L7\_53191](https://community.f5.com/u/L4L7_53191)\
**Post date:** [June 25, 2009, 11:54pm UTC](https://community.f5.com/t/virtual-server-set-protocol-doesnt-work/39270/2 "2009-06-25T23:54:44Z")

</div>

From the SDK you’ll see that we’ve got two arguments to this call:

1) ‘virtual\_servers’ - this tips you off that you’ll be passing a list of virtual server names. Anything plural in iControl is generally wrapped in a list. So far so good…

2) ‘protocols’ - another plural, so another list. But the SDK says that we need to pass in type “ProtocolType”, which in this case is simply a specific string value.

Putting it together, this works:

```tcl
In [5]: b.LocalLB_VirtualServer.set_protocol(virtual_servers = ['virtual_forward_test'], protocols = ['PROTOCOL_UDP'])

```

I successfully changed a virtual server of \*All Protocols to a UDP-only VS (confirmed via the GUI). To set it back, I just passed it ‘PROTOCOL\_ANY’ as defined in the SDK, and it worked.

I hope this helps!

-Matt

---

<div class="post-metadata">

**Author:** ![lizhuh\_55036](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@lizhuh\_55036](https://community.f5.com/u/lizhuh_55036)\
**Post date:** [June 30, 2009, 12:18am UTC](https://community.f5.com/t/virtual-server-set-protocol-doesnt-work/39270/3 "2009-06-30T00:18:45Z")

</div>

Matt,

I know that I need to use lists. I created a virtual server with name tcpvserver. Then changed protocol to ‘UDP’ from GUI.

Then I tried to do the following in a row. If I set the protocol to the current value (‘udp’), it works. Which proves the synmtax I used was correct. As soon as I change it to other protocol, it fails. I ran into same issue last week. I was not able to change the protocol.

vs.set\_protocol(virtual\_servers=[‘tcpvserver’], protocols=[‘PROTOCOL\_UDP’]) passes

vs.set\_protocol(virtual\_servers=[‘tcpvserver’], protocols=[‘PROTOCOL\_TCP’]) crashes.

vs.set\_protocol(virtual\_servers=[‘tcpvserver’], protocols=[‘PROTOCOL\_SCTP’])

Linda

---

<div class="post-metadata">

**Author:** ![L4L7\_53191](https://avatars.discourse-cdn.com/v4/letter/l/f475e1/32.png) [@L4L7\_53191](https://community.f5.com/u/L4L7_53191)\
**Post date:** [June 30, 2009, 1:09am UTC](https://community.f5.com/t/virtual-server-set-protocol-doesnt-work/39270/4 "2009-06-30T01:09:21Z")

</div>

I try to write responses in a way that may help others out as well, sorry if this was redundant information for you. Pasting code helps.

I would turn on debugging so you can see if an error is thrown on the BigIP side - I can’t replicate this (what version are you running?). Here is some info on enabling debugging on the system. Do this on a non-prod system if at all possible, as it’s verbose.

[http://devcentral.f5.com/Default.aspx?tabid=53&forumid=1&postid=2695&view=topic](http://devcentral.f5.com/Default.aspx?tabid=53&forumid=1&postid=2695&view=topic)

-Matt
