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:
Created attachment 1315773 [details] more information related to hostgroup info
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.
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?
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.
satellite is a function, sorry my bad. satellite == 'hammer -u admin -p changeme'
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.
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."
"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.
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.