Forum Discussion
How to efficiently delete a node from LTM?
Hi Sergei,
if you have figured out the related pools you can use tmsh as well to delete a specific pool member:
tmsh modify ltm pool members delete { : }
Combining this with the answer from Michael J you can use a one liner to parse all pools and create the syntax to modify all pools on your system. Just replace the value of node with the node´s name:
node="10.131.131.5"; tmsh list ltm pool one-line | grep -E "${node}:[[:alnum:]]" | \
sed -r 's/ltm pool ([^ ]+).*members.*('${node}':[[:alnum:]]+).*/tmsh modify ltm pool \1 members delete { \2 }/g'
By adding "bash -x" the output will be executed immediately. Please be very careful!:
node="10.131.131.5"; tmsh list ltm pool one-line | grep -E "${node}:[[:alnum:]]" | \
sed -r 's/ltm pool ([^ ]+).*members.*('${node}':[[:alnum:]]+).*/tmsh modify ltm pool \1 members delete { \2 }/g' | bash -x
As this only modifies the running configuration you need to save to startup configuration afterwards and config-sync:
tmsh save sys config
tmsh run cm config-sync to-group
The syntax above can be enhanced to support administrative partitions and routing domains. Please let me know, if this is an additional requirement.
Thanks, Stephan
PS: Of course I recommend a config backup before applying all kind of change ...
This is super close. I ran it, but it wasn't able to identify all the pools. I did notice that the pools that the node wasn't removed from is either offline or disabled in the pool.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
