Forum Discussion
Setting VLAN on a virtual server
Pulling my hair out trying to enable a VLAN for a virtual server. This is what I'm doing -- "v" is the object reference to LocalLB.VirtualServer:
vlan_filter_list = v.typefactory.create('Common.VLANFilterList')
enabled_state = v.typefactory.create('Common.EnabledState')
vlan_filter_list.state = enabled_state.STATE_ENABLED
vlan_filter_list.vlans = ["external"]
v.set_vlan([vip_name], [vlan_filter_list])
Unfortunately, it throws an exception:
xml.sax._exceptions.SAXParseException: :1:49: syntax error
Any ideas? I'm pretty stuck. :(
- L4L7_53191NimbostratusI don't see anything that stands out actually, aside from that you've left off the kwargs - I put this in and it works (pretty much a copy/paste of your code above):
- mhite_60883CirrocumulusHi Matt,
cowboy:vip_provision mhite$ python Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import vip_provision >>> import pycontrol.pycontrol as pc >>> b = pc.BIGIP(hostname="s0-bigip-lb2", username="tuna", password="slurpee", wsdls=['LocalLB.VirtualServer'], fromurl=True, debug=True) >>> v = b.LocalLB.VirtualServer >>> vip_provision.set_active_partition("s0-bigip-lb2", "tuna", "slurpee", "tuna") DEBUG:suds.client:sending to (https://s0-bigip-lb2/iControl/iControlPortal.cgi) message: tuna DEBUG:suds.client:headers = {'SOAPAction': u'"urn:iControl:Management/Partition"', 'Content-Type': 'text/xml'} DEBUG:suds.client:http succeeded: >>> v.get_vlan(["tuna-devasdfsao2o-tcp-80-s0-bigip-lb2-vs"]) DEBUG:suds.client:sending to (https://s0-bigip-lb2/iControl/iControlPortal.cgi) message: tuna-devasdfsao2o-tcp-80-s0-bigip-lb2-vs DEBUG:suds.client:headers = {'SOAPAction': u'"urn:iControl:LocalLB/VirtualServer"', 'Content-Type': 'text/xml'} DEBUG:suds.client:http succeeded: STATE_DISABLED [(Common.VLANFilterList){ state = "STATE_DISABLED" vlans[] = }] >>> vlan_filter_list = v.typefactory.create('Common.VLANFilterList') >>> enabled_state = v.typefactory.create('Common.EnabledState') >>> vlan_filter_list.vlans = ["external"] >>> vlan_filter_list.state = enabled_state.STATE_ENABLED >>> v.set_vlan(virtual_servers = ["tuna-devasdfsao2o-tcp-80-s0-bigip-lb2-vs"], vlans = [vlan_filter_list]) DEBUG:suds.client:sending to (https://s0-bigip-lb2/iControl/iControlPortal.cgi) message: tuna-devasdfsao2o-tcp-80-s0-bigip-lb2-vs STATE_ENABLED external DEBUG:suds.client:headers = {'SOAPAction': u'"urn:iControl:LocalLB/VirtualServer"', 'Content-Type': 'text/xml'} ERROR:suds.client: tuna-devasdfsao2o-tcp-80-s0-bigip-lb2-vs STATE_ENABLED external DEBUG:suds.client:http failed: 500 Internal Server Error Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, support@f5.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache Server at s0-bigip-lb2 Port 443 Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.6/site-packages/suds/client.py", line 539, in __call__ return client.invoke(args, kwargs) File "/Library/Python/2.6/site-packages/suds/client.py", line 598, in invoke result = self.send(msg) File "/Library/Python/2.6/site-packages/suds/client.py", line 633, in send result = self.failed(binding, e) File "/Library/Python/2.6/site-packages/suds/client.py", line 684, in failed r, p = binding.get_fault(reply) File "/Library/Python/2.6/site-packages/suds/bindings/binding.py", line 231, in get_fault faultroot = sax.parse(string=reply) File "/Library/Python/2.6/site-packages/suds/sax/parser.py", line 136, in parse sax.parse(source) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/expatreader.py", line 211, in feed self._err_handler.fatalError(exc) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/handler.py", line 38, in fatalError raise exception xml.sax._exceptions.SAXParseException: :1:49: syntax error >>>
def set_active_partition(ltm, user, pw, partition): """Switch a user's management context to a specific partition. Uses the F5 API to switch a user's management context to a specific partition. Args: ltm: IP address or hostname or BIG-IP; for example, 10.10.10.5. user: Username used to authenticate to the BIG-IP device. pw: Password credentials used to authenticate to the BIG-IP device. partition: Management context for user's subsequent API calls. Returns: n/a Raises: n/a """ p = pc.BIGIP(hostname=ltm, username=user, password=pw, wsdls=['Management.Partition'], fromurl=True) p.Management.Partition.set_active_partition(partition)
- mhite_60883CirrocumulusSo I guess the F5 is falling over?
- L4L7_53191NimbostratusI don't see evidence of a failover here; you'd have to confirm that on the system. So here's an almost literal copy paste, minus your provision stuff (don't have time to test that at the moment):
- mhite_60883CirrocumulusSorry, I meant "falling over," ie. crashing, vs. "failing over."
[root@s0-bigip-lb2:Active] log zgrep -B1 SOAP ltm.1.gz Mar 31 22:26:20 local/s0-bigip-lb2 debug iControlPortal.cgi[17614]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 22:26:20 local/s0-bigip-lb2 debug iControlPortal.cgi[10274]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 22:28:25 local/s0-bigip-lb2 debug iControlPortal.cgi[10274]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 22:28:25 local/s0-bigip-lb2 debug iControlPortal.cgi[10277]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 22:34:18 local/s0-bigip-lb2 debug iControlPortal.cgi[10277]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 22:34:18 local/s0-bigip-lb2 debug iControlPortal.cgi[10305]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 22:35:19 local/s0-bigip-lb2 debug iControlPortal.cgi[10305]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 22:35:19 local/s0-bigip-lb2 debug iControlPortal.cgi[10306]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 22:40:03 local/s0-bigip-lb2 debug iControlPortal.cgi[10306]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 22:40:03 local/s0-bigip-lb2 debug iControlPortal.cgi[10313]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 22:57:41 local/s0-bigip-lb2 debug iControlPortal.cgi[10313]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 22:57:41 local/s0-bigip-lb2 debug iControlPortal.cgi[10330]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 23:11:01 local/s0-bigip-lb2 debug iControlPortal.cgi[10330]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 23:11:01 local/s0-bigip-lb2 debug iControlPortal.cgi[10425]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 23:20:08 local/s0-bigip-lb2 debug iControlPortal.cgi[10425]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 23:20:08 local/s0-bigip-lb2 debug iControlPortal.cgi[10436]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 23:27:01 local/s0-bigip-lb2 debug iControlPortal.cgi[10436]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 23:27:01 local/s0-bigip-lb2 debug iControlPortal.cgi[10445]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 23:27:05 local/s0-bigip-lb2 debug iControlPortal.cgi[10445]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 23:37:01 local/s0-bigip-lb2 debug iControlPortal.cgi[10477]: icontrol_portal:iControl SOAP Portal starting ... -- Mar 31 23:45:13 local/s0-bigip-lb2 debug iControlPortal.cgi[10477]: LocalLB:VirtualServer::set_vlan ( ) called by user "fish" Mar 31 23:45:13 local/s0-bigip-lb2 debug iControlPortal.cgi[10486]: icontrol_portal:iControl SOAP Portal starting ... Tried restarting Apache. Also tried it on another load balancer. No luck. üòû What version of the BIG-IP o/s are you using in your tests? What model LB?
- mhite_60883CirrocumulusWe also see this in the logs:
- L4L7_53191NimbostratusQuestion: do you see this on *all* of the systems you're running against? That would be a useful bit of data. Either way I'd open a case on this - a segfault isn't normal behavior at all with the iControl portal app. One thing you may do to help with the case is to enable debugging on the BigIP, which will hopefully help shed light on what is going on. But open a case either way. I'm testing on a 3900 with 10.2.1 by the way.
- mhite_60883CirrocumulusHi L4L7 Matt,
- L4L7_53191NimbostratusThat's very odd, as I've seen several tickets related to iControl come in over the years. I would re-open this, and cite fast_cgi crashes (as opposed to iControl calls) as the reason for the ticket. Open it via web support and send the case number over to this thread if you don't mind.
- hooleylistCirrostratusIf it's a potential bug in iControl, then F5 Support should open a case and try to diagnose the issue. If you have a case number to reference I can try to explain this to the support engineer.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com