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.
Among others, content-source-id and kickstart-repository-id need to be specified. Have a look at https://bugzilla.redhat.com/show_bug.cgi?id=1415707#c4 with an example of such a command. I'm going to close this until showed that this options as in https://bugzilla.redhat.com/show_bug.cgi?id=1415707#c4 were used and it still doesn't work.
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
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days