Bug 1524622

Summary: associate VM - MAC compare is case senstive
Product: Red Hat Satellite Reporter: Paul Dudley <pdudley>
Component: Compute ResourcesAssignee: Dominik Hlavac Duran <dhlavacd>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.12CC: dchaudha, egolov, lhellebr, mhulan, mkalyat, oprazak, shisingh, vsedmik
Target Milestone: 6.6.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.22.0-0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 19:47:20 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 Paul Dudley 2017-12-11 18:15:33 UTC
Description of problem:
When trying to associate a vmware VM the following is hit:

Error: No host found to associate this VM with

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

Additional info:
Resolution:
In vi /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb change:

From this:
454-    def associated_host(vm)
455:      associate_by("mac", vm.mac)
456-    end

To this:
454-    def associated_host(vm)
455:      associate_by('mac', vm.interfaces.map(&:mac).map { |mac| Net::Validations.normalize_mac(mac) })
456-    end

It looks like this line would need to be changed for all other compute resource options as well.

Comment 2 Paul Dudley 2017-12-12 20:04:26 UTC
So far this change works just fine for vmware and libvirt compute resources, from tests done internally and by the customer.

Comment 3 Ondřej Pražák 2018-01-24 12:44:02 UTC
Connecting redmine issue http://projects.theforeman.org/issues/16520 from this bug

Comment 4 Bryan Kearney 2019-02-27 11:05:43 UTC
Upstream bug assigned to dhlavacd

Comment 5 Bryan Kearney 2019-03-31 14:05:53 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/16520 has been resolved.

Comment 6 Diksha Chaudhari 2019-05-09 08:46:49 UTC
*** Bug 1706998 has been marked as a duplicate of this bug. ***

Comment 9 Bryan Kearney 2019-10-22 19:47:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:3172