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 1374072 - hammer csv can't import activation keys with multiple guest vdc subscriptions
Summary: hammer csv can't import activation keys with multiple guest vdc subscriptions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer - Content
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Tom McKay
QA Contact: jcallaha
URL:
Whiteboard:
Depends On:
Blocks: 1405487
TreeView+ depends on / blocked
 
Reported: 2016-09-07 21:09 UTC by jcallaha
Modified: 2019-09-25 21:20 UTC (History)
7 users (show)

Fixed In Version: tfm-rubygem-hammer_cli_csv-2.2.1.1-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1405487 (view as bug list)
Environment:
Last Closed: 2017-01-26 10:42:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
import debug (46.39 KB, text/plain)
2017-01-15 18:52 UTC, jcallaha
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17052 0 None None None 2016-10-20 19:11:27 UTC
Red Hat Product Errata RHBA-2017:0197 0 normal SHIPPED_LIVE Satellite 6.2.7 Async Bug Release 2017-01-26 15:38:38 UTC

Description jcallaha 2016-09-07 21:09:31 UTC
Description of problem:
When attempting to re-import an activation key that has multiple guest vdc subscriptions attached, you are presented with the following error:
Error: Too many subscriptions match 'Red Hat Enterprise Linux for Virtual Datacenters, Premium'

Version-Release number of selected component (if applicable):
Satellite 6.2.2

How reproducible:
Always

Steps to Reproduce:
1. Setup virt-who with at least one hypervisor
2. Add the guest subscriptions provided by each of the hypervisors.
3. Export the activation key(s) using hammer csv
4. re-import the activation key(s) using hammer csv

Actual results:
Error message above is shown and unable to progress further.

Expected results:
The tool is able to correctly handle the multiple vdc guest subscriptions.

Comment 3 Andrew Kofink 2016-10-20 19:11:25 UTC
Created redmine issue http://projects.theforeman.org/issues/17052 from this bug

Comment 4 Bryan Kearney 2016-10-20 20:09:39 UTC
Upstream bug component is Uncategorized

Comment 5 Bryan Kearney 2016-12-13 21:07:43 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17052 has been resolved.

Comment 6 Bryan Kearney 2016-12-16 19:07:26 UTC
Upstream bug component is Hammer

Comment 7 Bryan Kearney 2016-12-16 19:07:30 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17052 has been resolved.

Comment 8 Bryan Kearney 2016-12-16 19:08:56 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17052 has been resolved.

Comment 9 Bryan Kearney 2016-12-16 19:15:11 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17052 has been resolved.

Comment 10 jcallaha 2017-01-15 18:50:44 UTC
Failed QA in Satellite 6.2.7 Snap 1

The activation key still fails to import. Looking at the csv file, there doesn't seem to be any data distinguishing one vdc guest sub from another. Will attach debug output as well.

-bash-4.2# hammer -u admin -p changeme csv activation-keys --export --file akeys.csv --organization "Default Organization"
-bash-4.2# cat akeys.csv 
Name,Organization,Description,Limit,Environment,Content View,Host Collections,Auto-Attach,Service Level,Release Version,Subscriptions
rhel7 tools,Default Organization,,,,rhel7 tools,"",Yes,,,""
multi vdc,Default Organization,,,,rhel7 tools,"",Yes,,,"""1|RH00001|Red Hat Enterprise Linux for Virtual Datacenters, Premium|11045754|477931"",""1|RH00001|Red Hat Enterprise Linux for Virtual Datacenters, Premium|11045754|477931"",""1|RH00001|Red Hat Enterprise Linux for Virtual Datacenters, Premium|11045754|477931"""
-bash-4.2# hammer -u admin -p changeme csv activation-keys --file akeys.csv --organization "Default Organization"
Error: No matching subscriptions
multi vdc,Default Organization,,,,rhel7 tools,"",Yes,,,"""1|RH00001|Red Hat Enterprise Linux for Virtual Datacenters, Premium|11045754|477931"",""1|RH00001|Red Hat Enterprise Linux for Virtual Datacenters, Premium|11045754|477931"",""1|RH00001|Red Hat Enterprise Linux for Virtual Datacenters, Premium|11045754|477931"""

Comment 11 jcallaha 2017-01-15 18:52:16 UTC
Created attachment 1240999 [details]
import debug

Comment 12 Satellite Program 2017-01-16 09:07:52 UTC
Upstream bug assigned to tomckay

Comment 13 Tom McKay 2017-01-16 13:20:24 UTC
Use the --itemized-subscriptions when exporting/importing activation-keys with VDC subscriptions in them. Without that flag you are correct in that there is not full info to recreate.

Comment 15 jcallaha 2017-01-16 16:07:54 UTC
Verified in Satellite 6.2.7 Snap 1

I first exported the current activation keys, two of which had vdc guest subscriptions.

-bash-4.2# hammer -u admin -p changeme csv activation-keys --export --file akeys.csv --organization "Default Organization" --itemized-subscriptions
-bash-4.2# 
-bash-4.2# cat akeys.csv 
Name,Organization,Description,Limit,Environment,Content View,Host Collections,Auto-Attach,Service Level,Release Version,Subscription Name,Subscription Type,Subscription Quantity,Subscription SKU,Subscription Contract,Subscription Account,Subscription Start,Subscription End,Subscription Guest
tom multi vdc,Default Organization,,,,Default Organization View,"",Yes,,,"Red Hat Enterprise Linux for Virtual Datacenters, Premium",Red Hat Guest,1,RH00001,11045754,477931,2016-08-04T04:00:00+00:00,2022-01-01T04:59:59+00:00,virt-who-ironforge.satellite.lab.eng.rdu2.redhat.com-1
tom multi vdc,Default Organization,,,,Default Organization View,"",Yes,,,"Red Hat Enterprise Linux for Virtual Datacenters, Premium",Red Hat Guest,1,RH00001,11045754,477931,2016-08-04T04:00:00+00:00,2022-01-01T04:59:59+00:00,virt-who-inorbit.hq.gsslab.rdu.redhat.com-1
tom multi vdc,Default Organization,,,,Default Organization View,"",Yes,,,"Red Hat Enterprise Linux for Virtual Datacenters, Premium",Red Hat Guest,1,RH00001,11045754,477931,2016-08-04T04:00:00+00:00,2022-01-01T04:59:59+00:00,virt-who-bulgaria.hq.gsslab.rdu.redhat.com-1
rhel7 tools,Default Organization,,,,rhel7 tools,"",Yes,,,"Red Hat Enterprise Linux for Virtual Datacenters, Premium",Red Hat Guest,1,RH00001,11045754,477931,2016-08-04T04:00:00+00:00,2022-01-01T04:59:59+00:00,virt-who-nightwing.hq.gsslab.rdu.redhat.com-1
no vdc,Default Organization,,,,rhel7 tools,"",Yes,,,627,Custom,1,1484498805923,,,2017-01-15T16:46:45+00:00,2047-01-08T16:46:45+00:00,
7capsule,Default Organization,,,,rhel7 capsule,"",Yes,,,Red Hat Satellite Employee Subscription,Red Hat,1,SER0232US,10538625,477931,2014-09-19T04:00:00+00:00,2022-01-01T04:59:59+00:00,
7capsule,Default Organization,,,,rhel7 capsule,"",Yes,,,627,Custom,1,1484498805923,,,2017-01-15T16:46:45+00:00,2047-01-08T16:46:45+00:00,

I then removed a vdc guest sub from the "tom multi vdc" activation key and re-imported.

-bash-4.2# hammer -u admin -p changeme csv activation-keys --file akeys.csv --organization "Default Organization" --itemized-subscriptions

The re-import successfully restored the missing subscription.

Comment 17 errata-xmlrpc 2017-01-26 10:42:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0197


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