Forum Discussion
mhite_60883
Apr 01, 2011Cirrocumulus
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.cr...
L4L7_53191
Apr 01, 2011Nimbostratus
I 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):
Showing code in the main post from now on - the new format is too hard to read IMO
In [51]: v.get_vlan(['irules-nextgen-demo'])
Out[51]:
[(Common.VLANFilterList){
state = "STATE_ENABLED"
vlans[] =
"vlan_21",
}]
In [54]: vlan_filter_list = v.typefactory.create('Common.VLANFilterList')
In [55]: enabled_state = v.typefactory.create('Common.EnabledState')
In [56]: vlan_filter_list.vlans = ['vlan_20']
In [57]: vlan_filter_list.state = enabled_state.STATE_ENABLED
In [59]: v.set_vlan(virtual_servers = ['irules-nextgen-demo'],vlans=[vlan_filter_list])
Check to see if it worked.
In [60]: v.get_vlan(['irules-nextgen-demo'])
Out[60]:
[(Common.VLANFilterList){
state = "STATE_ENABLED"
vlans[] =
"vlan_20",
}]
End code
Give that a try and post back. Also, you can set debug=True when you setup the object so it'll dump the request/response traffic. That often helps track stuff like this down.
HTH,
-Matt Cauthorn
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects