Created attachment 1574323 [details] engine and vdsm Description of problem: an attempt to migrate VM under hard negative affinity group to the host the VM must not run there causes NPE in engine Version-Release number of selected component (if applicable):ovirt-engine-4.3.4.1-0.1.el7.noarch How reproducible: happens once in last automation run Steps to Reproduce: 1. Create new affinity group under given cluster with {'name': 'affinity_migrate_vm_02', 'cluster_name': 'golden_env_mixed_1', 'vms_rule': {'enabled': False}, 'hosts_rule': {'positive': False, 'enforcing': True}, 'hosts': ['host_mixed_1'], 'vms': ['golden_env_mixed_virtio_1_0']} <name>affinity_migrate_vm_02</name> <hosts_rule> <enabled>true</enabled> <enforcing>true</enforcing> <positive>false</positive> </hosts_rule> <vms_rule> <enabled>false</enabled> <enforcing>false</enforcing> <positive>false</positive> </vms_rule> <hosts> <host href="/ovirt-engine/api/hosts/eab0d7f4-bb16-4141-ac49-31a1b2781e27" id="eab0d7f4-bb16-4141-ac49-31a1b2781e27"/> </hosts> <vms> <vm href="/ovirt-engine/api/vms/9029c35c-5417-43f3-8972-f2f9866a7d8c" id="9029c35c-5417-43f3-8972-f2f9866a7d8c"/> </vms> 2. Send Rest API migration action to the VM under hard negative host affinity group (must not migrate). Actual results: the migration action is responded with 400 Internal Engine Error. 2019-05-26 04:47:20,698+03 INFO [org.ovirt.engine.core.bll.MigrateVmCommand] (default task-63) [vms_syncAction_65c232ee-7527-4931] Running command: MigrateVmCommand internal: false. Entities affected : ID: 9029c35c-5417-43f3-8972-f2f9866a7d8c Type: VMAction group MIGRATE_VM with role type USER 2019-05-26 04:47:20,709+03 INFO [org.ovirt.engine.core.bll.scheduling.SchedulingManager] (default task-63) [vms_syncAction_65c232ee-7527-4931] Candidate host 'host_mixed_3' ('e65a552d-9174-438c-85c7-ce15a57a17ea') was filtered out by 'VAR__FILTERTYPE__INTERNAL' filter 'VmToHostsAffinityGroups' (correlation id: vms_syncAction_65c232ee-7527-4931) 2019-05-26 04:47:20,714+03 ERROR [org.ovirt.engine.core.bll.MigrateVmCommand] (default task-63) [vms_syncAction_65c232ee-7527-4931] Command 'org.ovirt.engine.core.bll.MigrateVmCommand' failed: null 2019-05-26 04:47:20,714+03 ERROR [org.ovirt.engine.core.bll.MigrateVmCommand] (default task-63) [vms_syncAction_65c232ee-7527-4931] Exception: java.lang.NullPointerException at org.ovirt.engine.core.bll.scheduling.SchedulingManager.addPendingResources(SchedulingManager.java:509) [bll.jar:] at org.ovirt.engine.core.bll.scheduling.SchedulingManager.schedule(SchedulingManager.java:399) [bll.jar:] at org.ovirt.engine.core.bll.scheduling.SchedulingManager.schedule(SchedulingManager.java:429) [bll.jar:] at org.ovirt.engine.core.bll.MigrateVmCommand.getVdsToRunOn(MigrateVmCommand.java:203) [bll.jar:] at org.ovirt.engine.core.bll.MigrateVmCommand.initVdss(MigrateVmCommand.java:176) [bll.jar:] Expected results:VM must not migrate. (responce code 409)
Ok, the NPE is bad, but it does not migrate, right?
right continuing investigation of another automation run for the last version I face this problem again. I think it is not related to affinity rules , since i see that it also happened in other scenario with migration of HE VM by engine.log - 2019-05-25 00:48:13,675+03 INFO [org.ovirt.engine.core.bll.MigrateVmToServerCommand] (default task-8) [vms_syncAction_95f073cc-242f-4833] Running command: MigrateVmToServerCommand internal: false. Entities affected : ID: 1a1c0a62-a19f-4ab9-b2d7-69d50806639f Type: VMAction group MIGRATE_VM with role type USER 2019-05-25 00:48:13,835+03 ERROR [org.ovirt.engine.core.bll.MigrateVmToServerCommand] (default task-8) [vms_syncAction_95f073cc-242f-4833] Command 'org.ovirt.engine.core.bll.MigrateVmToServerCommand' failed: null 2019-05-25 00:48:13,835+03 ERROR [org.ovirt.engine.core.bll.MigrateVmToServerCommand] (default task-8) [vms_syncAction_95f073cc-242f-4833] Exception: java.lang.NullPointerException at org.ovirt.engine.core.bll.scheduling.SchedulingManager.addPendingResources(SchedulingManager.java:509) [bll.jar:] at org.ovirt.engine.core.bll.scheduling.SchedulingManager.schedule(SchedulingManager.java:399) [bll.jar:] at org.ovirt.engine.core.bll.scheduling.SchedulingManager.schedule(SchedulingManager.java:429) [bll.jar:] at org.ovirt.engine.core.bll.MigrateVmCommand.getVdsToRunOn(MigrateVmCommand.java:203) [bll.jar:] logs attached for this - second_scenario.tar
Created attachment 1574655 [details] second scenario NPE for MigrateVmToServerCommand
This is not related to affinity and is a duplicate of Bug 1696621. It seems the other bug is not fixed. *** This bug has been marked as a duplicate of bug 1696621 ***