Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1341177 - [RFE] Log "Cannot migrate VM" and "Cannot run VM" failures to "Events" tab (audit_log)
[RFE] Log "Cannot migrate VM" and "Cannot run VM" failures to "Events" tab (a...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.6.5
All Linux
high Severity medium
: ovirt-4.2.2
: ---
Assigned To: Arik
Israel Pinto
: FutureFeature
Depends On:
Blocks: 1425219 CEECIR_RHV43_proposed
  Show dependency treegraph
 
Reported: 2016-05-31 08:14 EDT by Julio Entrena Perez
Modified: 2018-05-16 13:01 EDT (History)
19 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-05-15 13:38:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
mavital: testing_plan_complete+


Attachments (Terms of Use)
failed to migrate vm (252.73 KB, image/png)
2017-11-05 09:08 EST, Israel Pinto
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2751901 None None None 2016-11-06 10:43 EST
oVirt gerrit 87443 master MERGED core: audit logs for validation failures on run/migrate vm 2018-02-15 13:33 EST
oVirt gerrit 87764 ovirt-engine-4.2 MERGED core: audit logs for validation failures on run/migrate vm 2018-02-18 03:53 EST
Red Hat Product Errata RHEA-2018:1488 None None None 2018-05-15 13:40 EDT

  None (edit)
Description Julio Entrena Perez 2016-05-31 08:14:50 EDT
Currently failures to start or live migrate a VM due to lack of resources in the cluster are logged to engine.log file and reported to the requester (via web ui, API) but those failures are not logged into audit_log (Events tab).

When using automation (e.g. CloudForms) against RHEV-M, logging these failures to Events tab (audit_log) would be useful for other teams (that might not have access to engine.log file in RHEV-M) to be able to see the reason for the failure.
Comment 2 Michal Skrivanek 2016-06-01 06:27:08 EDT
The error is returned during the REST API call. E.g.:
<action>
    <fault>
        <detail>[Cannot run VM. There is no host that satisfies current scheduling constraints. See below for details:, The host rhel7-host did not satisfy internal filter CPU because it does not have enough cores to run the VM.]</detail>
        <reason>Operation Failed</reason>
    </fault>
    <status>failed</status>
</action>

I believe that is the proper and best way. Suggested behavior would mean worse experience for RHEV portal users.
I'm suggesting WONTFIX in RHEV, it should be solved at CloudForms level to show the error message
Comment 27 Tomas Jelinek 2017-09-29 04:15:53 EDT
We are logging this two events into audit log. The reason you did not see them was this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1432127

Setting it to MODIFIED so it will eventually reach on_qa and receive an independent verification.
Comment 33 Israel Pinto 2017-11-05 08:34:40 EST
Failed QE:
Both cases are not written to audit log (Event log).
The migration case:
Migration Case: 
Migrate VM with 1 Host in cluster via REST
https://polarion.engineering.redhat.com/polarion/redirect/project/RHEVM3/workitem?id=RHEVM-23932
Results: See attached screenshot
The REST Returns: 
There are no hosts in ....
And you can see the error in Tasks tab only.

Run VM case:
Create VM in cluster with no host and Run VM
https://polarion.engineering.redhat.com/polarion/redirect/project/RHEVM3/workitem?id=RHEVM-23934
Vm Failed to run, operation failed with message, 
"There are no hosts to use. Check that the cluster contains at least one host in Up state."

In both cases nothing is written to event tab.
Comment 34 Israel Pinto 2017-11-05 09:08 EST
Created attachment 1348140 [details]
failed to migrate vm
Comment 37 Israel Pinto 2018-02-21 07:11:41 EST
Checked with:
Engine Version:4.2.2-0.1.el7

Cases:
1. Migration VM with 1 host in cluster via REST API:
2. Start VM with no host in cluster

Results:
Case 1: Failed wrong error message. 
Migration failed but the error message is not correct, response:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<action>
<async>false</async>
<fault>
<detail>[There are no hosts to use. Check that the cluster contains at least one host in Up state.]</detail>
<reason>Operation Failed</reason>
</fault>
<grace_period>
<expiry>10</expiry>
</grace_period>
<status>failed</status>
</action>

Case 2: Start VM with no host in cluster:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<action>
<async>false</async>
<fault>
<detail>[There are no hosts to use. Check that the cluster contains at least one host in Up state.]</detail>
<reason>Operation Failed</reason>
</fault>
<grace_period>
<expiry>10</expiry>
</grace_period>
<status>failed</status>
</action>
Comment 38 Arik 2018-02-21 08:22:18 EST
(In reply to Israel Pinto from comment #37)
Note that the response has not changed - you need to see that an audit log is produced in those cases.
Comment 39 Israel Pinto 2018-02-26 04:13:13 EST
Checked with:
Engine Version:4.2.2-0.1.el7

Cases:
1. Migration VM with 1 host in cluster via REST API:
2. Start VM with no host in cluster

Case 1:
2018-02-25 17:25:40,789+02 INFO  [org.ovirt.engine.core.sso.utils.AuthenticationUtils] (default task-23) [] User admin@internal successfully logged in with scopes: ovirt-app-api ovirt-ext=token-info:authz-search ovirt-ext=token-info:public-authz-search ovirt-ext=token-info:validate ovirt-ext=token:password-access
2018-02-25 17:25:40,838+02 INFO  [org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand] (default task-26) [67e1400] Running command: CreateUserSessionCommand internal: false.
2018-02-25 17:25:40,854+02 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-26) [67e1400] EVENT_ID: USER_VDC_LOGIN(30), User admin@internal-authz connecting from '10.35.4.108' using session 'RKzD4VbvDYmd0rr+PxoSb9lLEvH11pXsVXtdveyc6bQVLpf2qRY8VZ2R10dXU18GX63w2LZgV3s6lGXgTO2mIg==' logged in.
2018-02-25 17:25:40,926+02 INFO  [org.ovirt.engine.core.bll.MigrateVmCommand] (default task-26) [96b2c52a-1b0d-4818-a263-56cd144a2ef1] Lock Acquired to object 'EngineLock:{exclusiveLocks='[6e3b374e-4799-4081-9d1e-00efe9e1c6d2=VM]', sharedLocks=''}'
2018-02-25 17:25:41,065+02 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-26) [96b2c52a-1b0d-4818-a263-56cd144a2ef1] EVENT_ID: VM_MIGRATION_FAILED(65), Migration failed due to a failed validation: [There are no hosts to use. Check that the cluster contains at least one host in Up state.] (VM: golden_env_mixed_virtio_0, Source: host_mixed_1).
2018-02-25 17:25:41,065+02 WARN  [org.ovirt.engine.core.bll.MigrateVmCommand] (default task-26) [96b2c52a-1b0d-4818-a263-56cd144a2ef1] Validation of action 'MigrateVm' failed for user admin@internal-authz. Reasons: VAR__ACTION__MIGRATE,VAR__TYPE__VM,SCHEDULING_NO_HOSTS
2018-02-25 17:25:41,067+02 INFO  [org.ovirt.engine.core.bll.MigrateVmCommand] (default task-26) [96b2c52a-1b0d-4818-a263-56cd144a2ef1] Lock freed to object 'EngineLock:{exclusiveLocks='[6e3b374e-4799-4081-9d1e-00efe9e1c6d2=VM]', sharedLocks=''}'
2018-02-25 17:25:41,078+02 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-26) [] Operation Failed: [There are no hosts to use. Check that the cluster contains at least one host in Up state.]

Case 2:
engine.log:2018-02-25 17:19:11,717+02 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-21) [c3bd851b-753c-4565-bc75-f3a78ebc9c5e] EVENT_ID: USER_FAILED_RUN_VM(54), Failed to run VM golden_env_mixed_virtio_0 due to a failed validation: [There are no hosts to use. Check that the cluster contains at least one host in Up state.] (User: admin@internal-authz).
engine.log-2018-02-25 17:19:11,717+02 WARN  [org.ovirt.engine.core.bll.RunVmCommand] (default task-21) [c3bd851b-753c-4565-bc75-f3a78ebc9c5e] Validation of action 'RunVm' failed for user admin@internal-authz. Reasons: VAR__ACTION__RUN,VAR__TYPE__VM,SCHEDULING_NO_HOSTS
engine.log-2018-02-25 17:19:11,718+02 INFO  [org.ovirt.engine.core.bll.RunVmCommand] (default task-21) [c3bd851b-753c-4565-bc75-f3a78ebc9c5e] Lock freed to object 'EngineLock:{exclusiveLocks='[6e3b374e-4799-4081-9d1e-00efe9e1c6d2=VM]', sharedLocks=''}'
engine.log:2018-02-25 17:19:11,727+02 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-21) [] Operation Failed: [There are no hosts to use. Check that the cluster contains at least one host in Up state.]
Comment 43 errata-xmlrpc 2018-05-15 13:38:32 EDT
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/RHEA-2018:1488

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