Bug 1315100 - Command 'org.ovirt.engine.core.bll.hostdev.RefreshHostDevicesCommand' failed: Failed managing transaction
Summary: Command 'org.ovirt.engine.core.bll.hostdev.RefreshHostDevicesCommand' failed:...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: 3.6.3.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.0.2
: 4.0.2.1
Assignee: Martin Betak
QA Contact: Nisim Simsolo
URL:
Whiteboard:
: 1336193 1358737 1395798 (view as bug list)
Depends On: 1306333
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-06 17:03 UTC by Christoph
Modified: 2016-11-23 07:35 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-08-22 12:32:30 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)
engine.log and vdsm.log (1.56 MB, application/x-gzip)
2016-03-06 17:03 UTC, Christoph
no flags Details
server.log (5.86 MB, text/plain)
2016-03-07 16:58 UTC, Christoph
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 60661 0 master MERGED backend: Filter orphaned Host Devieces on refresh 2021-01-18 11:35:50 UTC
oVirt gerrit 60759 0 ovirt-engine-4.0 MERGED backend: Filter orphaned Host Devieces on refresh 2021-01-18 11:35:50 UTC

Description Christoph 2016-03-06 17:03:52 UTC
Created attachment 1133534 [details]
engine.log and vdsm.log

Hi,

I have a oVirt Setup which includes two host. The first host is also
running the oVirt engine.
Today I installed a couple VMs on the second host from USB without any
issue. Now I tried to perform this also on the first host but it looks
like the USB is not accessible.

I'm able to add the device to the host but I can see the following
message in the engine.log which does not look correct.

I'm running oVirt 3.6.3.4-1.el7.centos

Let me know if you need more information.

Best regards
Christoph 

oVirt User List Thread:
http://lists.ovirt.org/pipermail/users/2016-March/038276.html

Comment 1 Martin Perina 2016-03-07 05:51:18 UTC
Martin, could you please take a look?

Comment 2 Martin Betak 2016-03-07 09:48:49 UTC
Hi Christoph,

please provide server.log so we can see the underlying cause of the transaction failure.

Comment 3 Martin Betak 2016-03-07 09:51:09 UTC
If I had to guess I'd say this is another manifestation of BZ#1306333 but let's wait for the server.log

Comment 4 Christoph 2016-03-07 16:58:47 UTC
Created attachment 1133874 [details]
server.log

Hi,

please find the server.log in the attachment.

Best regards
Christoph

Comment 5 Martin Betak 2016-03-08 10:25:54 UTC
Yes I can confirm this is a consequence of libvirt BZ#1306333 because it sends internaly inconsistent host devices to VDSM - more specifically the device named scsi_host8 is specified as parent of one device but not included in the listing.

Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "host_device" violates foreign key constraint "fk_host_device_parent_name"
  Detail: Key (host_id, parent_device_name)=(548efa0a-d053-4189-b45d-a0134270573f, scsi_host8) is not present in table "host_device".

I believe the best current workaround is the restart of libvirt daemon, then the reported devices should become internally consistent again and the RefreshHostDevicesCommand should succeed.

Comment 6 Christoph 2016-03-08 13:16:47 UTC
(In reply to Martin Betak from comment #5)
> Yes I can confirm this is a consequence of libvirt BZ#1306333 because it
> sends internaly inconsistent host devices to VDSM - more specifically the
> device named scsi_host8 is specified as parent of one device but not
> included in the listing.
> 
> Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on
> table "host_device" violates foreign key constraint
> "fk_host_device_parent_name"
>   Detail: Key (host_id,
> parent_device_name)=(548efa0a-d053-4189-b45d-a0134270573f, scsi_host8) is
> not present in table "host_device".
> 
> I believe the best current workaround is the restart of libvirt daemon, then
> the reported devices should become internally consistent again and the
> RefreshHostDevicesCommand should succeed.

Hi Martin,

it is possible to do that without stopping the VMs or should I stop all VMs first.

Best regards
Christoph

Comment 7 Martin Betak 2016-03-08 15:30:55 UTC
Hi Christoph,

I believe the proper *supported* way is to put the host to maintenance mode and only then you should restart some services on that host.


However.

----- BEGIN UNSUPPORTED ADVICE -----

In this instance my best judgement tells me this *should* be ok (restart just the libvirtd) and the system should survive this. (restarting vdsmd usually causes problems outside maint. mode), but note that in this case you are on your own.

----- END UNSUPPORTED ADVICE -----

Hope this helps :-)

Best regards,
Martin

Comment 8 Tomas Jelinek 2016-03-11 07:39:37 UTC
any news?

Comment 9 Christoph 2016-03-11 07:48:58 UTC
(In reply to Tomas Jelinek from comment #8)
> any news?

Hi Tomas,

I have to plan the shutdown for the VMs as they are in production.
Please let me know if it is important to get the feedback regarding the restart of the libvirt daemon.

If yes I could try to perform it on the weekend.

Best regards
Christoph

Comment 10 Tomas Jelinek 2016-03-11 08:10:27 UTC
Hi Christoph,

no, not that important.

Comment 11 Martin Perina 2016-05-16 08:15:30 UTC
*** Bug 1336193 has been marked as a duplicate of this bug. ***

Comment 12 Martin Polednik 2016-07-13 07:07:09 UTC
After further consideration, the bug should be fixed at engine level. VDSM does not work with assumption that the devices are single tree, and it's not even feasible due to possible filtering by device capability. Trying to "fix" this inside VDSM would create special (incorrect) case for the API verb.

Comment 13 Michal Skrivanek 2016-07-22 06:28:29 UTC
*** Bug 1358737 has been marked as a duplicate of this bug. ***

Comment 14 Nisim Simsolo 2016-08-22 11:10:41 UTC
Verified: 
ovirt-engine-4.0.2.7-0.1.el7ev
qemu-kvm-rhev-2.3.0-31.el7_2.21.x86_64
vdsm-4.18.11-1.el7ev.x86_64
libvirt-client-1.2.17-13.el7_2.5.x86_64
sanlock-3.2.4-3.el7_2.x86_64

Verification scenario:
1. Insert USB DOK to first host, refresh host capabilities, verify USB DOK is listed in host devices, attach it to VM, run VM and verify USB DOK is accessible from the VM.
2. Disconnect USB DOK from first host, connect it to second host, refresh host capabilities, verify USB DOK is listed in host devices, attach it to VM, run VM and verify USB DOK is accessible from the VM.

Comment 15 Tomas Jelinek 2016-11-18 13:59:19 UTC
*** Bug 1395798 has been marked as a duplicate of this bug. ***

Comment 16 Tomas Jelinek 2016-11-23 07:35:57 UTC
*** Bug 1395798 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.