Actions
Bug #6476
closedUnable to associate oVirt VM with multiple interfaces
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"
>
Updated by Dominic Cleal over 10 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
Updated by Anonymous over 10 years ago
- Target version changed from 1.8.1 to 1.8.0
Updated by Anonymous over 10 years ago
- Target version changed from 1.8.0 to 1.7.5
Updated by The Foreman Bot over 10 years ago
- Pull request https://github.com/theforeman/foreman/pull/1693 added
Updated by Dominic Cleal over 10 years ago
- Translation missing: en.field_release set to 10
Updated by Trey Dockendorf over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 5743465be5ecf59d94b37e728ab46f9d00ade6e2.
Actions