Add a conflict detection mechanism to detected restricting and non restricting conflicts caused by new and exiting affinity groups. Error messages will be prompt when a new affinity group cannot be created via REST/SDK for VM to host affinity due to these conflicts. Warning messages will be prompt in REST/SDK and in engine.log as part of the Affinity rule enforcer manager with existing and possible conflicts.
Hi Yanir, can you please specify cases, when the error will appear and when the warning will appear?
(In reply to Artyom from comment #1) > Hi Yanir, can you please specify cases, when the error will appear and when > the warning will appear? The cases are mentioned in the doc text. In addition you can view them on the slides/video: https://mojo.redhat.com/docs/DOC-1130159-vm-to-host-affinity (pages 25,26 on VM to host affinity.odp)
(In reply to Yanir Quinn from comment #2) > (In reply to Artyom from comment #1) > > Hi Yanir, can you please specify cases, when the error will appear and when > > the warning will appear? > > The cases are mentioned in the doc text. > In addition you can view them on the slides/video: > > https://mojo.redhat.com/docs/DOC-1130159-vm-to-host-affinity > (pages 25,26 on VM to host affinity.odp) Just to clarify about Error and Warning messages. Error will appear only when you try to define a new enforcing vm to host affinity group that conflict with an existing enforcing vm to host affinity group (e.g. VM_A + Host_A exists and you try to add VM_A - Host_A) you will not be allowed to add the affinity group in this case. the rest of the use cases will not result in an error, the affinity groups will be added and you will get an error in audit.log and engine.log (engine log errors will appear from the affinity rule enforcer when it will find a vm to migrate - find vm to migrate and warn about conflicts)
(In reply to Yanir Quinn from comment #3) > (In reply to Yanir Quinn from comment #2) > > (In reply to Artyom from comment #1) > > > Hi Yanir, can you please specify cases, when the error will appear and when > > > the warning will appear? > > > > The cases are mentioned in the doc text. > > In addition you can view them on the slides/video: > > > > https://mojo.redhat.com/docs/DOC-1130159-vm-to-host-affinity > > (pages 25,26 on VM to host affinity.odp) > > Just to clarify about Error and Warning messages. > Error will appear only when you try to define a new enforcing vm to host > affinity group that conflict with an existing enforcing vm to host affinity > group > (e.g. VM_A + Host_A exists and you try to add VM_A - Host_A) > you will not be allowed to add the affinity group in this case. > > the rest of the use cases will not result in an error, the affinity groups > will be added and you will get a Warning in audit.log and engine.log (engine > log Warnings will appear from the affinity rule enforcer when it will find a > vm to migrate - find vm to migrate and warn about conflicts)
Verified on rhevm-4.1.1.4-0.1.el7.noarch Scenario 1 ========== affinity_group_1 - hard,positive hosts - host1 vms - vm1 affinity_group_2 - hard,positive vms - vm1,vm2 affinity_group_3 - hard,negative hosts - host1 vms - vm2 017-03-15 05:06:57,134-04 WARN [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-21) [ddfb2b76-e9f1-4651-8725-613cd521cc6b] EVENT_ID: VM_TO_HOST_CONFLICTS_POSITIVE_VM_TO_VM_AFFINITY(10,358), Correlation ID: ddfb2b76-e9f1-4651-8725-613cd521cc6b, Call Stack: null, Custom Event ID: -1, Message: The affinity groups: test_3,test_1, with hosts : 2411f6f7-b0dd-4413-a1b5-cc0d039fd82b and VMs: f3ee19f2-8f89-43a9-ba10-445c10e861f2,a22df7a0-b4ec-4fb7-aa6d-aa9572dffdbb, have conflicts between VM to host affinity and VM to VM positive affinity. Scenario 2 ========== affinity_group_1 - hard,positive hosts - host1 vms - vm1 affinity_group_2 - hard,negative hosts - host1 vms - vm1 <fault> <detail>[action type failed affinity hosts rules collision, affinitygroups: test 1,test 2, hosts: 2411f6f7-b0dd-4413-a1b5-cc0d039fd82b, vms: a22df7a0-b4ec-4fb7-aa6d-aa9572dffdbb]</detail> <reason>Operation Failed</reason> </fault> Scenario 3 ========== affinity_group_1 - hard,positive hosts - host1 vms - vm1 affinity_group_2 - soft,negative hosts - host1 vms - vm1 2017-03-15 05:15:13,506-04 WARN [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-2) [ef9b272f-05cf-407c-be31-bcfb9d540cb8] EVENT_ID: VM_TO_HOST_CONFLICT_IN_POSITIVE_AND_NEGATIVE_AFFINITY(10,357), Correlation ID: ef9b272f-05cf-407c-be31-bcfb9d540cb8, Call Stack: null, Custom Event ID: -1, Message: The affinity groups: test_1,test_2, with hosts: 2411f6f7-b0dd-4413-a1b5-cc0d039fd82b and VMs: a22df7a0-b4ec-4fb7-aa6d-aa9572dffdbb, have VM to host conflicts between positive and negative affinity groups.