Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1374072 - hammer csv can't import activation keys with multiple guest vdc subscriptions
hammer csv can't import activation keys with multiple guest vdc subscriptions
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer - Content (Show other bugs)
6.2.0
Unspecified Unspecified
medium Severity medium (vote)
: 6.2.7
: Unused
Assigned To: Tom McKay
jcallaha
: Triaged
Depends On:
Blocks: 1405487
  Show dependency treegraph
 
Reported: 2016-09-07 17:09 EDT by jcallaha
Modified: 2017-01-26 05:42 EST (History)
7 users (show)

See Also:
Fixed In Version: tfm-rubygem-hammer_cli_csv-2.2.1.1-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1405487 (view as bug list)
Environment:
Last Closed: 2017-01-26 05:42:26 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 17052 None None None 2016-10-20 15:11 EDT
Red Hat Product Errata RHBA-2017:0197 normal SHIPPED_LIVE Satellite 6.2.7 Async Bug Release 2017-01-26 10:38:38 EST

  None (edit)
Description jcallaha 2016-09-07 17:09:31 EDT
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 15:11:25 EDT
Created redmine issue http://projects.theforeman.org/issues/17052 from this bug
Comment 4 Bryan Kearney 2016-10-20 16:09:39 EDT
Upstream bug component is Uncategorized
Comment 5 Bryan Kearney 2016-12-13 16:07:43 EST
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 14:07:26 EST
Upstream bug component is Hammer
Comment 7 Bryan Kearney 2016-12-16 14:07:30 EST
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 14:08:56 EST
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 14:15:11 EST
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 13:50:44 EST
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 13:52 EST
Created attachment 1240999 [details]
import debug
Comment 12 pm-sat@redhat.com 2017-01-16 04:07:52 EST
Upstream bug assigned to tomckay@redhat.com
Comment 13 Tom McKay 2017-01-16 08:20:24 EST
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 11:07:54 EST
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 05:42:26 EST
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.