Can you "roll back" an entire channel(s) using spacewalk-clone-by-date

Latest response

I apologize if this is easily answered, but I could not find what I was looking for.

If I was to create a Clone Channel and keep it up-to-date using spacewalk-clone-to-date, is it possible to "roll back" to a previous date once you have made the channel more current that your target date.

For example:  If my channel was cloned to 2013-03-01 and I then clone to 2013-05-01.   Aftewards I realize that I did NOT want my channel to be that current and instead want it to be 2013-04-01.

What would happen if I did the following:

# spacewalk-clone-by-date --username=your_username --password=your_password --server=satellite_server_url --channels=rhel-i386-server-5 my-clone-RHEL-5 --to_date=2013-05-01
# spacewalk-clone-by-date --username=your_username --password=your_password --server=satellite_server_url --channels=rhel-i386-server-5 my-clone-RHEL-5 --to_date=2013-04-01

Thanks much!  I'm looking forward to the Satellite presentation at Summit this year for sure!

Responses

Hi James,

Glad that you are looking forward to the Satellite presentations at Summit this year. I am sure you will find those interesting and helpful.

No I don't see such an option availalbe to rollback the cloned errata/packages into a channel. Log file does contain the list of packages/errata added to the channel but yeah if the list is long then referring to the list and manual removal would be a pain. Safe bet would be to create a new (test) channel and subscribe systems to it and once the content is verified you could either continue to use the new channel or update the earlier one.

I wonder if others in this group here had similar requirements and if they have better hacks/scripts to share.

Paresh

James,

I've done a rollback using the

spacewalk-manage-channel-lifecycle

script, but that requires you've done an archive previously.  Archives currently show up as channels, which means having a regular process of archiving can litter the channels screens.  I'm starting to feel like a billboard for this script.

 

Since I have a non-production Satellite, I went ahead and tried a clone-by-date on an earlier date like your example to see what the end state of the channel would be.  I found a particular errata for BIND that was in the RHT source and the cloned channel, so picked a date a few days before that was released.  The RHT server base channel has 10510 packages currently, the clone target has 10437 as it is not completely up to date.  We'll look at the number of packages overall and for the specific bind-9.8.2-0.17.rc1 package in the clone.

# spacewalk-clone-by-date -c ~/.clone_config -d 2013-03-20

Password:

Reading repository information.


By continuing the following will be cloned:

  rhel-x86_64-server-6 -> dev-rhel-x86_64-server-6  (0/7 Errata)

  rhel-x86_64-server-rs-6 -> dev-rhel-x86_64-server-rs-6  (86/87 Errata)

  rhel-x86_64-server-6-rhevm-3 -> dev-rhel-x86_64-server-6-rhevm-3  (39/39 Errata)

  rhn-tools-rhel-x86_64-server-6 -> dev-rhn-tools-rhel-x86_64-server-6  (23/27 Errata)

  ep-x86_64-local-6 -> dev-ep-x86_64-local-6  (0/0 Errata)

  jbappplatform-5-x86_64-server-6-rpm -> dev-jbappplatform-5-x86_64-server-6-rpm  (0/0 Errata)

  jbappplatform-6-x86_64-server-6-rpm -> dev-jbappplatform-6-x86_64-server-6-rpm  (0/0 Errata)

  rhel-x86_64-rhev-agent-6-server -> dev-rhel-x86_64-rhev-agent-6-server  (0/1 Errata)

  rhel-x86_64-server-ha-6 -> dev-rhel-x86_64-server-ha-6  (0/1 Errata)

  rhel-x86_64-server-6-rhevh -> dev-rhel-x86_64-server-6-rhevh  (0/2 Errata)

  rhel-x86_64-server-optional-6 -> dev-rhel-x86_64-server-optional-6  (931/953 Errata)

  rhel-x86_64-server-6-rhevm-3.1 -> dev-rhel-x86_64-server-6-rhevm-3.1  (0/2 Errata)

  rhel-x86_64-server-supplementary-6 -> dev-rhel-x86_64-server-supplementary-6  (87/93 Errata)

Cloning Errata into dev-rhel-x86_64-server-rs-6 (86):

________________________________________

######################################## - complete

Cloning Errata into dev-rhel-x86_64-server-6-rhevm-3 (39):

________________________________________

######################################## - complete
[output truncated]


So the cloning process completed successfully, as far as the command is concerned at least.  Looking at the channel content, last mod date is 2013-05-15 09:16:16 EDT but the number of packages is 10437 .  Searching the cloned channel for the package that should be missing reveals it is still there and the clone is still in the "Available From" list for bind-9.8.2-0.17.rc1.   So just trying to overwrite a clone channel from an earlier date won't remove packages that were sync'd from a later date.

For fun I tried a '-r *' to see if using a wildcard removelist on the clone would change anything and it didn't.  

Hope this helped, it was fun to kick it around and see what happened.

Thanks Matthew, perhaps your process will be converted to a KnowledgeBase ;-)  I am waiting on my POC Sat certificate to be generated and I plan on building another Satellite to test with.  I am hopeful that with some testing and your suggestion I will be able to create a process that I am comfortable with and can convince my team is a suitable solution to move forward with.