Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1444259 - Satellite does not update content-host's "auto-attach" when subscription-manager auto-attach --disable is run
Summary: Satellite does not update content-host's "auto-attach" when subscription-mana...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: Unspecified
Hardware: x86_64
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: Eric Helms
QA Contact: Katello QA List
URL:
Whiteboard:
: 1445190 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-21 01:30 UTC by Liushihui
Modified: 2024-06-13 20:47 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-19 17:29:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
journalctl.log (9.37 KB, text/plain)
2017-05-02 06:23 UTC, Liushihui
no flags Details
rhsm.log (47.62 KB, text/plain)
2017-05-02 06:23 UTC, Liushihui
no flags Details
auto-attach.jpeg (96.72 KB, image/jpeg)
2017-05-04 05:25 UTC, Liushihui
no flags Details

Description Liushihui 2017-04-21 01:30:40 UTC
Description of problem:
Disabled "auto-attach" attribute in subscription-manager.If system specify a pool to attach, it still auto attach another pool.

Version-Release number of selected component (if applicable):
virt-who-0.19-2.el7sat.noarch
subscription-manager-1.17.15-1.el7.x86_64
python-rhsm-1.17.9-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Register system to Satellite-snapshot4

2. Disable "auto-attach" attribute in subscription-manager
[root@hp-z220-10 ~]# subscription-manager auto-attach --disable
Auto-attach preference: disabled
[root@hp-z220-10 ~]# subscription-manager  list --consumed
No consumed subscription pools to list

3. Specify system to subscribe "Datacenters" pool.
[root@hp-z220-10 ~]# subscription-manager subscribe --pool=8ac9035a5b884cc6015b885826cd02fe
Successfully attached a subscription for: Red Hat Enterprise Linux for Virtual Datacenters, Standard

4. Check the consumed subscriptions.
[root@hp-z220-10 ~]# subscription-manager  list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   CloudForms (10-pack)   ===========>It's auto attached pool
Provides:            Oracle Java (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat CloudForms Beta
                     Red Hat Enterprise Linux Server
                     Red Hat CloudForms
                     Red Hat Beta
                     Red Hat Software Collections (for RHEL Server)
SKU:                 MCT2358
Contract:            11261876
Account:             5758125
Serial:              3797059728640792190
Pool ID:             8ac9035a5b884cc6015b885825630253
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              02/26/2017
Ends:                02/25/2018
System Type:         Physical

Subscription Name:   Red Hat Enterprise Linux for Virtual Datacenters, Standard
Provides:            
SKU:                 RH00002
Contract:            11261867
Account:             5758125
Serial:              7648731972332709471
Pool ID:             8ac9035a5b884cc6015b885826cd02fe
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Stackable
Starts:              02/26/2017
Ends:                02/25/2018
System Type:         Physical


Actual results:
Although auto-attach has been disabled and system only specified to subscribe "Red Hat Enterprise Linux for Virtual Datacenters, Standard", system still auto subscribe another pool "CloudForms (10-pack)"

Expected results:
System should only attach the specified pool "Red Hat Enterprise Linux for Virtual Datacenters, Standard"

Additional info:
If it hasn't set auto-attach to disable, it hasn't this pool, system will only attach the specified pool

Comment 2 Jiri Hnidek 2017-04-26 15:03:17 UTC
Please can you tell me, what is content of /etc/pki/product-default/. Can you also give me content of certificate(s) in this directory using:

rct cat-cert /etc/pki/product-default/*.pem

Thanks.

Comment 4 Jiri Hnidek 2017-04-27 08:16:41 UTC
Can you please provides output of log file /var/log/rhsm/rhsm.log and output of journalctl -f.

Comment 5 Liushihui 2017-05-02 06:21:53 UTC
Please see the info as the following, the rhsm.log and journalctl.log in attachment.
[root@hp-z220-04 product-default]# ll /etc/pki/product-default/
total 4
-rw-r--r--. 1 root root 2159 Sep 27  2016 69.pem

[root@hp-z220-04 product-default]# rct cat-cert /etc/pki/product-default/69.pem 

+-------------------------------------------+
        Product Certificate
+-------------------------------------------+

Certificate:
        Path: /etc/pki/product-default/69.pem
        Version: 1.0
        Serial: 12750047592154746560
        Start Date: 2016-01-04 13:07:32+00:00
        End Date: 2035-12-30 13:07:32+00:00

Subject:
        CN: Red Hat Product ID [b0918f42-730b-4ee9-b4ee-9504e60fcb1a]

Issuer:
        C: US
        CN: Red Hat Entitlement Product Authority
        O: Red Hat, Inc.
        OU: Red Hat Network
        ST: North Carolina
        emailAddress: ca-support

Product:
        ID: 69
        Name: Red Hat Enterprise Linux Server
        Version: 7.3
        Arch: x86_64
        Tags: rhel-7,rhel-7-server
        Brand Type: 
        Brand Name:

Comment 6 Liushihui 2017-05-02 06:23:28 UTC
Created attachment 1275568 [details]
journalctl.log

Comment 7 Liushihui 2017-05-02 06:23:52 UTC
Created attachment 1275569 [details]
rhsm.log

Comment 8 Kevin Howell 2017-05-03 14:41:10 UTC
Is auto-attach enabled in the Satellite WebUI when this happens?

Comment 9 Liushihui 2017-05-04 05:24:30 UTC
After disable auto-attach in CLI as the following, it will auto-attach a sku in GUI, please see screenshot in attachment auto-attach.jpeg.

[root@hp-z220-04 ~]# subscription-manager auto-attach --disable
Auto-attach preference: disabled
[root@hp-z220-04 ~]# subscription-manager  list --consumed
No consumed subscription pools to list
[root@hp-z220-04 ~]# subscription-manager  refresh
All local data refreshed
[root@hp-z220-04 ~]# subscription-manager  list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   CloudForms (10-pack)
Provides:            Oracle Java (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat CloudForms Beta
                     Red Hat Enterprise Linux Server
                     Red Hat CloudForms
                     Red Hat Beta
                     Red Hat Software Collections (for RHEL Server)
SKU:                 MCT2358
Contract:            11261876
Account:             5758125
Serial:              3545091525090374005
Pool ID:             8ac903175bd0429d015bd04f8c2d03b3
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              02/26/2017
Ends:                02/25/2018
System Type:         Physical

Comment 10 Liushihui 2017-05-04 05:25:30 UTC
Created attachment 1276112 [details]
auto-attach.jpeg

Comment 11 Jiri Hnidek 2017-05-05 19:32:05 UTC
Please can you tell me, how did you setup your Satellite/Subman that it does not consume any subscription after registration. I just cannot reproduce this bug:

[root@rhel01 rhsm]# subscription-manager register --org="Default_Organization" --activationkey="experiment"
The system has been registered with ID: 0c273ac2-8b93-4aa8-b3b1-a8cd1663436c 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@rhel01 rhsm]# subscription-manager  list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux for Virtual Datacenters, Standard (DERIVED SKU)
Provides:            Red Hat Developer Toolset (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Server
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Beta
                     dotNET on RHEL (for RHEL Server)
SKU:                 RH00050
Contract:            
Account:             
Serial:              3010330367683125969
Pool ID:             ff8080815bca5dfb015bcad9afcf027b
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Guest has not been reported on any host and is using a temporary unmapped guest
                     subscription.
Subscription Type:   Stackable (Temporary)
Starts:              1.5.2017
Ends:                6.5.2017
System Type:         Virtual

Comment 14 Jiri Hnidek 2017-05-12 16:29:02 UTC
We decided to close this as "not a bug". This is expected behavior, when auto-attach is enabled in activation key.

Another bug report will be opened for Katello, because Katello should respect setting of auto-attach of subscription from subscription-manager.

Comment 15 Liushihui 2017-05-15 01:13:28 UTC
Hi Jiri,

I think you can reproduce this bug according to the following steps, so I reopen this bug:
[NOTE]: Please use physical machine to do the test(not virtual machine).
1 Register system to satellite with username/passsword(not active-key)
[root@hp-z220-05 ~]# rpm -ivh http://10.73.131.233/pub/katello-ca-consumer-latest.noarch.rpm    
Retrieving http://10.73.131.233/pub/katello-ca-consumer-latest.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:katello-ca-consumer-satellite62-o################################# [100%]
[root@hp-z220-05 ~]# subscription-manager register --username=admin --password=admin
Registering to: satellite62-ohsnap.redhat.com:443/rhsm
The system has been registered with ID: 7e180dc5-f444-42aa-9352-0ad0be4b9801 

2. Wait for a short while(1 minute), open satellite webUI, go to Host-->Content host,choose this host, go to Subscription-->list/Remove tab, remove the auto-attached pool.

3. On CLI, disable auto-pool and list consumed pool
[root@hp-z220-05 ~]# subscription-manager auto-attach --disable
Auto-attach preference: disabled
[root@hp-z220-05 ~]# subscription-manager  list --consumed
No consumed subscription pools to list

4. Valid certificate in /etc/pki/product-default/
[root@hp-z220-05 product-default]# rct cat-cert /etc/pki/product-default/*.pem

+-------------------------------------------+
        Product Certificate
+-------------------------------------------+

Certificate:
        Path: /etc/pki/product-default/69.pem
        Version: 1.0
        Serial: 12750047592154747473
        Start Date: 2016-11-08 19:33:04+00:00
        End Date: 2036-11-03 19:33:04+00:00

Subject:
        CN: Red Hat Product ID [69bd1f69-a20f-4c3e-b9a1-f6d05c2f0197]

Issuer:
        C: US
        CN: Red Hat Entitlement Product Authority
        O: Red Hat, Inc.
        OU: Red Hat Network
        ST: North Carolina
        emailAddress: ca-support

Product:
        ID: 69
        Name: Red Hat Enterprise Linux Server
        Version: 7.4 Beta
        Arch: x86_64
        Tags: rhel-7,rhel-7-server
        Brand Type: 
        Brand Name: 


5. Subscribe the specify pool "Red Hat Enterprise Linux for Virtual Datacenters, Standard"
[root@hp-z220-05 ~]# subscription-manager subscribe --pool=8ac903695bd51c25015bd5279e0a0213
Successfully attached a subscription for: Red Hat Enterprise Linux for Virtual Datacenters, Standard
[root@hp-z220-05 ~]# subscription-manager  list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   CloudForms (10-pack)
Provides:            Oracle Java (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat CloudForms Beta
                     Red Hat Enterprise Linux Server
                     Red Hat CloudForms
                     Red Hat Beta
                     Red Hat Software Collections (for RHEL Server)
SKU:                 MCT2358
Contract:            11261876
Account:             5758125
Serial:              1508148817519989888
Pool ID:             8ac903695bd51c25015bd527a1f503f2
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              02/26/2017
Ends:                02/25/2018
System Type:         Physical

Subscription Name:   Red Hat Enterprise Linux for Virtual Datacenters, Standard
Provides:            
SKU:                 RH00002
Contract:            11261867
Account:             5758125
Serial:              642175500493185993
Pool ID:             8ac903695bd51c25015bd5279e0a0213
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Stackable
Starts:              02/26/2017
Ends:                02/25/2018
System Type:         Physical


Result:
Although auto-attach has been disabled and system only specified to subscribe "Red Hat Enterprise Linux for Virtual Datacenters, Standard", system still auto subscribe another pool "CloudForms (10-pack)"

Comment 16 Jiri Hnidek 2017-05-15 12:09:14 UTC
I can't help myself. I reproduced everything step-by-step, but this is result of last command:

[root@localhost subscription_manager]# ./bin/subscription-manager list --consumed+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux for Virtual Datacenters, Standard
Provides:            
SKU:                 RH00002
Contract:            11261867
Account:             5758125
Serial:              425959188729822828
Pool ID:             Not Available
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   
Starts:              26.2.2017
Ends:                26.2.2018
System Type:         Physical

Comment 17 Kevin Howell 2017-05-15 14:21:21 UTC
From review of rhsm.log, this appears to be happening server-side (i.e. an auto-attach by Satellite is happening in the background).

Can you please confirm by disabling auto-attach in the Satellite WebUI before registering, and then repeating this scenario?

Comment 18 Liushihui 2017-05-17 05:57:37 UTC
Hi kevin, 

I'm sorry I haven't found a way to disabling auto-attach in the Satellite WebUI before registering. I think the key reason is host will auto-attach a pool in WebUI when run "subscription-manager auto-attach --disable" on CLI. 

The scenerio as the following:
1 On host CLI, register to satellite:
go to satellite WebUI, , host will auto attach a pool. The auto-attach option is enabled status.(It's correct)
2 On satellite WebUI, Remove the auto-attached pool:
On satellite WebUI, The auto-attached pool on step1 will be removed.The auto-attach option is enabled status.(It's correct)
3 On satellite WebUI, refresh host subscription page many times, the auto-attach option always enabled status and host hasn't auto-attached any pool..(It's correct)
4 On host CLI, Disable auto-attached pool:
go to Satellite WebUI, host has auto-attached a pool, The auto-attach option still enabled status.======> I think it's the key reason, disable auto-attach on CLI not only hasn't take any effect, but also make it auto-attach a pool on satellite WebUI. 

Thanks.
(In reply to Kevin Howell from comment #17)
> From review of rhsm.log, this appears to be happening server-side (i.e. an
> auto-attach by Satellite is happening in the background).
> 
> Can you please confirm by disabling auto-attach in the Satellite WebUI
> before registering, and then repeating this scenario?

Comment 19 Kevin Howell 2017-05-18 14:50:51 UTC
Moving to Satellite. When the user calls auto-attach --disable, this should be reflected in Satellite. In candlepin, when this call happens, we emit a consumer updated event. Katello should use this to update auto-attach for that content host in Satellite.

Comment 20 Bryan Kearney 2017-05-19 17:29:03 UTC
I am going to close this out. If you are using satelltie to manage, then the need to use subscription manager to manage the box is removed. I dont see us addressing this in the near term.

Comment 21 Barnaby Court 2017-06-28 15:24:57 UTC
*** Bug 1445190 has been marked as a duplicate of this bug. ***


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