System registration to Red Hat Satellite 6 fails while provisioning system using third party provisioning tool via Puppet.
Environment
- Red Hat Satellite 6.x
Issue
- When attempting to provision a system using third party provisioning tool which contains the module for Red Hat Enterprise Linux system registration, the Puppet run would fail with error :
(/Stage[main]/Rhsm/Exec[RHSM-register]/returns) change from notrun to 0 failed: subscription-manager register --name='abc.example.com' --org='Example' --activationkey='Example_Key' returned 1 instead of one of [0]
- During the server build process, if “subscription-manager register” command has return code of 1, then Puppet and Ansible believe the server has failed to register to the Satellite server.
- The build process will be stopped and server will be decommissioned.
Resolution
- Create two Activation Keys [Blank_AK and Content_AK] where Blank_AK Activation Key will have no subscriptions attached to it and auto-attach should be enabled.
- The second one Content_AK will have the Content View associated to it which needs to be assigned to the client during the registration process like below:
# subscription-manager register --org="XYZ" --activationkey="Blank_AK,Content_AK"
- If single activation key is used, either blank or with guest-of-virt-who derived SKU, it fails with same error.
For more KB articles/solutions related to Red Hat Satellite 6.x Provisioning Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Provisioning related Issues
Root Cause
- The return code for the registration is 1 instead of 0, hence Puppet run fails with error and Puppet takes it as error output for anything except 0.
[root@client log]# subscription-manager status
+-------------------------------------------+
System Status Details in-order
+-------------------------------------------+
Overall Status: Insufficient
Red Hat Enterprise Linux for Virtual Datacenters, Premium:
- Guest has not been reported on any host and is using a temporary unmapped guest subscription. For more information, please
see https://access.redhat.com/solutions/1592573
[root@client log]# echo $?
1
SBR
Product(s)
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.