Forum Discussion
Issue with setting up fast L4 virtual servers via Java
We want to set up a https virtual server with the following characteristics:
- service port 443
- Protocol: tcp
- Type: performance (Layer 4)
- source address default persistence profile
- SNAT automap
Our code (below) works, except that the virtual server is configured as a standard virtual server. I would greatly appreciate it if you could glance at this code…Do you see anything here that prevents it from being set up as a fast L4?
public void createHttpsVirtualServer(final String name, final String ip, final long port, final String poolName) throws LoadBalancerException {
CommonVirtualServerDefinition vsDef = new CommonVirtualServerDefinition(name, ip, port, CommonProtocolType.PROTOCOL_TCP);
final CommonVirtualServerDefinition[] definitions = new CommonVirtualServerDefinition[]{vsDef};
final String[] wildmasks = new String[]{"255.255.255.255"};
final LocalLBVirtualServerVirtualServerResource resource = new LocalLBVirtualServerVirtualServerResource(LocalLBVirtualServerVirtualServerType.RESOURCE_TYPE_FAST_L4, poolName);
final LocalLBVirtualServerVirtualServerResource[] resources = new LocalLBVirtualServerVirtualServerResource[]{resource};
final LocalLBVirtualServerVirtualServerType[] serverTypes = new LocalLBVirtualServerVirtualServerType[]{LocalLBVirtualServerVirtualServerType.RESOURCE_TYPE_FAST_L4};
LocalLBVirtualServerVirtualServerPersistence profile = new LocalLBVirtualServerVirtualServerPersistence();
profile.setProfile_name("fastL4");
final LocalLBVirtualServerVirtualServerProfile[][] profiles = new LocalLBVirtualServerVirtualServerProfile[][]{{}};
try {
getLbInterface().getLocalLBVirtualServer().create(definitions, wildmasks, resources, profiles);
} catch (Exception ex) { throw new LoadBalancerException(ex);
}
}
In order to create a fastL4 virtual, you need to have the "fastL4" profile attached to it. Right now you are not passing in any profiles in your "profiles" variable. Try passing in a profile with the context of "PROFILE_CONTEXT_TYPE_ALL" and name of "fastL4" in the [0][0] element of the profiles variable. I don't have any java code at the moment to pass along, but here's a PowerShell script that will do it with the iControl Snapin setup.
$definition = New-Object -TypeName iControl.CommonVirtualServerDefinition;
$wildmasks = (, "255.255.255.255");
Write-Host "Creating Virtual Server `"$name`"...";
(Get-F5.iControl).LocalLBVirtualServer.create(
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