benhaw01_9110
May 03, 2011Nimbostratus
No effect when using remove_wideip_pool and add_wideip_pool
Hello.
I'm using iControl against a v9.4.7 Build330.0 Hotfix HF2 GTM. I am trying to set the ratio of pool members in a wideIP. To be clear, PoolMember's set_ratio method won't do what I want, because I'm trying to set the ratio on the pool within the WideIP, not the ratio of members in a pool.
At a high level, I'm doing:
set_active_partition('Partition_1')
get_wideip_pool('wideip_name')
{get the pool definition from this response based on input parameters}
remove_wideip_pool('wideip_name', pooldef from previous step)
{set new ratio value on pooldef object}
add_wideip_pool('wideip_name', modified pooldef)
When I run the script, I find that it runs without error, but there is no effect reflected in the GUI, and subsequent runs show that iControl returns the old values as if they were never updated. The user that I'm logging in with has the Administrator role. Running it with only the "remove" request also shows no effect. The pool is not removed.
I'm attaching the code snippet in question as well as the input and output SOAP. I can attach the entire script if necessary. Am I doing something wrong (i.e. do I need to invoke some kind of "commit" or "update" method after sending these requests)? Does this GTM version have a bug? Does the output SOAP look like a successful response?
Perl code snippet:
Set the session to the appropriate Partition
$soapResponse = $ManagementPartition->set_active_partition(
SOAP::Data->name('active_partition' => 'Partition_1'),
);
&checkResponse($soapResponse);
$soapResponse = $GlobalPoolMember->get_wideip_pool
(
SOAP::Data->name('wide_ips' => [$sWip]),
);
&checkResponse($soapResponse);
my $poolList = $soapResponse->result->[0];
Search for the requested pool object from the response
my $poolObj;
my $found=0;
foreach my $pool (@$poolList) {
my $name = $pool->{'pool_name'};
if ($name =~ m/^$sPool$/) {
This is the pool we want.
$poolObj = $pool;
$found++;
last;
}
}
die ("Requested pool $sPool not found in $sWip.") unless $found;
Check to make sure we actually need to do something.
die ("Requested pool $sPool ($sWip) ratio is already set to $sRatio. Exiting.") if ($poolObj->{'ratio'} =~ /^$sRatio$/);
Now for the scary part.
Remove the pool...
$soapResponse = $GlobalPoolMember->remove_wideip_pool
(
SOAP::Data->name('wide_ips' => [$sWip]),
SOAP::Data->name('wideip_pools' => $poolObj),
);
&checkResponse($soapResponse);
Edit our pool object with the new settings
$poolObj->{'ratio'} = $sRatio;
Re-add it with the appropriate settings.
$soapResponse = $GlobalPoolMember->add_wideip_pool
(
SOAP::Data->name('wide_ips' => [$sWip]),
SOAP::Data->name('wideip_pools' => $poolObj),
);
&checkResponse($soapResponse);
Excerpts from the SOAP requests sent for remove_wideip_pool and add_wideip_pool:
(attached)
The output from remove_wideip_pool and add_wideip_pool:
(attached)
/e:envelope