Forum Discussion

Mike_Denny_1081's avatar
Icon for Nimbostratus rankNimbostratus
Nov 22, 2010

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[]{""};



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();






final LocalLBVirtualServerVirtualServerProfile[][] profiles = new LocalLBVirtualServerVirtualServerProfile[][]{{}};



try {


getLbInterface().getLocalLBVirtualServer().create(definitions, wildmasks, resources, profiles);


} catch (Exception ex) { throw new LoadBalancerException(ex);








1 Reply

  • 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.



    update these variables with your configuration


    $name = "testvip";


    $ip = "";


    $port = 80;


    $pool = "pool_name_goes_here";



    $definition = New-Object -TypeName iControl.CommonVirtualServerDefinition;


    $ = $name;


    $definition.address = $ip;


    $definition.port = $port;


    $definition.protocol = "PROTOCOL_TCP";


    $definitions = (, $definition);




    $wildmasks = (, "");




    $resource = New-Object -TypeName iControl.LocalLBVirtualServerVirtualServerResource;


    $resource.type = "RESOURCE_TYPE_FAST_L4";


    $resource.default_pool_name = $pool;


    $resources = (, $resource);




    this is the piece you are missing...


    $profile = New-Object -TypeName iControl.LocalLBVirtualServerVirtualServerProfile;


    $profile.profile_context = "PROFILE_CONTEXT_TYPE_ALL";


    $profile.profile_name = "fastL4";


    $profileA = (, $profile);


    $profileAofA = (, $profileA);



    Write-Host "Creating Virtual Server `"$name`"...";
















    Hope this helps...