Forum Discussion
Nov 22, 2010
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 = "99.99.99.99";
$port = 80;
$pool = "pool_name_goes_here";
$definition = New-Object -TypeName iControl.CommonVirtualServerDefinition;
$definition.name = $name;
$definition.address = $ip;
$definition.port = $port;
$definition.protocol = "PROTOCOL_TCP";
$definitions = (, $definition);
$wildmasks = (, "255.255.255.255");
$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`"...";
(Get-F5.iControl).LocalLBVirtualServer.create(
$definitions,
$wildmasks,
$resources,
$profileAofA
);
Hope this helps...
-Joe