Problem:
Summary: Trying to remove old content in /var/lib/pulp
but can’t figure out why it doesn’t seem to be working after plenty of googling, reading and log review.
I have a /var/lib/pulp
directory on a dedicated 1.4 TB filesystem currently using 1.2 TB (90%) of space and triggering alerts. I’d like to remove old rpm content from /var/lib/pulp/media
which is where space is being consumed the most.
This Foreman serves three Linux platforms and we only need rpm content for the most recent three Content Views published for each platform.
I’m under the impression that if we delete old Content Views, then the rpms associated with them would be ‘orphaned’ and become potential for being deleted.
A cron job is deployed at /etc/cron.d/katello
and logs show this is being run periodically with:
foreman-rake katello:delete_orphaned_content RAILS_ENV=production
However, when I delete content views and run this manually, we’ve only ever seen less than 25 GB of space removed.
Expected outcome:
Given that 1.2 TB of space is in use, I’d like to think that when I delete many to most of the Content Views – leaving only a few VC left – a large amount of space would be freed.
Foreman and Proxy versions:
Foreman 3.12-1
Katello 4.14.3-1
Python 3.11-pulp-rpm-3.26-1
python3.11-pulpcore-3.49.22-1
Foreman and Proxy plugin versions:
Distribution and version:
RHEL 8.10
Other relevant data:
The task appears to run without error:
# hammer task list --search orphan
-------------------------------------|-----------------|---------|---------|---------------------|---------------------|--------------------|---------------|------------
ID | ACTION | STATE | RESULT | STARTED AT | ENDED AT | DURATION | OWNER | TASK ERRORS
-------------------------------------|-----------------|---------|---------|---------------------|---------------------|--------------------|---------------|------------
27cda6be-4540-4d49-b09d-7540b64da390 | Remove orphans | stopped | success | 2025/03/15 00:03:51 | 2025/03/15 00:03:58 | 7.161574 | foreman_admin |
6f3dbebf-8587-40c5-b7b5-e6bb051f07f2 | Remove orphans | stopped | success | 2025/03/14 23:43:02 | 2025/03/14 23:43:08 | 5.990856 | foreman_admin |
99daa4cf-0780-4748-b0f0-bf548631a4e3 | Remove orphans | stopped | success | 2025/03/14 23:35:56 | 2025/03/14 23:36:23 | 26.522241 | foreman_admin |
37497ad4-0399-4226-8633-9e5dbe4505b5 | Remove orphans | stopped | success | 2025/03/14 21:20:00 | 2025/03/14 21:21:43 | 103.307088 | foreman_admin |
In /var/log/foreman/production.log
I’ll see activity tasks like this:
2025-03-14T15:20:00 [I|bac|] Task {label: Actions::Katello::OrphanCleanup::RemoveOrphans, id: 37497ad4-0399-4226-8633-9e5dbe4505b5, execution_plan_id: 0bfff44b-40a0-436d-bf66-2c0f609ec175} state changed: planning
2025-03-14T15:20:00 [I|bac|] Task {label: Actions::Katello::OrphanCleanup::RemoveOrphans, id: 37497ad4-0399-4226-8633-9e5dbe4505b5, execution_plan_id: 0bfff44b-40a0-436d-bf66-2c0f609ec175} state changed: planned
2025-03-14T15:20:00 [I|bac|] Task {label: Actions::Katello::OrphanCleanup::RemoveOrphans, id: 37497ad4-0399-4226-8633-9e5dbe4505b5, execution_plan_id: 0bfff44b-40a0-436d-bf66-2c0f609ec175} state changed: running
2025-03-14T15:21:43 [I|bac|] Task {label: Actions::Katello::OrphanCleanup::RemoveOrphans, id: 37497ad4-0399-4226-8633-9e5dbe4505b5, execution_plan_id: 0bfff44b-40a0-436d-bf66-2c0f609ec175} state changed: stopped result: success
Based on my efforts to google and explore for an answer, it seems like this should be working and yet I don’t see any obvious errors or warnings indicating why its not.
Reviewing a graph of storage space usage on /var/lib/pulp
for the last year, I can see several points where many hundred gigabytes of space has been reduced from this filesystem. But I’m wondering if those were periods where we removed entire repositories such as Oracle 7, RHEL 7, CentOS 7, etc, and not just individual Content Views.