Project

General

Profile

Actions

Bug #6476

closed

Unable to associate oVirt VM with multiple interfaces

Added by Trey Dockendorf over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources
Target version:
Difficulty:
Triaged:
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" 
  >
Actions #1

Updated by Dominic Cleal over 9 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
Actions #2

Updated by Anonymous over 9 years ago

  • Target version changed from 1.8.1 to 1.8.0
Actions #3

Updated by Anonymous over 9 years ago

  • Target version changed from 1.8.0 to 1.7.5
Actions #4

Updated by The Foreman Bot over 9 years ago

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

Updated by Dominic Cleal over 9 years ago

  • translation missing: en.field_release set to 10
Actions #6

Updated by Trey Dockendorf over 9 years ago

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

Also available in: Atom PDF