How to sync/resync a single repository to a single Capsule server

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.15+

Issue

  • As a user, I would like to sync a single repository to my Capsule, due to it failing in a previous sync task or it being the only repository that was recently updated in a content view.
  • A full Capsule sync can take a long time. How can I sync only 1 repository to the Capsule server?

Resolution

  1. Identify the "ID" of the Capsule you wish to sync content to:

    # hammer capsule list
    

Example output:

```

# hammer capsule list
ID | NAME                                | URL                                              | FEATURES                                                                   

-|-|-|-
2 | cap615.example.com | https://cap615.example.com:9090 | Templates, Logs, Dynflow, Script, Container_Gateway, Registration, Pulpcore

1  | sat615.d.sysmgmt.cee.redhat.com | https://sat615.example.com:9090 | Dynflow, Script, Ansible, Discovery, Openscap, Logs, Pulpcore              

-|-|-|-
```

**NOTE:** the Capsule ID from the example output is `2`
  1. Identify the ID of the lifecycle environment containing the content-view that contains the repository to sync:

    # hammer capsule content lifecycle-environments --id <CAPSULE ID#>
    

Example output:

```

    # hammer capsule content lifecycle-environments --id 2
ID | NAME    | ORGANIZATION        

-|-|-
9 | Prod | Default Organization
18 | RPMONLY | Default Organization

19 | TO_SYNC | Default Organization

-|-|-
```

**NOTE:** the example lifecycle environment ID assigned to the Capsule wil be `9`
  1. Identify the content-view and content-view version containing the repository:

    # hammer content-view version list --lifecycle-environment-id <LIFECYCLE ENVIRONMENT ID#>
    

Example output:

```

    # hammer content-view version list --lifecycle-environment-id 9
ID | NAME         | VERSION | DESCRIPTION | LIFECYCLE ENVIRONMENTS  

-|-|-|-|-
33 | SmallCV 13.0 | 13.0 | | Test, Prod
59 | RHEL 9 2.0 | 2.0 | | Library, Prod
47 | small 2.0 | 2.0 | | Prod, Library

10 | small2 1.0   | 1.0     |             | Library, Dev, Test, Prod

-|-|-|-|-
```

**NOTE:** the ID of the example content-view version will be `33`
  1. Identify the repository:

    # hammer content-view version info --id <CONTENT-VIEW-VERSION ID#> --fields Repositories
    

Example output:

```
    # hammer content-view version info --id 33 --fields Repositories
Repositories: 
 1) Id:    92
    Name:  Red Hat Satellite Maintenance 6.15 for RHEL 8 x86_64 RPMs
    Label: Red_Hat_Satellite_Maintenance_6_15_for_RHEL_8_x86_64_RPMs
 2) Id:    93
    Name:  Red Hat Satellite Client 6 for RHEL 8 x86_64 RPMs
    Label: Red_Hat_Satellite_Client_6_for_RHEL_8_x86_64_RPMs
```

**NOTE:** the example repository id used will be `93`
  1. Run the hammer command to perform the sync:

    # hammer capsule content synchronize --repository-id <REPOSITORY ID#> --id <CAPSULE ID#>
    

Example output:

```
    # hammer capsule content synchronize --repository-id 93 --id 2
[........................................................................................................] [100%]
```

**NOTE:** include the `--async` option to send the task to Satellite tasks and release the terminal

Example output:

```
    # hammer capsule content synchronize --repository-id 93 --id 2 --async
Capsule content is being synchronized in task eac3628a-6a17-4de1-9136-d95659ff3123.
```

Root Cause

The Satellite WebUI only offers 2 options for a Capsule sync where both options are for a full Capsule sync for the designated Organization selected in the Satellite WebUI. This full sync is a large time consumer when troubleshooting or only needing to update 1 or few repositories on a Capsule.

An RFE for these functionalities has been requested for adoption into the Satellite WebUI:

Diagnostic Steps

For more information on Capsule Syncing check out these KCS below:

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.