Forum Discussion
Cleanup of Inactive pool and VS
My first question on preparing a script for this would be to ask how you're identifying inactive objects. Is that by policy (ie..from a list or spreadsheet) or from actual inactivity in traffic? The rest is pretty straightforward with a local tmsh script or remote script with API calls as mkyrc mentions.
Hi JRahm ,
I have identified the inactive objects by checking them on the Config Explorer > Unused Object of qkview uploaded to iHealth. Can we delete all those inactive pools and VS via script, one shot?
- PhatANhappyJan 30, 2024MVP
All hail JRahm
before and if he doesnt reply fast enough......
using ihealth will not - should not display a VS that is not in use.... that being said, you are ok with deleting objects recommended as orphaned. if there is a hook, the f5 - appiance will/should protect you ..... i.e. - a pool that is not referenced in a a virtual server config - yet -is referenced in an irule will be flagged - and not allowed to be deleted as nested.
i would highly recommend using the ihealth as a spring board to a manual check via the gui or SCF file ( or other automation) before deletion.
as you can see in the screen shot below - it does not reference the Virtual server...... if you delete a virtual server - its gone.....if you do delete all - they are gone....
if you only delete the virtual server - and only the ones you are 100% positive are not in use - you are ok to ATTEMPT to delete the pool - and if its being called by other are areas ( irules or policies) - it will be flagged - and pre-vented from deletetion. Before your attempt a bold move -you need to be positive that the pool in question does not have any other hooks or possiblities of backend configurations AND - - AND - i would recommend 1000%
save sys ucs
save sys config file ......
as backup BEFORE doing any deletions.
Althought this might sound scary .... and it should ..... please deploly "purpose full" computing. if you do something - like delete pools or virtual servers - make sure you have a backup - and make sure you MEANT no harm - and you knew what you were deleting - and why you were deleting it.
the clicky - clicky world - is a scary - scary world.
- JRahmJan 30, 2024Admin
unused objects is pretty easy, you can just create a json blob like:
{ "pool": "mypool1", "pool": "mypool2", "rule": "myrule1", "monitor": "http myhttpmon" }
and then you can iterate over that with the DELETE method on a REST call to the appropriate URL for each object.
https://my.bigip.com/mgmt/tm/ltm/{obj-type}/{obj-name}
for things like data-groups and monitors you'll need some conditionals to manage the extra URL path components.
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