Project

General

Profile

InterServerSync » History » Version 30

Chris Duryee, 11/12/2015 08:32 PM

1 1 Chris Duryee
h1. InterServerSync
2
3 2 Chris Duryee
h3. What is ISS?
4
5
Inter-Server Sync is a feature designed to help users in two scenarios:
6
7
 * users who have a connected Foreman/Katello instance and disconnected Foreman/Katello, who want to propogate data from the connected side of their network to the disconnected side.
8
 * users who have a "main" Foreman/Katello and want to propogate some data (but not all data) to other instances. One example is for users who have "blessed" content views that are validated by the IT department, and want to propogate those down elsewhere.
9
10 30 Chris Duryee
More info on the original ISS is available at https://fedorahosted.org/spacewalk/wiki/InterSpacewalkServerSync.
11 5 Chris Duryee
12 1 Chris Duryee
h3. Goals
13
14 30 Chris Duryee
For Katello 2.5 we want to be able to export a group of repos in a given CV or Environment in tgz, chunked iso, or as a set of directories, and import said export to another Katello/Foreman instance.
15 1 Chris Duryee
16 30 Chris Duryee
Later iterations will allow for additional types of data besides yum repos or disk usage enhancements.
17 1 Chris Duryee
18 30 Chris Duryee
h4. Katello 2.5
19 1 Chris Duryee
20 30 Chris Duryee
This goal replaces the katello-disconnected script, and solves the same problem that Spacewalk solves with Inter-Spacewalk Sync in a minimal fashion. Users will be able to export yum repos associated with an environment or CV to disk and import them on another server. We will optionally recreate any custom products during the import, but RH products will not be re-created since they must be created via manifest.
21 28 Chris Duryee
22 30 Chris Duryee
We will support date-based incremental exports as well, via a ISO6601 "since" field on the export call.
23 16 Chris Duryee
24 30 Chris Duryee
h4. Katello 2.6+
25 6 Chris Duryee
26 30 Chris Duryee
These features require additional thought, or possibly upstream RFEs for Pulp.
27 16 Chris Duryee
28 30 Chris Duryee
 * Push repo contents from one Katello/Foreman to another (if X can initiate connections to Y but not vice versa).
29
 * Allow exporting to local disk where hammer is being run
30
 * Allow exports/imports to occur without writing entire export to disk
31
 * Support for additional types of data (docker, ostree, puppet)
32
 * Support for additional types of metadata (users, etc?)
33 1 Chris Duryee
34 30 Chris Duryee
h3. Katello 2.5 design and stories
35 1 Chris Duryee
36 3 Chris Duryee
Development steps
37
# Step 1 - export
38 26 Thomas McKay
> # As a user, I would like an API to export specific repositories.
39 27 Thomas McKay
> > * "Feature #12446":http://projects.theforeman.org/issues/12446 : Add ability to export yum repositories (both custom and RH) to disk
40
> > * Specify lifecycle environment and content view.
41 28 Chris Duryee
> # As a user, I would like an API to export specific products.
42 27 Thomas McKay
> # As an admin, I would like a role to limit which users may export.
43
> > * Based on product read, repository read, export true?
44
> # "Feature #12446" As an admin, I would like a setting to specify where exported files are stored on the server.
45
> > * How are the files organized (per org, per user, per cv, per env)?
46
> # As a user, I want to choose export format of iso, tgz, or dir
47
# Step 2 - import
48 29 Chris Duryee
> # "Feature #12459": http://projects.theforeman.org/issues/12459 : As a user, I want to temporarily set where to sync a repository from.
49 27 Thomas McKay
> # As a user, I want to permanently set where to sync a repository from.
50
> # As a user, I want to temporarily/permanently set sync location for a product.
51
> # As a katello, I want to prevent import of Red Hat products into custom products.
52
> > * If the Red Hat product already exists, it may sync from the location. A custom product may not sync Red Hat content.
53
# Step 3 - repository enable
54 1 Chris Duryee
> # As a user, I want to change the CDN to point to an export location.
55 27 Thomas McKay
> # As a katello, I want the repository choices shown on the Red Hat Repositories page to be limited to what is in the export.
56
> > * Only the Red Hat repos that were exported should be displayed as available for enable.
57
> > * If a product was enabled previously, it should be shown as already enabled.
58 26 Thomas McKay
59
60 30 Chris Duryee
h4. Katello 2.5 hammer design
61 1 Chris Duryee
62 30 Chris Duryee
this section is getting reworked:)
63 1 Chris Duryee
64 15 Chris Duryee
<pre>
65
66 28 Chris Duryee
# export a repository to disk on the Katello server (need to do this for each repo but can be a repo in a CV)
67 15 Chris Duryee
hammer repository export --id <id>
68 11 Chris Duryee
69 15 Chris Duryee
# export products to CSV
70 21 Chris Duryee
hammer csv products --csv-export --csv-file products.csv 
71
72 15 Chris Duryee
# replace URL with on-disk location for place to sync from on destination katello
73 11 Chris Duryee
sed -i 's#https://repos.fedorapeople.org/#file:///mnt/imports/#g' /tmp/foo.csv
74
75
# import steps
76
77
# ensure export is available, then run
78 24 Chris Duryee
hammer csv products --csv-import --csv-file products.csv 
79 11 Chris Duryee
80
# kick off syncs for imported products
81
hammer repository synchronize --id <id>
82
</pre>