Bug 767470
Summary: | Unable to fetch subscription serial numbers from cli | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Sachin Ghai <sghai> |
Component: | API | Assignee: | Martin Bacovsky <mbacovsk> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Katello QA List <katello-qa-list> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.0.0 | CC: | bkearney, lzap |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-08-22 18:13:50 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 747354 |
Description
Sachin Ghai
2011-12-14 06:46:51 UTC
I'm not sure what this option will return but expecting the same serial number as given by subscription-manager tool on client side: [root@dhcp201-107 ~]# subscription-manager list --consumed +-------------------------------------------+ Consumed Product Subscriptions +-------------------------------------------+ ProductName: Red Hat Enterprise Linux Server ContractNumber: 2270949 AccountNumber: 540155 SerialNumber: 2746065822361762587 Active: True QuantityUsed: 1 Begins: 09/20/2011 Expires: 12/02/2013 Taking It is not clear what was intended behaviour of --serials option. I would recommend following change: List consumed subscriptions: system subscriptions --name dhcp201-107.englab.pnq.redhat.com --org ACME_Corporation List available subscriptions: system subscriptions --name dhcp201-107.englab.pnq.redhat.com --org ACME_Corporation --available Given that the ProvidedProducts list will be formatted, would that be acceptable? Is certificate serial number neccessary to be included in the consumed subscription list? I didn't found it in the UI and the unsubscription from CLI uses poolId, which is already present in the list. The serial number is required to unsubscribe a product via rhsm.
like:
1. first list the consumed subscriptions
subscription-manager list --consumed ==> it will give you the serial number
2. subscription-manager unsubscribe --serial <SerialNumber> ==> here pass the serial number that you fetched in step1.
So I was trying to do the same thing from katello server and tried to fetch serial number with katello cli and got:
>> Serial parameter cannot be used with available
Later, I discussed with Garik and he suggested to use:
1. katello> system subscriptions --name dhcp193-155.pnq.redhat.com --org
ACME_Corporation ==> this will list the "EntitlementId" that we need to pass at step2.
2. system unsubscribe --org ACME_Corporation --name
dhcp193-155.pnq.redhat.com --pool <entitlement_id>
So here confusion arises just because of different naming conventions. In katello cli api, we can unsubscribe a product via "Entitlement id" however in rhsm we need to pass the serial number.
So for this defect, I think we should remove the --serial option as its not required. And if possible we should follow the same naming convention as in rhsm.
Since katello-0.1.195-1 and katello-cli-0.1.41-1 the CLI is fixed as follows CLI: system unsubscribe --org <org> --name <name> --entitlement <ent_id> system unsubscribe --org <org> --name <name> --serial <serial_id> system unsubscribe --org <org> --name <name> --all Serial and entitlement ids are listed via: system subscrptions --org <org> --name <name> Available pools via system subscrptions --org <org> --name <name> --available Verified with following katello builds: katello-cli-0.1.42-1.el6.noarch katello-0.1.195-1.el6.noarch subscription serial number is available via following cmds: katello> system subscribe --pool 8ac1490f351385470135149be97f0039 --org ACME_Corporation --name dhcp193-78.pnq.redhat.com Successfully subscribed System [ dhcp193-78.pnq.redhat.com ] katello> system subscriptions --org ACME_Corporation --name dhcp193-78.pnq.redhat.com ---------------------------------------------------------------------------------------------- Current Subscriptions for System [ dhcp193-78.pnq.redhat.com ] ---------------------------------------------------------------------------------------------- EntitlementId: 8ac1490f35138547013514be662b003b Serial Id: 3219094884821188044 PoolName: pulp Expires: 01/17/2042 Consumed: 1 Quantity: 1 Sla: ContractNumber: Provided products: katello> |