Bug 1384970

Summary: After host looses primary interface, primary interface cannot be added back to the profile
Product: Red Hat Satellite Reporter: Taft Sanders <tasander>
Component: FactAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.2.2CC: bbuckingham, dmoessne, jcallaha, mhulan, mmello, ohadlevy, sokeeffe, szadok, tasander, tstrachota
Target Milestone: UnspecifiedKeywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-21 13:11:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Taft Sanders 2016-10-14 12:56:38 UTC
Description of problem:
After creating a host from the Satellite webui under hosts > all hosts with 1 primary interface set. If the profile is saved without a primary interface, the host profile will not allow you to save any changes to the profile or select a new primary interface. Error given in the webui:

Oops, we're sorry but something went wrong Host::Base#name= delegated to primary_interface.name=, but primary_interface is nil: #<Host::Managed id: 29, name: "test46", last_compile: nil, last_report: nil, updated_at: "2016-10-14 12:43:19", created_at: "2016-10-14 12:42:41", root_pass: "$5$Gccv5/7h$9AxSRhnUoqRY5rrZBcbw4spU0MvDSn7O1EZYj4...", architecture_id: 1, operatingsystem_id: 2, environment_id: 2, ptable_id: 61, medium_id: nil, build: true, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: 2, owner_id: 3, owner_type: "User", enabled: true, puppet_ca_proxy_id: 1, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: 1, certname: nil, image_id: nil, organization_id: 1, location_id: 2, type: "Host::Managed", otp: "bC,DdAHGlZqk", realm_id: 1, compute_profile_id: 4, provision_method: "build", content_source_id: 1, grub_pass: "$5$Gccv5/7h$9AxSRhnUoqRY5rrZBcbw4spU0MvDSn7O1EZYj4...", content_view_id: 1, lifecycle_environment_id: 1, global_status: 0, lookup_value_matcher: "fqdn=test46.libvirtnode1.prov", discovery_rule_id: nil, openscap_proxy_id: nil>


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

How reproducible:
Every time

Steps to Reproduce:
1. Create host profile with primary interface with any number of NICs, submit
2. Select newly built host, edit, interface tab, edit nic, and remove primary check from the check box, click ok, and submit
3. Perform the same steps as step 2 except try to add one of the NICs as a primary, results in the error from above.

Actual results:
Oops, we're sorry but something went wrong Host::Base#name= delegated to primary_interface.name=, but primary_interface is nil: #<Host::Managed id: 29, name: "test46", last_compile: nil, last_report: nil, updated_at: "2016-10-14 12:43:19", created_at: "2016-10-14 12:42:41", root_pass: "$5$Gccv5/7h$9AxSRhnUoqRY5rrZBcbw4spU0MvDSn7O1EZYj4...", architecture_id: 1, operatingsystem_id: 2, environment_id: 2, ptable_id: 61, medium_id: nil, build: true, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: 2, owner_id: 3, owner_type: "User", enabled: true, puppet_ca_proxy_id: 1, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: 1, certname: nil, image_id: nil, organization_id: 1, location_id: 2, type: "Host::Managed", otp: "bC,DdAHGlZqk", realm_id: 1, compute_profile_id: 4, provision_method: "build", content_source_id: 1, grub_pass: "$5$Gccv5/7h$9AxSRhnUoqRY5rrZBcbw4spU0MvDSn7O1EZYj4...", content_view_id: 1, lifecycle_environment_id: 1, global_status: 0, lookup_value_matcher: "fqdn=test46.libvirtnode1.prov", discovery_rule_id: nil, openscap_proxy_id: nil>


Expected results:
Either, never be allowed to leave the profile with out having set a primary NIC
or
Allow to set primary NIC after removing all primarys

Additional info:
Without primary NIC being set, the "kickstart_networking_setup" template does not seem to render for review from the host page of the webui.

Comment 1 Marcelo Moreira de Mello 2016-10-14 15:34:34 UTC
* Adding KCS https://access.redhat.com/solutions/2706701

Comment 4 Brad Buckingham 2016-10-14 17:32:16 UTC
*** Bug 1384894 has been marked as a duplicate of this bug. ***

Comment 5 Brad Buckingham 2016-10-14 17:33:36 UTC
Refer to duplicate bug 1384894 for additional details/scenario.

Comment 10 Taft Sanders 2016-12-21 13:11:21 UTC
Closing as duplicate of bug 1389063.

*** This bug has been marked as a duplicate of bug 1389063 ***