Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 830904 - Combining an activation key and a reactivation key will not install the software of the activation key
Summary: Combining an activation key and a reactivation key will not install the softw...
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning
Version: 541
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
Depends On:
Blocks: sat560-triage
TreeView+ depends on / blocked
Reported: 2012-06-11 15:40 UTC by Felix Dewaleyne
Modified: 2018-11-30 22:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-07-10 18:57:49 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Felix Dewaleyne 2012-06-11 15:40:25 UTC
Description of problem:
When attempting to use rhnreg_ks with both an activation key and a reactivation key, none of the software of the activation key is installed but the right channels are being subscribed.

Version-Release number of selected component (if applicable):
satellite 5.4.1 latest stable

How reproducible:
all the time

Steps to Reproduce:
1. create a RHEL6.1 channel with spacewalk-create-channel
2. clone rhn-client-tools to a child channel of that previously created channel
3.create a kickstart installing @base and only subscribing to a cloned based channel
4. create an activation key that will install rhncfg-client and rhncfg along with register to the rhn-client-tools clone created. I'll refer to it as key1
5. register a RHEL6.1 system and create a reactivation key "key2"
6. create a %post step using rhnreg_ks --activationkey key1,key2 --force
7. provision the registered machine with that kickstart
Actual results:
the machine is kickstarted, registered correctly to the satellite (it reuses the same profile) but the rhncfg-client and rhncfg packages aren't installed

Expected results:
the machine is registered to the right channels and the packages are instaled

Additional info:
only happens for RHEL6.

Comment 1 Stephen Herr 2013-07-10 18:57:49 UTC
This is not the correct way to use an activation key with a kickstart profile.

The reason is twofold:
1) by specifying a reactivation key in a post script you are statically tying that kickstart profile to that single server. Kickstart profiles are supposed to be generic and useful for many different servers, the cobbler system record that gets created when you re-provision a specific server is the thing that's supposed to be specific.
2) reactivation keys are only useful once, when they are reused they are deleted. If you generate a new reactivation key the old one is deleted. This would mean that each and every time you wanted to use this kickstart profile you would have to update that %post script.

Problem #2 is the reason what you're doing is not working, because the kickstart profile by default re-connects the server to it's old profile and in doing so it regenerates a reactivation key. So when you get to rhnreg_ks in the %post the second key is invalid, and the registration fails with an invalid key error without executing the first key.

The correct way to accomplish what you want is to go to the "Activation Keys" tab of the kickstart profile and set key1 as being associated with this profile. Also ensure that on the "System Details" tab of the profile it is set to "Re-connect to the existing system profile" (default). You will also have to modify the base channel on the Activation Key to be the desired cloned base channel (and then make sure the child channel selection and package installation selection is still correct afterwards), if you leave it as "Satellite default" you will wind up registered to the Satellite default, aka the regular RHEL channel. Satellite now can generate an appropriate kickstart file that will do all the right things, and it will work for any system that wants to register to this base channel / use this activation key, not just that specific one.

Closing as NOTABUG.

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