Deleting a host list results in the error:
...is in use
Host lists are useful when creating classes based on hosts, defining hosts and partners that can use compression, assigning hosts to sides, and defining exception lists for adaptive response host agents. If any of these facilities are referencing a host list, you cannot delete that list. For example, this error will occur when attempting to to delete a host list if the list is currently being referenced within a traffic class. This would most likely occur if the host list is being deleted through the command-line interface with the hl rm command, or through the web interface when there are multiple classes that reference the host list.
Before you can delete the host list, you must first remove the reference to the host list. For example, you must delete the class that references the host list. If a host list is associated with a class, you are likely to get the following error:
is in use
Until you delete the class or remove the host list from the class definition, you will not be able to remove a host list.
What can you do in such a scenario especially when you need to automate using Adaptive Response or command scheduling?
Lets assume you have a host list “Lap” associated with a class “High_bw” (Full path name of this class is /Inbound/High_bw.)
Add the class through the UI or CLI. For example:
class new /Inbound/High_bw nodefault inside:Lap outside host: any
If you delete the host list (hl rm Lap), it will give the error “Lap is in use.”
The workaround is to use a command schedule to delete the class before you need to delete the host list.