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 1319079 - Unable to create a host via hammer
Summary: Unable to create a host via hammer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.2.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Corey Welton
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-18 15:29 UTC by Andrii Balakhtar
Modified: 2019-09-25 20:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:23:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 13966 0 None None None 2016-04-22 15:44:23 UTC

Description Andrii Balakhtar 2016-03-18 15:29:46 UTC
Description of problem:
Cannot create a host via hammer.
If you try to create a host without an interface, hammer throws following error 'Error: At least one interface must be set as primary', 
and if you try to create a host with interface specified - it throws 'Error: ApipieBindings::InvalidArgumentTypesError: host[interfaces_attributes][0] - Hash was expected'

Version-Release number of selected component (if applicable):
Sat6.2 Snap 4

How reproducible:
Always

Steps to Reproduce:
1. Try to create a host with valid data, e.g. 
hammer host create --medium-id="106" --root-pass="test" --mac="#mac#" --organization-id="212" --location-id="211" --architecture-id="104" --operatingsystem-id="102" --name="new_host" --environment-id="99" --domain-id="99" --puppet-proxy-id="1" --partition-table-id="180" --interface="primary=true,provision=true,identifier=enp4s0f0,type=interface,mac=#mac#,ip=#ip#"
2.
3.

Actual results:
Following error message is shown:
Could not create the host:
  Error: ApipieBindings::InvalidArgumentTypesError: host[interfaces_attributes][0] - Hash was expected

Expected results:
Host was successfully created

Additional info:

Comment 2 Marek Hulan 2016-03-23 09:23:00 UTC
This bug combines two issues - first is that primary interface must be specified which was fixed (http://projects.theforeman.org/issues/13927). Second is the attributes error which I linked and is also fixed (http://projects.theforeman.org/issues/13966)

Comment 6 Corey Welton 2016-03-31 16:07:21 UTC
I believe this works now?

# hammer host create --medium-id="9" --root-pass="changeme" --mac="2e-ba-bb-97-45-d6" --organization-id="1" --location-id="1" --architecture-id="1" --operatingsystem-id="1" --name="new_host" --environment-id="1" --domain-id="1" --puppet-proxy-id="1" --partition-table-id="1" --interface="primary=true,provision=true,identifier=enp4s0f0,type=interface,mac=2e-ba-bb-97-45-d6,ip=192.168.1.200" --name "frobble"
[Foreman] Password for admin: 
Host created

Comment 7 Corey Welton 2016-03-31 18:17:19 UTC
Above ^ was executed against SNAP6.  If it is not verified correctly, please reopen, but reading the initial report, I believe this suffices.

Comment 9 Bryan Kearney 2016-07-27 11:23:43 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-2016:1501


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