Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionAmaani S Karimi
2018-05-04 18:10:25 UTC
Description of problem:
creating a host using REST API fails with error Medium can't be blank
Version-Release number of selected component (if applicable):
Satellite 6.3.1
How reproducible:
Always
Steps to Reproduce:
curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X POST -u admin:redhat -k -d "{\"name\":\"testhost\",\"domain_name\":\"lab.example.com\",\"operatingsystem_name\":\"RHEL Server 7.5\",\"organization_id\":\"1\",\"mac\":\"52-54-00-57-83-33\",\"build\":true,\"ip\":\"192.168.123.10\",\"architecture_name\":\"x86_64\",\"ptable_name\":\"Kickstart default\",\"root_pass\":\"changeme\",\"location_id\":\"2\"}" https://$(hostname -f)/api/v2/hosts
{
"error": {"id":null,"errors":{"medium_id":["can't be blank"]},"full_messages":["Medium can't be blank"]}
}
Actual results:
As we fully support synced media [1] for kickstart repository, I assume passing medium_id shouldn't be mandatory. This should automatically resolve to the correct media.
[1] - https://bugzilla.redhat.com/show_bug.cgi?id=1382775
Also, we don't know what medium_id to pass in as we don't expose media listing using either hammer or foreman-rake console
Expected results:
Creating a host with REST API should work as expected.
**WORKAROUND**
Create a Host Group with the Operating System selection already filled in it.
curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X POST -u admin:redhat -k -d "{\"name\":\"testhost\",\"hostgroup_id\":\"2\",\"mac\":\"52-54-00-57-83-33\",\"build\":true,\"ip\":\"192.168.123.10\",\"organization_id\":\"1\",\"location_id\":\"2\"}" https://$(hostname -f)/api/v2/hosts
NOTE: From the end user point of view, this will be a tedious process as he would need to create a Host Group for each operating that he would like to build.
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in one month's time. If you have any concerns about this, please contact your Red Hat Account team. Thank you.
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact your Red Hat Account Team. Thank you.
Hi,
By implementing the solution specified in the following KCS article - https://access.redhat.com/solutions/3433051 the issue got resolved.
However, it breaks the possibility to inherit values from parent objects.
The customer has asked for fixing the bugzilla.
Please let me know what to tell them further.
Thanks & Regards,
Anand Jambhulkar
Comment 11Red Hat Bugzilla
2023-09-15 00:07:58 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days
Comment 13Red Hat Bugzilla
2025-02-10 03:59:17 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.
Description of problem: creating a host using REST API fails with error Medium can't be blank Version-Release number of selected component (if applicable): Satellite 6.3.1 How reproducible: Always Steps to Reproduce: curl -H "Accept:application/json,version=2" -H "Content-Type:application/json" -X POST -u admin:redhat -k -d "{\"name\":\"testhost\",\"domain_name\":\"lab.example.com\",\"operatingsystem_name\":\"RHEL Server 7.5\",\"organization_id\":\"1\",\"mac\":\"52-54-00-57-83-33\",\"build\":true,\"ip\":\"192.168.123.10\",\"architecture_name\":\"x86_64\",\"ptable_name\":\"Kickstart default\",\"root_pass\":\"changeme\",\"location_id\":\"2\"}" https://$(hostname -f)/api/v2/hosts { "error": {"id":null,"errors":{"medium_id":["can't be blank"]},"full_messages":["Medium can't be blank"]} } Actual results: As we fully support synced media [1] for kickstart repository, I assume passing medium_id shouldn't be mandatory. This should automatically resolve to the correct media. [1] - https://bugzilla.redhat.com/show_bug.cgi?id=1382775 Also, we don't know what medium_id to pass in as we don't expose media listing using either hammer or foreman-rake console Expected results: Creating a host with REST API should work as expected.