I’ve added synched yum repos for CentOS7.7 and EPEL7. I created content views for each and then I created a composite view called CentOS_Full which has been promoted to all lifecycles, I also did this for each of the members of the composite view.
I then created Activation keys for the tst and dev lifecycles that links to the composite view and the respective lifecycle environment. There are packages available in each content view/repository.
After installing subscription-manager and the katello-ca-consumer I successfully register the host using the activation key, but I get “No products installed.”
I am missing experience with CentOS depoyment via Katello, but from what I understand I would take the following guess what’s happening here:
The ‘No products installed’ message is fine for CentOS. This should only relate to RedHat Products (which subscription-manager is mainly built around) and you should be able to savely ignore that.
Due to this, though, auto-attach most likely will not work. You have to assign subscriptions and configure repository overrides with your activation keys to get the repositories.
If you want to make sure your CCV/CV setup is working in general, you can use sudo subscription-manager repos --list-disabled to see if any repos are available. If this returns the repos you are expection your contentview setup is working and you probably only need to adjust the activation keys.
Side note: If you only access your content/repos through CCVs, there is no need to promote individual CVs to the lifecycle environments. There is no harm in promoting them, but skipping that step if you do not access them directly can save quite some time when updating the repos
You most likely have to attach subscriptions to those activation keys. I know it’s conter-intuitive, but Katello generates “virtual” subscriptions for every non-RedHat product that emulates the behaviour of RedHat subscriptions.
You can find those via hammer subscription list --organization yourorg. You can then assign those to the activation key using hammer activation-key add-subscription --organization yourorg --name youractivationkey --subscription-id yourproductsid. If you want to fine-tune which repos are enabled on your hosts by default, you can use hammer activation-key content-override, but I don’t know how to use that hammer command. In the UI, this is under “Content” -> “Activation keys” -> Select One -> “Repository Sets”.
I’ll confirm this behavior. Build products, build download content views, build composite content views for my environments, build the life cycle environments, publish the composite content views, build activation keys (turning off auto-attach, manually selecting subscriptions, and disabling repositories that shouldn’t be available to a particular key.)
@jkalchik I don’t see any indication that I’ve fallen into that issue. I check the host log and everything is clean with no errors. The expiration dates are all 2049 for my products. It just doesn’t register any products until I add them directly to the host. The frustrating part is that I built everything with hammer commands for reproducibility and the first environment I built works fine. Activation keys provide subscriptions as expected. The only difference is that with the current env I added Host Groups and setup more of the pxe booting environment, but I don’t think that impacts the Activation Keys.
That is “normal” behaviour. The redhat.repo file is autocreated by subscription-manager.
Have you tried disabling auto-attach for the activation-key? hammer activation-key update --auto-attach no --name CentOS7_Full should do the trick. Then resubscribe the system with the updated key.
If that still does not work, please provide output for the following commands:
subscription-manager list --available
subscription-manager list --consumed
Ok, so everything seems to be working as expected. I didn’t have to disable the auto attach and when I looked this morning all repos were in the redhat.repo file. Is it recommended to remove auto attach for the keys? What’s the best way to add a new reopo to a host when the activation key gets a new subscription? Re-register with --force?
That’s funny. Using the methodology I described above, /etc/yum.repos.d/redhat.repo is populated with descriptions of all repositories visible through a lifecycle environment (disabled as appropriate by overrides in activation keys.)
-rw-r--r--. 1 root root 8475 Mar 17 09:53 redhat.repo
As I mentioned I am missing experience with CentOS via Katello. For RHEL it is recommended to leave it on and if you don’t experience any further problems with it, you can leave it on I would suppose.
Sorry, I was probably unprecise here: What I meant is that the file is there, even if the system is not correctly subscribed and has no repos available. In that case, it is normal that it’s empty.
That is an option, but probably not the best one.
My recommendation would be to nuse subscription-manager attach --pool poolid.
You can get the poolid from one of your systems via subscription-manager list --available. As long as you are not using RedHat Virtual Datacenter/Per-Hypervisor Licences, the poolid should be the same for all systems. So for CentOS or third-party/custom repositories, that should be the case.