Red Hat Bugzilla – Bug 1374072
hammer csv can't import activation keys with multiple guest vdc subscriptions
Last modified: 2017-01-26 05:42:26 EST
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.
Created redmine issue http://projects.theforeman.org/issues/17052 from this bug
Upstream bug component is Uncategorized
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17052 has been resolved.
Upstream bug component is Hammer
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"""
Created attachment 1240999 [details] import debug
Upstream bug assigned to tomckay@redhat.com
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.
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.
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