Bug 2028377 - [RFE] add option to export and import just repository for hammer content-export
Summary: [RFE] add option to export and import just repository for hammer content-export
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Inter Satellite Sync
Version: 6.10.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: 6.11.0
Assignee: Partha Aji
QA Contact: Radek Mynar
Depends On:
Blocks: 2053839
TreeView+ depends on / blocked
Reported: 2021-12-02 09:14 UTC by Stefan Nemeth
Modified: 2023-01-31 05:38 UTC (History)
20 users (show)

Fixed In Version: tfm-rubygem-katello-,tfm-rubygem-hammer_cli_katello-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2059388 (view as bug list)
Last Closed: 2022-07-05 14:30:33 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34374 0 Normal New [RFE] add option to export and import just repository for hammer content-export 2022-02-01 23:18:25 UTC
Red Hat Issue Tracker SAT-6677 0 None None None 2021-12-02 13:57:45 UTC
Red Hat Issue Tracker SAT-8465 0 None None None 2022-08-18 06:08:50 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:30:55 UTC

Description Stefan Nemeth 2021-12-02 09:14:31 UTC
Description of problem:

In 6.9 and before, it was possible to export and than import just repository with 

#hammer repository export

Now in 6.10 only possible way to export/import content is with content view export with

#hammer content-export complete version --content-view=view 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1.hammer content-export --help

Actual results:

No repository export possible

Expected results:

Have possibility to export/import just repository, not whole content view.

Additional info:

Comment 2 John G 2022-01-03 19:53:48 UTC
Steps to reproduce should be:
# hammer repository list --name 'Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server'
ID | NAME                                                  | PRODUCT                         | CONTENT TYPE | URL
2  | Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server | Red Hat Enterprise Linux Server | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os

#  hammer repository export --id 2
Error: No such sub-command 'export'.

See: 'hammer repository --help'.

Ability to export individual repos for different customers needs to be restored in SAt6.10 - not in referenced format - but rather SAT6.9 and previous rpm format for import into disconnected Satellites <6.10, and ability to import into disconnected satellites that don't have same subscriptions as connected one.  This ability should have never been removed.

Comment 3 John G 2022-01-11 23:05:00 UTC
Note: This was NOT noted in https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10/html/release_notes/release_information#deprecated_functionality. 
Please re-enable this functionality ASAP - content-view export/import only is a nightmare to manage with several OS versions and various disconnected satellites (and large customers) with various subscriptions.

Comment 4 John G 2022-01-13 19:04:00 UTC
According to https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10/html-single/upgrading_and_updating_red_hat_satellite/index section 3.1.3:
 The hammer import and export commands have been replaced with hammer content-import and hammer content-export tooling.

If you have scripts that are using hammer content-view version export, hammer content-view version export-legacy, hammer repository export, or their respective import commands, you have to adjust them to use the hammer content-export command instead, along with its respective import command. 

Well it looks as if content-export and content-import are NOT available either in 6.10 - only 6.9 - but 6.9 and all earlier also have 'hammer repository export'!

Comment 5 John G 2022-01-13 19:19:06 UTC
Correction  content-export and content-import are in 6.10 not 6.9 and earlier (was in wrong X-window when looking at help) - but will only export content-views not repositories - need ability to export repositories like 6.9 and earlier have always had.

Comment 7 Partha Aji 2022-02-01 23:18:24 UTC
Connecting redmine issue https://projects.theforeman.org/issues/34374 from this bug

Comment 8 Bryan Kearney 2022-02-05 02:18:04 UTC
Upstream bug assigned to paji

Comment 9 Bryan Kearney 2022-02-05 02:18:06 UTC
Upstream bug assigned to paji

Comment 10 Glenn Snead 2022-02-10 21:49:31 UTC
I agree with JohnG - the removal of hammer repository export severely hampers Red Hat's strategic position with regulated environment customers i.e. NAPS, Finance, Healthcare, etc. For example, my project is to provide hundreds of disconnected customers with an ACL-controlled disconnected CDN.  Access to Red Hat's content is controlled by the customer's entitlement manifest.  It would not be feasible to generate hundreds of CV exports that require different entitlements (which we won't have), different export dates (which would require a several 8x5 consultants to coordinate), and all of the related CV export deliveries. Then there are the expected CV export mistakes that we couldn't roll back, the CV import errors we can't fix, and the CV deliveries that are lost en route. What's more, most of these customers won't be able to connect to our disconnected Satellite due to regulations covering things like data ex filtration and need-to-know. 

In short, the disconnected CDN that feeds customer's Satellite servers is much, much simpler to maintain, removes Red Hat's out-of-contract-scope responsibility from being involved in our customer's patching cadence, and reduces Red Hat's potential exposure to data ex filtration liabilities.

Comment 12 Glenn Snead 2022-02-17 23:54:01 UTC
I took a look at https://github.com/Katello/katello/pull/9925, and I don't see the difference from the existing Satellite 6.10 content view export method.  

Unless the resulting tarball has the proper file tree i.e. content/rel8/x86_64/baseos/os/{Packages,repodata} format with a full copy of the latest repository metadata we cannot use Satellite 6.10 to support disconnected customers who are running their own Satellite servers.  These Satellite servers expect an available CDN server to supply them with content regardless of what their Satellite Organization(s) are named, and what is in their Organization's entitlement manifest. 

Is there a plan for this use case?  We have a lot of customers, 83 at the current state with hundreds more to come, who are depending on it.

Here's what we need:

Full repository exports containing a full copy of each repository's metadata that is both Satellite Organization, Content View, and software entitlement manifest neutral. 
Incremental repository exports containing a full copy of each repository's metadata that is both Satellite Organization, Content View, and software entitlement manifest neutral.
Single full or incremental repository exports containing a full copy of each repository's metadata that is both Satellite Organization, Content View, and software entitlement manifest neutral. This is to address critical CVEs that have mission critical impact. Think heart bleed and log4j.

Comment 16 John G 2022-03-07 15:47:14 UTC
As GleenS stated:
This fix for should allow repo export product to be the same as Sat6.9 and earlier!  It needs to be able to allow disconnected satellite import via sync as if connected to CDN - NOT a kludge like the 6.10.x content-view export.  All rpm's/repo should be available via directory structure - i.e Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server would be located under ${export_dir}/content/dist/rhel/server/7/7Server/x86_64/os - just like an import from REDHAT CDN.

Comment 18 Glenn Snead 2022-03-15 13:51:53 UTC
I don't think the CV export/import function is a kludge as it's been part of Satellite 6.x for quite some time.  The problem is that is is a 1:1 update method. Every CV created, in every Satellite Organization, needs its own CV import.  The connected Satellites must have sufficient entitlements for every Satellite Organization, and identical Satellite Organizations and CVs, and then the imports aren't guaranteed to work.  That greatly increases system administrator workload. Maintaining a disconnected CDN server is much less expensive in terms of work hours.

I would add that Red Hat Satellite's Disconnected Deployment documentation talks about using the Red Hat Content ISOs. However these files are infrequently updated, they don't cover all RHEL architectures, they don't provide a full suite of Red Hat applications i.e. JBoss, and the Content ISO page indicates that these files are deprecated. 

Documentation link: https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10/html/installing_satellite_server_from_a_disconnected_network/performing-additional-configuration#configuring-satellite-to-synchronize-content-with-a-local-cdn-server_satellite

Comment 19 Brad Buckingham 2022-03-29 13:02:15 UTC
Hi John, Glenn,

Please be aware that bug 2069306 has been created to track the repository exports in the 'yum repo' format.


Comment 29 Radek Mynar 2022-05-25 09:48:18 UTC
Complete and incremental export of single repository into tar.gz (hammer content-export complete repository ... / hammer content-export incremental repository ...) and subsequent import (hammer content-import repository ...) on disconnected Satellite went OK.

Please note that yum-format exports are tracked in bug 2069306

VERIFIED with Satellite 6.11 SNAP 21 @ RHEL8.6

Comment 32 errata-xmlrpc 2022-07-05 14:30:33 UTC
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 (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.