Find a node using LocalLBNodeAddressV2 based on IP address (not name)
Hello.
We have some iControl PowerShell scripts that we're using with our Private Cloud (IaaS) platform to add/remove VIPs, Pools and Nodes. Previously we were using LTM v10 so we couldn't set a friendly name for the node. Once we upgraded to v11 we started to set the "name" to match the actual server name. So for example we might have SERVER0121 as the node's Name and 192.168.1.17 as the node's address. It has been working fine, but now we've run into a situation where we have stale data - servers that are in the F5 but should have been removed and never were. So we're running into the following error:
Exception calling "create" with "3" argument(s): "Exception caught in LocalLB::urn:iControl:LocalLB/NodeAddressV2::create()
Exception: Common::OperationFailed
primary_error_code : 17237812 (0x01070734)
secondary_error_code : 0
error_string : 01070734:3: Configuration error: invalid node address, the IP address 10.27.197.106 already exists"
So I'd like to be able to remove these stale entries as we see them. But I'm not sure how to remove this node based on IP address only. For example if I try delete_node_address using the IP address.
Exception calling "delete_node_address" with "1" argument(s): "Exception caught in LocalLB::urn:iControl:LocalLB/NodeAddressV2::delete_node_address()
Exception: Common::OperationFailed
primary_error_code : 16908342 (0x01020036)
secondary_error_code : 0
error_string : 01020036:3: The requested node address (/Common/10.27.197.117) was not found."
At line:1 char:1
+ (Get-F5.iControl).LocalLBNodeAddressV2.delete_node_address($server_ip);
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SoapHeaderException
It's expecting the "name" which is SERVER0117. So how do I remove the node based only on IP address?
Thanks. Rezilient