Project

General

Profile

Bug #6476

Unable to associate oVirt VM with multiple interfaces

Added by Trey Dockendorf almost 5 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

I have a Host in Foreman that was associated to a Libvirt compute resource. I disassociated it after migrating it to oVirt. When I attempt to re-associate that VM to the oVirt compute resource it fails with "No host found to associate this VM with".

Looking at the Rails console I see it's trying to query the DB using wrong MAC address as the search condition.

> Host.find_by_name('syslog.brazos.tamu.edu').mac
  Host::Managed Load (0.2ms)  SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`type` IN ('Host::Managed') AND `hosts`.`name` = 'syslog.brazos.tamu.edu' LIMIT 1
=> "52:54:00:ea:a8:40" 
> @compute_resource = ComputeResource.find(2)
> @vm = @compute_resource.find_vm_by_uuid('534078e6-678b-4490-8f68-60d002881ca2')
> host = @compute_resource.associated_host(@vm) if @compute_resource.respond_to?(:associated_host)
  Host::Managed Load (1.2ms)  SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`type` IN ('Host::Managed') AND `hosts`.`mac` = '52:54:00:dc:9d:bd' LIMIT 1
=> nil

That host's secondary interface is used in the SELECT statement. My guess is because when the two are "sorted", that one is first.

irb(main):018:0> @vm.interfaces
=>   <Fog::Compute::Ovirt::Interfaces
    [
      <Fog::Compute::Ovirt::Interface
        id="d257a1a3-82b3-457e-9da2-364d0b269b38",
        name="eth1",
        network="3d3dac29-4642-4df1-a860-91606d6c08ab",
        interface="virtio",
        mac="52:54:00:dc:9d:bd" 
      >,
      <Fog::Compute::Ovirt::Interface
        id="218c9e72-6b1b-4fe7-a807-dc177ef7f9ef",
        name="eth0",
        network="00000000-0000-0000-0000-000000000009",
        interface="virtio",
        mac="52:54:00:ea:a8:40" 
      >
    ]
  >
irb(main):019:0> @vm.interfaces.first
=>   <Fog::Compute::Ovirt::Interface
    id="d257a1a3-82b3-457e-9da2-364d0b269b38",
    name="eth1",
    network="3d3dac29-4642-4df1-a860-91606d6c08ab",
    interface="virtio",
    mac="52:54:00:dc:9d:bd" 
  >

Associated revisions

Revision 5743465b (diff)
Added by Trey Dockendorf almost 5 years ago

Fixes #6476 - oVirt VM association with multiple interfaces

Revision 1fd5c365 (diff)
Added by Trey Dockendorf over 4 years ago

Fixes #6476 - oVirt VM association with multiple interfaces

(cherry picked from commit 5743465be5ecf59d94b37e728ab46f9d00ade6e2)

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Category set to Compute resources
  • Status changed from New to Ready For Testing
  • Assignee set to Trey Dockendorf
  • Target version set to 1.8.1

#2 Updated by Dmitri Dolguikh almost 5 years ago

  • Target version changed from 1.8.1 to 1.8.0

#3 Updated by Dmitri Dolguikh almost 5 years ago

  • Target version changed from 1.8.0 to 1.7.5

#4 Updated by The Foreman Bot almost 5 years ago

  • Pull request https://github.com/theforeman/foreman/pull/1693 added

#5 Updated by Dominic Cleal almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 10

#6 Updated by Trey Dockendorf almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF