Right now if you: Create a capsule Associate it with a lifecycle environment (one that has content) Sync the capsule Unassociate it with the lifecycle environment You would expect all content on the capsule to be removed immediately, instead you have to manually 'sync' the capsule again.
Created from redmine issue http://projects.theforeman.org/issues/6288
Upstream bug component is Pulp
In Satellite 6.2, several enhancements were introduced to clean up the content on the capsule; however, there is an edge case that still needs to be addressed. Scenario 1: A good/valid scenario/result 1. From Satellite, Capsule has environments Dev & Test associated 2. Capsule sync is performed 3. Capsule now has Dev & Test content 4. From Satellite, Capsule updated to only have environment Test 5. Capsule sync is performed 6. Capsule updated to only have environment Test content Scenario 2: A bad/invalid scenario/result 1. From Satellite, Capsule has environment Test associated 2. From Satellite, Capsule environment Test is removed 3. Capsule sync is performed 4. Capsule still has Test content Note: in 6.2 the user does still need to manually trigger a capsule sync.
*** Bug 1269163 has been marked as a duplicate of this bug. ***
Brad, I see the upstream category in the foreman redmine is "Pulp"; is that why it's in the Pulp component in BZ? Is that a strict mapping? It would be helpful to us if the Pulp component in BZ only contained issues where Pulp has some next steps to take, but I'm happy to do whatever is best for the rest of Satellite, since ultimately that is who all this BZ content benefits. For this issue specifically, there are no changes required from Pulp, so I'm hoping to move it to a different component.
Moving the component back to Capsule since it does not appear to require any Pulp changes.
Satellite 6.4 and Satellite 6.5 have the following behavior: * On every sync, unneeded repositories are deleted * Once a week via a cron job, content that are no longer needed (rpms, puppet modules, etc..) are cleaned deleted Starting with Satellite 6.6, both of these jobs belong to this weekly cron job. Thus the following works fine: 1. Sync some lifecycle environment to a capsule 2. Remove the lifecycle environment from the capsule 3. Wait a week, or run foreman-rake katello:delete_orphaned_content the repositories and all their content should be deleted from the capsule. I suggest we propose as ON_QA for 6.6
Tested with Satellite 6.6.0 Snap18 and doesn't behave like stated in comment#30 Content is not removed not only upon last LFE removal but basically upon any LFE removal and foreman-rake katello:delete_orphaned_content doesn't help at all. Switching back to NEW then. Integration with pulp seems to be broken yet more? # pulp-admin rpm repo list | grep -e Name: -e Rpm: >>> Library content still present Display Name: RHEL 7.7 Rpm: 5225 Display Name: Red Hat Satellite Maintenance 6 for RHEL 7 Server RPMs Rpm: 33 Display Name: Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server Rpm: 26176 Display Name: Capsule 6.6 RHEL7 Rpm: 207 Display Name: Red Hat Software Collections RPMs for Red Hat Enterprise Rpm: 11326 Display Name: Red Hat Ansible Engine 2.8 RPMs for Red Hat Enterprise Rpm: 8 >>> Dev content should be also removed Display Name: Capsule 6.6 RHEL7 Rpm: 207 Display Name: Capsule 6.6 RHEL7 Rpm: 207 # pulp-admin orphan list +----------------------------------------------------------------------+ Summary +----------------------------------------------------------------------+ Distribution: 0 Docker Blob: 0 Docker Image: 0 Docker Manifest: 0 Docker Manifest List: 0 Docker Tag: 0 Drpm: 0 Erratum: 0 Iso: 0 Modulemd: 0 Modulemd Defaults: 0 Ostree: 0 Package Category: 0 Package Environment: 0 Package Group: 0 Package Langpacks: 0 Puppet Module: 0 Rpm: 0 Srpm: 0 Yum Repo Metadata File: 0 Total: 0 >>> There are no orphans made that's why foreman-rake katello:delete_orphaned_content has no effect
Fixed as part of upstream issue 27795
VERIFIED. @Satellite 6.6.0 Snap21 tfm-rubygem-katello-3.12.0.25-1.el7sat.noarch the behavior in Satellite 6.6.0 as per comment#30 has changed therefore used this reproducer: 1) Assign a LFE to the capsule 2) At the capsule check for content: # pulp-admin rpm repo list | grep -e Name: -e Rpm: Display Name: Capsule 6.6 RHEL7 Rpm: 208 Display Name: Maintenance 6.6 RHEL7 Rpm: 15 Display Name: RHEL 7.7 Rpm: 5225 3) Unassign the LFE from the capsule 4) Force to run weekly clean up task: # foreman-rake katello:delete_orphaned_content Orphaned content deletion started in background. Orphaned content deletion started in background. 5) At the capsule check for content again: # pulp-admin rpm repo list | grep -e Name: -e Rpm: <empty> >>> weekly task katello:delete_orphaned_content now properly removes all content of unassigned LFEs
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:3172