Bug 1992177

Summary: Inventory supports additional RHV events
Product: Migration Toolkit for Virtualization Reporter: Jeff Ortel <jortel>
Component: InventoryAssignee: Jeff Ortel <jortel>
Status: CLOSED ERRATA QA Contact: Tzahi Ashkenazi <tashkena>
Severity: high Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 2.1.0CC: fdupont
Target Milestone: ---   
Target Release: 2.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-26 07:09:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Ortel 2021-08-10 17:26:15 UTC
Need to add support for RHV events:

	USER_ADD_STORAGE_DOMAIN              = 956
	USER_UPDATE_STORAGE_DOMAIN           = 958
	USER_REMOVE_STORAGE_DOMAIN           = 960
	USER_DETACH_STORAGE_DOMAIN_FROM_POOL = 964

	USER_VDS_MAINTENANCE                = 600
	USER_VDS_MAINTENANCE_WITHOUT_REASON = 620
	USER_VDS_MAINTENANCE_MANUAL_HA      = 10453
	VDS_DETECTED                        = 13

	SYSTEM_UPDATE_VM                               = 253
	USER_REMOVE_VM_FINISHED_INTERNAL               = 1130
	USER_REMOVE_VM_FINISHED_ILLEGAL_DISKS          = 172
	USER_REMOVE_VM_FINISHED_ILLEGAL_DISKS_INTERNAL = 1720
	IMPORTEXPORT_IMPORT_VM                         = 1152
	USER_CHANGE_DISK_VM                            = 38

Ref: https://docs.google.com/document/d/1P2uSsxlxaCoJzFctVNIWV8Lvot5IuOiqSI6xdJqIPLU/edit#

Comment 1 Ilanit Stein 2021-08-17 03:37:22 UTC
Fixed in MTV build 2.1.0-52 / IIB 98758

Comment 2 Tzahi Ashkenazi 2021-08-18 09:12:08 UTC
Tested on cloud20 :
MTV -2.1.0-52
CNV - v4.8.0-451


Tested 2 events : 
1. USER_UPDATE_STORAGE_DOMAIN = 958
2. MPORTEXPORT_IMPORT_VM = 1152


EVENT 1152:
From rhev engine "IMPORTEXPORT_IMPORT_VM":
2021-08-18 04:49:40,042-04 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (EE-ManagedScheduledExecutorService-engineScheduledThreadPool-Thread-35) [] EVENT_ID: IMPORTEXPORT_IMPORT_VM(1,152), Vm bz1992177- was imported successfully to Data Center L0_Group_0, Cluster L0_Group_0_iscsi

From the inventory log  code":"1152 :
{"level":"info","ts":1629277201.749968,"logger":"collector|ovirt","msg":"Event applied.","provider":"openshift-mtv/rhev01","event":{"id":"3204327","code":"1152","description":"Vm v2v-rhel8-vm was imported successfully to Data Center L0_Group_0, Cluster L0_Group_0","data_center":{"href":"/ovirt-engine/api/datacenters/25067f1d-8caa-418f-814d-14c779383c25","id":"25067f1d-8caa-418f-814d-14c779383c25"},"cluster":{"href":"/ovirt-engine/api/clusters/6b54093a-e3b2-4a75-b0c9-8f8fb23cde9f","id":"6b54093a-e3b2-4a75-b0c9-8f8fb23cde9f"},"host":{"href":"","id":""},"vm":{"href":"/ovirt-engine/api/vms/6261ea28-71f9-4355-bba4-d54ba386dac8","id":"6261ea28-71f9-4355-bba4-d54ba386dac8"}}}


EVENT 958:
From rhev engine "USER_UPDATE_STORAGE_DOMAIN"  :
2021-08-18 04:42:23,538-04 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-222) [27e58817-46dd-4c32-9e47-a36af70fb811] EVENT_ID: USER_UPDATE_STORAGE_DOMAIN(958), Storage Domain L0_Group_0_new was updated by admin@internal-authz

From the inventory log  code":"958": 
{"level":"info","ts":1629276164.0845678,"logger":"collector|ovirt","msg":"Event received.","provider":"openshift-mtv/rhev01","event":{"id":"3204238","code":"958","description":"Storage Domain L0_Group_0_new was updated by admin@internal-authz","data_center":{"href":"/ovirt-engine/api/datacenters/25067f1d-8caa-418f-814d-14c779383c25","id":"25067f1d-8caa-418f-814d-14c779383c25"},"cluster":{"href":"","id":""},"host":{"href":"","id":""},"vm":{"href":"","id":""}}}
{"level":"info","ts":1629276167.0932128,"logger":"collector|ovirt","msg":"Event applied.","provider":"openshift-mtv/rhev01","event":{"id":"3204238","code":"958","description":"Storage Domain L0_Group_0_new was updated by admin@internal-authz","data_center":{"href":"/ovirt-engine/api/datacenters/25067f1d-8caa-418f-814d-14c779383c25","id":"25067f1d-8caa-418f-814d-14c779383c25"},"cluster":{"href":"","id":""},"host":{"href":"","id":""},"vm":{"href":"","id":""}}}

Comment 5 errata-xmlrpc 2021-08-26 07:09:27 UTC
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 (Migration Toolkit for Virtualization 2.1.0), 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-2021:3278