Bug 924783
Summary: | Document running pulp-purge-packages to delete orphaned packages | ||
---|---|---|---|
Product: | Red Hat Update Infrastructure for Cloud Providers | Reporter: | James Slagle <jslagle> |
Component: | Documentation | Assignee: | Julie <juwu> |
Status: | CLOSED ERRATA | QA Contact: | Dan Macpherson <dmacpher> |
Severity: | unspecified | Docs Contact: | |
Priority: | high | ||
Version: | 2.1.1 | CC: | tsanders, whayutin |
Target Milestone: | --- | ||
Target Release: | 2.1.2 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
New technical material on the 'pulp-purge-packages' script was required. This update adds Chapter 13. Deleting Orphaned Packages in the Red Hat Update Infrastructure Administration Guide.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2013-04-23 11:42:13 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
James Slagle
2013-03-22 13:50:01 UTC
i will be adding the technical material to the bug We probably want this material to be in a new section in the Administration Guide. Material: RHUI does not delete packages from the filesystem when those packages are no longer referenced by any repositories. This causes the package files themselves to remain on disk and consume space. There are 2 config options in /etc/pulp/pulp.conf that can cause packages to become unreferenced, and thus candidates to be deleted to reclaim disk space. The options in /etc/pulp/pulp.conf are: [yum] # True/False to flag if we should remove older rpms remove_old_versions: false # Integer to specify how many old packages to keep. num_old_pkgs_keep: 2 Set 'num_old_pkgs_keep' to the number of old versions of packages to have available in a repository. If available, RHUI will sync the latest version of each package, as well as the configured number of older versions of each package for a given repository. Set 'remove_old_versions' to true to have RHUI delete references to old package versions beyond 'num_old_pkgs_keep'. Another way packages can become unreferenced is through repository deletion. Once references are deleted, the 'pulp-purge-packages' script can be used to delete unreferenced packages and reclaim disk space. 'pulp-purge-packages' can be run with a '--dry-run' option to see what it will delete before actually deleting any packages off disk. The script logs to /var/log/pulp-purge-packages. After reviewing the output from running with '--dry-run', run without that option to actually delete the packages. 'pulp-purge-packages' will automatically detect the packages and repository directories to use to delete packages, so it can be run interchangeably on both the RHUA and CDS servers. Or, these options can be specified on the command line. Note: httpd must be stopped before running 'pulp-purge-packages' Note: 'pulp-purge-packages' deletes all unreferenced packages. If 'pulp-admin content upload' has been used to upload packages, and those packages have not been associated with any repositories, those packages will be deleted. The script should be run as root. Example output: [root@rhui2-cds01 ~]# pulp-purge-packages --help Usage: pulp-purge-packages [options] Options: -h, --help show this help message and exit -p PACKAGES_DIR, --packages-dir=PACKAGES_DIR packages directory to purge of orphaned packages (will be detected if not specified) -r REPOS_DIR, --repos-dir=REPOS_DIR repository directory to search for referenced packages (will be detected if not specified) -d, --dry-run dry run only, do not actually purge any packages [root@rhui2 ~]# pulp-purge-packages --dry-run 2013-03-22 15:28:20,405 - Starting run of ./pulp-purge-packages WARNING: httpd must be stopped before this script can be run. WARNING: This script will delete all packages not associated with any repositories. Including packages that were uploaded with the 'pulp-admin content upload' command. Continue? Y/N: y 2013-03-22 15:28:21,550 - Detecting packages and repository directories. 2013-03-22 15:28:21,551 - Using /var/lib/pulp/repos as repository directory. 2013-03-22 15:28:21,551 - Using /var/lib/pulp/packages as packages directory to purge. 2013-03-22 15:28:21,551 - Dry run specificed, No actual deletes will occur. 2013-03-22 15:28:21,552 - Getting all referenced packages, this may take a few minutes... <logging of found packages to delete> *** Bug 924781 has been marked as a duplicate of this bug. *** Verified new chapter added. However, you might need to add a step to start the httpd service again after completing the purge process in Procedure 13.2. Correct, a start of httpd is needed at the end (sorry I missed that). A couple of other feedback items: There are 2 ways you can end up with orphaned packages: 1. Setting the config options as shown above 2. Deleting a repository The first sentence in Procedure 13.2 makes it sound like it's only be deleting a repository (to me anyway). The Note after step 2 does not look complete. Running with --dry-run does not affect where the script logs. It could instead say something like: After reviewing the output from running with '--dry-run', run without that option to actually delete the packages. Then maybe another Note that says: The script logs to /var/log/pulp-purge-packages. Verified changes. 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. http://rhn.redhat.com/errata/RHBA-2013-0767.html |