Forum Discussion
Will_Longo
Altostratus
Oct 10, 2013Creating VIPs - having problems with profiles
Hello all, im new to this community and have only been working with F5s for about 4 months. In my workplace we frequently deploy massive numbers of servers that require load balancing. Due to the inc...
Oct 14, 2013
The issue I see with the first example is that you are looping over the
$profileINFILE = import-csv $profileCSV
foreach ($profileset in $profileINFILE | where-object {$_.Sequence -eq $i})
{
$vipprofilehttp = New-Object -TypeName iControl.LocalLBVirtualServerVirtualServerProfile;
$vipprofilehttp.profile_context = "PROFILE_CONTEXT_TYPE_ALL";
$vipprofilehttp.profile_name = $profileset.http;
$vipprofilessl = New-Object -TypeName iControl.LocalLBVirtualServerVirtualServerProfile;
$vipprofilessl.profile_context = "PROFILE_CONTEXT_TYPE_CLIENT";
$vipprofilessl.profile_name = $profileset.SSLClient;
$vipprofileoneconnect = New-Object -TypeName iControl.LocalLBVirtualServerVirtualServerProfile;
$vipprofileoneconnect.profile_context = "PROFILE_CONTEXT_TYPE_ALL";
$vipprofileoneconnect.profile_name = $profileset.OneConnect;
Shouldn't the previous entries be saved here or they get overwritten
in the next iteration...
}
$vipprofileA = ($vipprofilehttp, $vipprofilessl, $vipprofileoneconnect);
$vipprofileAofA = (, $vipprofileA);
You are looping over all the entries, but are just overwriting all the variables for each entry in the CSV. The last time through the loop the variable are set to the last entry and then written to the array. That's likely why you are missing entries.
I'm going to have to take a longer look at the second script to find out what's going on in there...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
