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 1483249 - CLI/API for creating hosts should provide better message when medium is missing
Summary: CLI/API for creating hosts should provide better message when medium is missing
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts - Content
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-19 16:00 UTC by Kedar Bidarkar
Modified: 2019-08-12 16:27 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 17:47:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
more information related to hostgroup info (4.85 KB, text/plain)
2017-08-19 16:01 UTC, Kedar Bidarkar
no flags Details

Description Kedar Bidarkar 2017-08-19 16:00:57 UTC
Description of problem:

2017-08-19 11:42:25 1b02167a [app] [I]   Parameters: {"host"=>{"name"=>"rhel-6-libvirt3", "location_id"=>2, "organization_id"=>1, "operatingsystem_id"=>3, "pxe_loader"=>"PXELinux BIOS", "compute_resource_id"=>1, "hostgroup_id"=>1, "build"=>true, "enabled"=>true, "managed"=>true, "compute_attributes"=>{"cpus"=>"1", "memory"=>"1073741824", "start"=>"1", "volumes_attributes"=>{"0"=>{"capacity"=>"10G", "format_type"=>"qcow2"}}}, "content_facet_attributes"=>{}, "subscription_facet_attributes"=>{}, "overwrite"=>true, "host_parameters_attributes"=>[], "interfaces_attributes"=>[{"primary"=>"true", "compute_attributes"=>{"type"=>"bridge", "bridge"=>"katello_latest", "model"=>"virtio"}}], "root_pass"=>"[FILTERED]"}, "apiv"=>"v2"}
2017-08-19 11:42:25 1b02167a [app] [I] Current user: foreman_admin (administrator)
2017-08-19 11:42:25 1b02167a [app] [I] Current user: foreman_admin (administrator)
2017-08-19 11:42:25 1b02167a [app] [I] Current user: admin (administrator)
2017-08-19 11:42:25 1b02167a [app] [I] Authorized user admin(Admin User)
2017-08-19 11:42:25 1b02167a [app] [I] Current user: admin (administrator)
2017-08-19 11:42:28 1b02167a [app] [E] Unprocessable entity Host::Managed (id: new):
 |   Medium can't be blank
 | 
2017-08-19 11:42:28 1b02167a [app] [I]   Rendered api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout (1.4ms)
2017-08-19 11:42:28 1b02167a [app] [I] Completed 422 Unprocessable Entity in 2298ms (Views: 2.4ms | ActiveRecord: 23.8ms)

Version-Release number of selected component (if applicable):

Satellite 6.3.0-snap11.0


How reproducible:


Steps to Reproduce:
1. create hostgroup via hammer cli only ( do not edit hostgroup or create hostgroup via UI , if done not reproducible ever with the host-group)

satellite hostgroup create --name='RHEL 7 Server 64-bit HG' --content-view='RHEL 7 CV' --environment-id="${PUPPET_ENV}" --lifecycle-environment='DEV' --content-source-id="${CAPSULE_ID}" --puppet-proxy="$(hostname)" --puppet-ca-proxy="$(hostname)" --query-organization-id="${ORG}" --puppet-classes='access_insights_client,foreman_scap_client' --domain-id="${DOMAIN_ID}" --subnet="${SUBNET_NAME}" --architecture='x86_64' --operatingsystem-id="${RHEL7_OS_ID}" --partition-table='Kickstart default' --location-ids="${LOC}"

satellite hostgroup set-parameter --hostgroup='RHEL 7 Server 64-bit HG' --name='kt_activation_keys' --value='ak-rhel-7


2. create host via hammer cli

hammer -u admin -p changeme  host create --name='rhel-6-libvirt3' --root-password='changeme' --organization-id="1" --location-id="2" --hostgroup="RHEL 6 Server 64-bit HG" --compute-resource="libvirt" --compute-attributes="cpus=1, memory=1073741824, start=1" --interface="primary=true, compute_type=bridge, compute_bridge=katello_latest, compute_model=virtio" --volume="capacity=10G,format_type=qcow2" --operatingsystem-id 3 --pxe-loader 'PXELinux BIOS' 


Actual results:

Unable to create host,

hammer -u admin -p changeme  host create --name='rhel-7-libvirt1' --root-password='changeme' --organization-id="1" --location-id="2" --hostgroup="RHEL 7 Server 64-bit HG" --compute-resource="libvirt" --compute-attributes="cpus=1, memory=1073741824, start=1" --interface="primary=true, compute_type=bridge, compute_bridge=foreman, compute_model=virtio" --volume="capacity=10G,format_type=qcow2" --operatingsystem-id 3 --pxe-loader 'PXELinux BIOS'
Could not create the host:
  Medium can't be blank

Expected results:

We should be able to create host successfully.


Additional info:

Comment 1 Kedar Bidarkar 2017-08-19 16:01:56 UTC
Created attachment 1315773 [details]
more information related to hostgroup info

Comment 2 Kedar Bidarkar 2017-08-19 16:03:14 UTC
A host-group created via UI would allow the creation of host.

Do not edit hostgroup or create hostgroup via UI , this bug is not reproducible.

Comment 4 Tomas Strachota 2017-08-21 10:39:25 UTC
Kedar,
could you please provide full output of the hammer commands in debug mode for:
1. hostgroup create
2. hostgroup info
3. host create

Also, what exactly is the "satellite" command, please?

Comment 5 Tomas Strachota 2017-08-21 10:58:09 UTC
Btw the hostgroup create is missing --kickstart-repository-id (which is probably autocompleted in the UI when a CV is selected) and therefore satellite tries to use "All Media" which is not assigned either.

Comment 6 Kedar Bidarkar 2017-08-22 16:31:53 UTC
satellite is a function, sorry my bad. 

satellite == 'hammer -u admin -p changeme'

Comment 8 Kedar Bidarkar 2017-08-22 16:40:27 UTC
Host creation worked, if I 

1) first added --kickstart-repository-id to hostgroup using the "hostgroup update"
2) Then creating a host using the updated host-group.


I feel, then this bug should be tracking about letting the end user know , what is missing while creating the Host, as

1) "hostgroup create" does not make providing "--kickstart-repository-id " compulsory.
2) "host create" mentions "medium can't be blank".

So, the end user has no way of knowing what exactly is missing while creating a Host with Host-Group.

Comment 10 Tomas Strachota 2017-08-23 08:00:42 UTC
I agree. I updated the BZ title accordingly.

In the cli I would expect a message like:
"Medium can't be blank. Please provide either --kickstart-repository or --medium."

Comment 11 Lukáš Hellebrandt 2018-05-31 11:51:10 UTC
"Medium can't be blank" error message is also shown when --kickstart-repository is set but there is not set some other required parameter, like --content-source-id. This misleads the user to think they have to specify both --kickstart-repository and --medium.

Comment 12 Bryan Kearney 2018-09-04 17:47:00 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.


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