Forum Discussion
LocalLBVirtualServer.get_type() not returning correct values.
I have the following powershell set, the VS is of type Performance (Layer 4)
$ic = get-f5.icontrol $vs = "/partition/vs" $ic.LocalLBVirtualServer.get_type($vs)
It seems to always return: RESOURCE_TYPE_POOL unless it's a forwarding VIP in which case it returns RESOURCE_TYPE_IP_FORWARDING, I've had a look in the API and I can't find another call which does the same thing and it hasn't been marked as depreciated, I've already checked to make sure it wasn't returning multiple values in an array it just always seem to think it's a "standard" virtual server. I am running 11.2.1 HF6
9 Replies
Hi!
I don't have a 11.2.1 available, but it seems to be working in 11.5.1, with the latest powershell snapin (have you installed, or upgraded recently?).
Sample config:
ltm virtual /Common/Forwardtest { destination /Common/10.1.1.0:0 ip-protocol tcp mask 255.255.255.0 profiles { /Common/fastL4 { } } source 0.0.0.0/0 translate-address disabled translate-port disabled } ltm virtual /Common/Reject { destination /Common/1.1.1.1:0 ip-protocol tcp mask 255.255.255.255 profiles { /Common/tcp { } } reject source 0.0.0.0/0 translate-address enabled translate-port enabled } ltm virtual /Common/Stateless { destination /Common/2.2.2.2:80 ip-protocol udp mask 255.255.255.255 pool /Common/PajoIIS-8080-8081_pool profiles { /Common/udp { } } source 0.0.0.0/0 stateless translate-address enabled translate-port enabled }Powershell code:
Initialize Snapin if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null ){ Add-PSSnapIn iControlSnapIn } $User = "iUser" $Password = "mypassword" $Partition = "Common" $BigIP = "192.168.161.10" Connect to the BigIP $Success = Initialize-F5.iControl -HostName $BigIP -Username $User -Password $Password Get an iControl Handle $F5 = Get-F5.iControl $vslist = $f5.LocalLBVirtualServer.get_list() $f5.LocalLBVirtualServer.get_type($vslist)Output:
RESOURCE_TYPE_L2_FORWARDING RESOURCE_TYPE_REJECT RESOURCE_TYPE_STATELESSProbably not the answer you were hoping for, but I'd suggest upgrading the PS snapin and then, if needed, the LTM.
Hope it helped.
/Patrik
- shaggy_121467
Cumulonimbus
I am seeing the same behavior between a standard and Perf L4 VS in v11.5.0 (albeit using python/bigsuds):
ltm virtual test_asm_vs { destination 1.1.1.1:http ip-protocol tcp mask 255.255.255.255 pool test_asm_pl profiles { http { } tcp { } } source 0.0.0.0/0 vs-index 2 } ltm virtual test_asm_fastl4_vs { destination 1.1.1.6:80 ip-protocol tcp mask 255.255.255.255 profiles { fastL4 { } } source 0.0.0.0/0 vs-index 6 }Python:
>>> b.LocalLB.VirtualServer.get_type(['test_asm_vs']) ['RESOURCE_TYPE_POOL'] >>> b.LocalLB.VirtualServer.get_type(['test_asm_fastl4_vs']) ['RESOURCE_TYPE_POOL']Since VS-type as is not necessarily a configuration item within the VS config, you may need to identify a VS by examining the profiles in combination with VirtualServer.get_type(). Seems a little weird, but its an option:
>>> b.LocalLB.VirtualServer.get_profile(['test_asm_fastl4_vs']) [[{'profile_name': '/Common/fastL4', 'profile_context': 'PROFILE_CONTEXT_TYPE_ALL','profile_type': 'PROFILE_TYPE_FAST_L4'}]]- Lee_Payne_53457
Cirrostratus
If we cant figure out why its reporting the wrong thing then I may have to look at using the profiles to determine the VS type. - shaggy_121467
Cumulonimbus
It's not necessarily the "wrong" thing, as it is a pool-based VS; however, the get_type wiki (https://clouddocs.f5.com/api/icontrol-soap/LocalLB__VirtualServer__VirtualServerType.html) does say that VirtualServerType contains member "RESOURCE_TYPE_FAST_L4". I'm curious to see what combination of VS options trigger that get_type response - Lee_Payne_53457
Cirrostratus
After some quick testing it appears that most work, I can get reject, L"_Forwarding, IP_Forwarding just not L4 forwarding, I'm wondering if something changed in v10/11 (as it was introduced in v9) which means it will always report as pool based.
- shaggy
Nimbostratus
I am seeing the same behavior between a standard and Perf L4 VS in v11.5.0 (albeit using python/bigsuds):
ltm virtual test_asm_vs { destination 1.1.1.1:http ip-protocol tcp mask 255.255.255.255 pool test_asm_pl profiles { http { } tcp { } } source 0.0.0.0/0 vs-index 2 } ltm virtual test_asm_fastl4_vs { destination 1.1.1.6:80 ip-protocol tcp mask 255.255.255.255 profiles { fastL4 { } } source 0.0.0.0/0 vs-index 6 }Python:
>>> b.LocalLB.VirtualServer.get_type(['test_asm_vs']) ['RESOURCE_TYPE_POOL'] >>> b.LocalLB.VirtualServer.get_type(['test_asm_fastl4_vs']) ['RESOURCE_TYPE_POOL']Since VS-type as is not necessarily a configuration item within the VS config, you may need to identify a VS by examining the profiles in combination with VirtualServer.get_type(). Seems a little weird, but its an option:
>>> b.LocalLB.VirtualServer.get_profile(['test_asm_fastl4_vs']) [[{'profile_name': '/Common/fastL4', 'profile_context': 'PROFILE_CONTEXT_TYPE_ALL','profile_type': 'PROFILE_TYPE_FAST_L4'}]]- Lee_Payne_53457
Cirrostratus
If we cant figure out why its reporting the wrong thing then I may have to look at using the profiles to determine the VS type. - shaggy
Nimbostratus
It's not necessarily the "wrong" thing, as it is a pool-based VS; however, the get_type wiki (https://devcentral.f5.com/wiki/iControl.LocalLB__VirtualServer__VirtualServerType.ashx) does say that VirtualServerType contains member "RESOURCE_TYPE_FAST_L4". I'm curious to see what combination of VS options trigger that get_type response - Lee_Payne_53457
Cirrostratus
After some quick testing it appears that most work, I can get reject, L"_Forwarding, IP_Forwarding just not L4 forwarding, I'm wondering if something changed in v10/11 (as it was introduced in v9) which means it will always report as pool based.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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