Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1639650

Summary: Hosted Engine VM is selected for balancing even though the BalanceVM command is not enabled for HE
Product: Red Hat Enterprise Virtualization Manager Reporter: Koutuk Shukla <kshukla>
Component: ovirt-engineAssignee: Andrej Krejcir <akrejcir>
Status: CLOSED ERRATA QA Contact: Polina <pagranat>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.6CC: bperkins, bugs, dfediuck, mavital, nobody, pagranat, ratamir, rbarry, Rhev-m-bugs
Target Milestone: ovirt-4.2.8Keywords: Automation, Reopened, ZStream
Target Release: ---Flags: lsvaty: testing_plan_complete-
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.8.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1583968 Environment:
Last Closed: 2019-01-22 12:44:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1583968    
Bug Blocks:    

Description Koutuk Shukla 2018-10-16 09:49:25 UTC
+++ This bug was initially created as a clone of Bug #1583968 +++

Description of problem: when host0 is configured CPU and memory overutilized, and the host1 with memory underutilized, the VMs from host0 must be balanced to host1. Instead, the Hosted Engine VM is attempted to be balanced and fails. Regular VM remains on the overutilized host.

Version-Release number of selected component (if applicable): rhv-release-4.2.4-1-001.noarch

How reproducible:100%

Steps to Reproduce:
1. Configure 
    Host_0 CPU over utilized and memory overutilized
    Host_1 CPU normal utilized and memory underutilized

Expected results: VM from Host_0 (golden_env_mixed_virtio_1_0 - see the system overview) must migrate on the Host_1

Actual results: tries to balance HE VM. Balancing VM HostedEngine messages in webUI Tasks tab (please see the screenshot in attached logs).

Additional info: system overview:
{
    "Default": {
        "hosts": {}, 
        "id": "8c3043a8-8fad-4ba9-9d6a-989edf8f603f", 
        "policy": {
            "none": {
                "balances": {
                    "None": {
                        "id": "38440000-8cf0-14bd-c43e-10b96e4ef00a"
                    }
                }, 
                "filters": {
                    "CPU": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f720cddc"
                    }, 
                    "CPU-Level": {
                        "id": "438b052c-90ab-40e8-9be0-a22560202ea6"
                    }, 
                    "CPUOverloaded": {
                        "id": "98842bc5-4094-4b83-8224-7b50f86a94c9"
                    }, 
                    "Compatibility-Version": {
                        "id": "3e4a7d54-9e7f-11e5-8994-feff819cdc9f"
                    }, 
                    "CpuPinning": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f731cddc"
                    }, 
                    "Emulated-Machine": {
                        "id": "58894b5b-d55d-4f85-8f82-5bf217e640b0"
                    }, 
                    "HA": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08dffd"
                    }, 
                    "HostDevice": {
                        "id": "728a21f1-f97e-4d32-bc3e-b3cc49756abb"
                    }, 
                    "HostedEngineSpares": {
                        "id": "53bff075-8306-446f-a53b-9c872a29d197"
                    }, 
                    "HugePages": {
                        "id": "23e07b34-66dd-4735-bc45-bcddded02c05"
                    }, 
                    "Label": {
                        "id": "27846536-f653-11e5-9ce9-5e5517507c66"
                    }, 
                    "Memory": {
                        "id": "c9ddbb34-0e1d-4061-a8d7-b0893fa80932"
                    }, 
                    "Migration": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08ddda"
                    }, 
                    "Network": {
                        "id": "72163d1c-9468-4480-99d9-0888664eb143"
                    }, 
                    "PinToHost": {
                        "id": "12262ab6-9690-4bc3-a2b3-35573b172d54"
                    }, 
                    "Swap": {
                        "id": "43b9e654-337f-4b0d-a896-cbb22ce5a7fc"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db566"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "e69808a9-8a41-40f1-94ba-dd5d385d82d8"
                    }
                }, 
                "id": "b4ed2332-a7ac-4d5f-9596-99a439cb2812", 
                "weights": {
                    "HA": {
                        "id": "98e92667-6161-41fb-b3fa-34f820ccbc4b"
                    }, 
                    "OptimalForCpuEvenDistribution": {
                        "id": "7db4ab05-81ab-42e8-868a-aee2df483edb"
                    }, 
                    "OptimalForHaReservation": {
                        "id": "7f262d70-6cac-11e3-981f-0800200c9a66"
                    }, 
                    "OptimalForMemoryEvenDistribution": {
                        "id": "4134247a-9c58-4b9a-8593-530bb9e37c59"
                    }, 
                    "PreferredHosts": {
                        "id": "591cdb81-ba67-45b4-9642-e28f61a97d57"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db567"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "427aed70-dae3-48ba-8fe9-a902a9d563c8"
                    }
                }
            }
       }, 
        "policy_params": {
            "CpuOverCommitDurationMinutes": "2", 
            "HighUtilization": "80"
        }
    }, 
    "golden_env_mixed_1": {
        "hosts": {
            "host_mixed_1": {
                "id": "4f8b8633-3bc4-4bfd-a970-4991a44e7d8b", 
                "max_scheduling_memory": "11423MB", 
                "status": "up", 
                "vms": {
                    "golden_env_mixed_virtio_1_0": {
                        "guaranteed_memory": "1024MB", 
                        "id": "b20aef7b-ce01-481b-9016-af6bf2d4ff00", 
                        "memory": "1024MB", 
                        "status": "up"
                    }, 
                    "vm_overutilized_0": {
                        "guaranteed_memory": "18853MB", 
                        "id": "a94dc1d9-f0ed-4348-b590-0baa762def93", 
                        "memory": "18853MB", 
                        "status": "up"
                    }
                }
            }, 
            "host_mixed_2": {
                "id": "eb96e250-9635-4921-8b71-524fc12a6772", 
                "max_scheduling_memory": "30392MB", 
                "status": "up", 
                "vms": {
                    "golden_env_mixed_virtio_1_1": {
                        "guaranteed_memory": "1024MB", 
                        "id": "59161df1-a5d1-4078-8ed0-35813bf7645b", 
                        "memory": "1024MB", 
                        "status": "up"
                    }
                }
            }, 
            "host_mixed_3": {
                "id": "4a5b6eb3-046d-4aea-88c1-a53e0d962c6c", 
                "max_scheduling_memory": "12412MB", 
                "status": "up", 
                "vms": {
                    "HostedEngine": {
                        "guaranteed_memory": "1024MB", 
                        "id": "9db72273-1cf5-4ba6-b95e-33ffe47fea6e", 
                        "memory": "16384MB", 
                        "status": "up"
                    }, 
                    "golden_env_mixed_virtio_3_0": {
                        "guaranteed_memory": "15581MB", 
                        "id": "23d66fd5-cb45-49f9-8c93-c1952070c4db", 
                        "memory": "15581MB", 
                        "status": "up"
                    }, 
                    "vm_overutilized_2": {
                        "guaranteed_memory": "18853MB", 
                        "id": "a865d9b2-a054-4aa7-a1b4-77bab982b9d1", 
                        "memory": "18853MB", 
                        "status": "up"
                    }
                }
            }
        }, 
        "id": "5a7bb8fc-61f1-11e8-af04-00163e7be006", 
        "policy": {
            "custom_power_saving_cpu": {
                "balances": {
                    "OptimalForPowerSaving": {
                        "id": "736999d0-1023-46a4-9a75-1316ed50e151"
                    }
                }, 
                "filters": {
                    "CPUOverloaded": {
                        "id": "98842bc5-4094-4b83-8224-7b50f86a94c9"
                    }, 
                    "CpuPinning": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f731cddc"
                    }, 
                    "HostDevice": {
                        "id": "728a21f1-f97e-4d32-bc3e-b3cc49756abb"
                    }, 
                    "Memory": {
                        "id": "c9ddbb34-0e1d-4061-a8d7-b0893fa80932"
                    }, 
                    "Migration": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08ddda"
                    }, 
                    "Network": {
                        "id": "72163d1c-9468-4480-99d9-0888664eb143"
                    }, 
                    "PinToHost": {
                        "id": "12262ab6-9690-4bc3-a2b3-35573b172d54"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db566"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "e69808a9-8a41-40f1-94ba-dd5d385d82d8"
                    }
                }, 
                "id": "fbc29a3c-91af-45bd-b810-38856e5afcd3", 
                "weights": {
                    "OptimalForCpuPowerSaving": {
                        "id": "736999d0-1023-46a4-9a75-1316ed50e15b"
                    }, 
                    "OptimalForMemoryPowerSaving": {
                        "id": "9dfe6086-646d-43b8-8eef-4d94de8472c8"
                    }, 
                    "PreferredHosts": {
                        "id": "591cdb81-ba67-45b4-9642-e28f61a97d57"
                    }
                }
            }
        }, 
        "policy_params": {
            "CpuOverCommitDurationMinutes": "1", 
            "HighUtilization": "75", 
            "LowUtilization": "35", 
            "MaxFreeMemoryForOverUtilized": "13733", 
            "MinFreeMemoryForUnderUtilized": "17829"
        }
    }, 
    "golden_env_mixed_2": {
        "hosts": {}, 
        "id": "341efeb6-de37-4044-b64c-ec7396ea09fd", 
        "policy": {
            "none": {
                "balances": {
                    "None": {
                        "id": "38440000-8cf0-14bd-c43e-10b96e4ef00a"
                    }
                }, 
                "filters": {
                    "CPU": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f720cddc"
                    }, 
                    "CPU-Level": {
                        "id": "438b052c-90ab-40e8-9be0-a22560202ea6"
                    }, 
                    "CPUOverloaded": {
                        "id": "98842bc5-4094-4b83-8224-7b50f86a94c9"
                    }, 
                    "Compatibility-Version": {
                        "id": "3e4a7d54-9e7f-11e5-8994-feff819cdc9f"
                    }, 
                    "CpuPinning": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f731cddc"
                    }, 
                    "Emulated-Machine": {
                        "id": "58894b5b-d55d-4f85-8f82-5bf217e640b0"
                    }, 
                    "HA": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08dffd"
                    }, 
                    "HostDevice": {
                        "id": "728a21f1-f97e-4d32-bc3e-b3cc49756abb"
                    }, 
                    "HostedEngineSpares": {
                        "id": "53bff075-8306-446f-a53b-9c872a29d197"
                    }, 
                    "HugePages": {
                        "id": "23e07b34-66dd-4735-bc45-bcddded02c05"
                    }, 
                    "Label": {
                        "id": "27846536-f653-11e5-9ce9-5e5517507c66"
                    }, 
                    "Memory": {
                        "id": "c9ddbb34-0e1d-4061-a8d7-b0893fa80932"
                    }, 
                    "Migration": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08ddda"
                    }, 
                    "Network": {
                        "id": "72163d1c-9468-4480-99d9-0888664eb143"
                    }, 
                    "PinToHost": {
                        "id": "12262ab6-9690-4bc3-a2b3-35573b172d54"
                    }, 
                    "Swap": {
                        "id": "43b9e654-337f-4b0d-a896-cbb22ce5a7fc"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db566"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "e69808a9-8a41-40f1-94ba-dd5d385d82d8"
                    }
                }, 
                "id": "b4ed2332-a7ac-4d5f-9596-99a439cb2812", 
                "weights": {
                    "HA": {
                        "id": "98e92667-6161-41fb-b3fa-34f820ccbc4b"
                    }, 
                    "OptimalForCpuEvenDistribution": {
                        "id": "7db4ab05-81ab-42e8-868a-aee2df483edb"
                    }, 
                    "OptimalForHaReservation": {
                        "id": "7f262d70-6cac-11e3-981f-0800200c9a66"
                    }, 
                    "OptimalForMemoryEvenDistribution": {
                        "id": "4134247a-9c58-4b9a-8593-530bb9e37c59"
                    }, 
                    "PreferredHosts": {
                        "id": "591cdb81-ba67-45b4-9642-e28f61a97d57"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db567"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "427aed70-dae3-48ba-8fe9-a902a9d563c8"
                    }
                }
            }
        }, 
        "policy_params": {
            "CpuOverCommitDurationMinutes": "2", 
            "HighUtilization": "80"
        }
    }
}

--- Additional comment from Doron Fediuck on 2018-05-31 06:00:19 EDT ---

Thanks for the report.
Please note that you created your own policy instead of using the built-in one:

        "policy": {
            "custom_power_saving_cpu": {
                "balances": {
                    "OptimalForPowerSaving": {

Your custom policy is missing the HA filter which avoids this behavior.
                    "HA": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08dffd"
                    }, 


To summarize- if you want to test our policies, please use our policies and do not create custom ones.

--- Additional comment from Polina on 2018-06-07 11:07:11 EDT ---

To exclude the effect of the customization, I repeated the test, configuring the cluster with original 'power_saving' policy instead of custom.

engine still tries to balance HE VM - "Balancing VM HostedEngine".

Please see the system overview.

{
    "Default": {
        "hosts": {}, 
        "id": "42349bf1-cbfb-4e23-b524-c59b88bfb04c", 
        "policy": {
            "none": {
                "balances": {
                    "None": {
                        "id": "38440000-8cf0-14bd-c43e-10b96e4ef00a"
                    }
                }, 
                "filters": {
                    "CPU": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f720cddc"
                    }, 
                    "CPU-Level": {
                        "id": "438b052c-90ab-40e8-9be0-a22560202ea6"
                    }, 
                    "CPUOverloaded": {
                        "id": "98842bc5-4094-4b83-8224-7b50f86a94c9"
                    }, 
                    "Compatibility-Version": {
                        "id": "3e4a7d54-9e7f-11e5-8994-feff819cdc9f"
                    }, 
                    "CpuPinning": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f731cddc"
                    }, 
                    "Emulated-Machine": {
                        "id": "58894b5b-d55d-4f85-8f82-5bf217e640b0"
                    }, 
                    "HA": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08dffd"
                    }, 
                    "HostDevice": {
                        "id": "728a21f1-f97e-4d32-bc3e-b3cc49756abb"
                    }, 
                    "HostedEngineSpares": {
                        "id": "53bff075-8306-446f-a53b-9c872a29d197"
                    }, 
                    "HugePages": {
                        "id": "23e07b34-66dd-4735-bc45-bcddded02c05"
                    }, 
                    "Label": {
                        "id": "27846536-f653-11e5-9ce9-5e5517507c66"
                    }, 
                    "Memory": {
                        "id": "c9ddbb34-0e1d-4061-a8d7-b0893fa80932"
                    }, 
                    "Migration": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08ddda"
                    }, 
                    "Network": {
                        "id": "72163d1c-9468-4480-99d9-0888664eb143"
                    }, 
                    "PinToHost": {
                        "id": "12262ab6-9690-4bc3-a2b3-35573b172d54"
                    }, 
                    "Swap": {
                        "id": "43b9e654-337f-4b0d-a896-cbb22ce5a7fc"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db566"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "e69808a9-8a41-40f1-94ba-dd5d385d82d8"
                    }
                }, 
                "id": "b4ed2332-a7ac-4d5f-9596-99a439cb2812", 
                "weights": {
                    "HA": {
                        "id": "98e92667-6161-41fb-b3fa-34f820ccbc4b"
                    }, 
                    "OptimalForCpuEvenDistribution": {
                        "id": "7db4ab05-81ab-42e8-868a-aee2df483edb"
                    }, 
                    "OptimalForHaReservation": {
                        "id": "7f262d70-6cac-11e3-981f-0800200c9a66"
                    }, 
                    "OptimalForMemoryEvenDistribution": {
                        "id": "4134247a-9c58-4b9a-8593-530bb9e37c59"
                    }, 
                    "PreferredHosts": {
                        "id": "591cdb81-ba67-45b4-9642-e28f61a97d57"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db567"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "427aed70-dae3-48ba-8fe9-a902a9d563c8"
                    }
                }
            }
        }, 
        "policy_params": {
            "CpuOverCommitDurationMinutes": "2", 
            "HighUtilization": "80"
        }
    }, 
    "golden_env_mixed_1": {
        "hosts": {
            "host_mixed_1": {
                "id": "2ca499d4-f9bd-4100-8b7b-7d4c50cb4463", 
                "max_scheduling_memory": "19260MB", 
                "status": "up", 
                "vms": {
                    "golden_env_mixed_virtio_1_0": {
                        "guaranteed_memory": "1024MB", 
                        "id": "17194a48-bfef-4877-b6ae-aa3630658798", 
                        "memory": "1024MB", 
                        "status": "up"
                    }, 
                    "golden_env_mixed_virtio_3_1": {
                        "guaranteed_memory": "8319MB", 
                        "id": "adaa17b9-68b2-4204-b1ba-dae2722dd700", 
                        "memory": "8319MB", 
                        "status": "up"
                    }, 
                    "vm_normalutilized_0": {
                        "guaranteed_memory": "18657MB", 
                        "id": "6b274874-4d1c-4073-9e68-752e3d2418b8", 
                        "memory": "18657MB", 
                        "status": "up"
                    }
                }
            }, 
            "host_mixed_2": {
                "id": "bf84842f-2b7d-4101-8a07-bb1f2b96cc46", 
                "max_scheduling_memory": "38097MB", 
                "status": "up", 
                "vms": {
                    "golden_env_mixed_virtio_1_1": {
                        "guaranteed_memory": "1024MB", 
                        "id": "37a28f46-0b6b-4303-9306-380085ed54e2", 
                        "memory": "1024MB", 
                        "status": "up"
                    }, 
                    "golden_env_mixed_virtio_3_0": {
                        "guaranteed_memory": "8319MB", 
                        "id": "9bcf42f3-459c-4875-8f81-bfefdcdb3a36", 
                        "memory": "8319MB", 
                        "status": "up"
                    }
                }
            }, 
            "host_mixed_3": {
                "id": "9043c1b4-ef60-4bdb-bdff-bd56e03f4adc", 
                "max_scheduling_memory": "39362MB", 
                "status": "up", 
                "vms": {
                    "HostedEngine": {
                        "guaranteed_memory": "8192MB", 
                        "id": "3ae6ec39-681a-4eae-85e8-64721c90a44c", 
                        "memory": "8192MB", 
                        "status": "up"
                    }
                }
            }
        }, 
        "id": "f8f8b41a-5361-11e8-9e69-001a4a162166", 
        "policy": {
            "power_saving": {
                "balances": {
                    "OptimalForPowerSaving": {
                        "id": "736999d0-1023-46a4-9a75-1316ed50e151"
                    }
                }, 
                "filters": {
                    "CPU": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f720cddc"
                    }, 
                    "CPU-Level": {
                        "id": "438b052c-90ab-40e8-9be0-a22560202ea6"
                    }, 
                    "CPUOverloaded": {
                        "id": "98842bc5-4094-4b83-8224-7b50f86a94c9"
                    }, 
                    "Compatibility-Version": {
                        "id": "3e4a7d54-9e7f-11e5-8994-feff819cdc9f"
                    }, 
                    "CpuPinning": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f731cddc"
                    }, 
                    "Emulated-Machine": {
                        "id": "58894b5b-d55d-4f85-8f82-5bf217e640b0"
                    }, 
                    "HA": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08dffd"
                    }, 
                    "HostDevice": {
                        "id": "728a21f1-f97e-4d32-bc3e-b3cc49756abb"
                    }, 
                    "HostedEngineSpares": {
                        "id": "53bff075-8306-446f-a53b-9c872a29d197"
                    }, 
                    "HugePages": {
                        "id": "23e07b34-66dd-4735-bc45-bcddded02c05"
                    }, 
                    "Label": {
                        "id": "27846536-f653-11e5-9ce9-5e5517507c66"
                    }, 
                    "Memory": {
                        "id": "c9ddbb34-0e1d-4061-a8d7-b0893fa80932"
                    }, 
                    "Migration": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08ddda"
                    }, 
                    "Network": {
                        "id": "72163d1c-9468-4480-99d9-0888664eb143"
                    }, 
                    "PinToHost": {
                        "id": "12262ab6-9690-4bc3-a2b3-35573b172d54"
                    }, 
                    "Swap": {
                        "id": "43b9e654-337f-4b0d-a896-cbb22ce5a7fc"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db566"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "e69808a9-8a41-40f1-94ba-dd5d385d82d8"
                    }
                }, 
                "id": "5a2b0939-7d46-4b73-a469-e9c2c7fc6a53", 
                "weights": {
                    "HA": {
                        "id": "98e92667-6161-41fb-b3fa-34f820ccbc4b"
                    }, 
                    "OptimalForCpuPowerSaving": {
                        "id": "736999d0-1023-46a4-9a75-1316ed50e15b"
                    }, 
                    "OptimalForHaReservation": {
                        "id": "7f262d70-6cac-11e3-981f-0800200c9a66"
                    }, 
                    "OptimalForMemoryPowerSaving": {
                        "id": "9dfe6086-646d-43b8-8eef-4d94de8472c8"
                    }, 
                    "PreferredHosts": {
                        "id": "591cdb81-ba67-45b4-9642-e28f61a97d57"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db567"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "427aed70-dae3-48ba-8fe9-a902a9d563c8"
                    }
                }
            }
        }, 
        "policy_params": {
            "CpuOverCommitDurationMinutes": "1", 
            "HeSparesCount": "0", 
            "HighUtilization": "75", 
            "LowUtilization": "35", 
            "MaxFreeMemoryForOverUtilized": "17633", 
            "MinFreeMemoryForUnderUtilized": "21729"
        }
    }, 
    "golden_env_mixed_2": {
        "hosts": {}, 
        "id": "9b066b08-c13a-45a8-940c-79cf23fefc1c", 
        "policy": {
            "none": {
                "balances": {
                    "None": {
                        "id": "38440000-8cf0-14bd-c43e-10b96e4ef00a"
                    }
                }, 
                "filters": {
                    "CPU": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f720cddc"
                    }, 
                    "CPU-Level": {
                        "id": "438b052c-90ab-40e8-9be0-a22560202ea6"
                    }, 
                    "CPUOverloaded": {
                        "id": "98842bc5-4094-4b83-8224-7b50f86a94c9"
                    }, 
                    "Compatibility-Version": {
                        "id": "3e4a7d54-9e7f-11e5-8994-feff819cdc9f"
                    }, 
                    "CpuPinning": {
                        "id": "6d636bf6-a35c-4f9d-b68d-0731f731cddc"
                    }, 
                    "Emulated-Machine": {
                        "id": "58894b5b-d55d-4f85-8f82-5bf217e640b0"
                    }, 
                    "HA": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08dffd"
                    }, 
                    "HostDevice": {
                        "id": "728a21f1-f97e-4d32-bc3e-b3cc49756abb"
                    }, 
                    "HostedEngineSpares": {
                        "id": "53bff075-8306-446f-a53b-9c872a29d197"
                    }, 
                    "HugePages": {
                        "id": "23e07b34-66dd-4735-bc45-bcddded02c05"
                    }, 
                    "Label": {
                        "id": "27846536-f653-11e5-9ce9-5e5517507c66"
                    }, 
                    "Memory": {
                        "id": "c9ddbb34-0e1d-4061-a8d7-b0893fa80932"
                    }, 
                    "Migration": {
                        "id": "e659c871-0bf1-4ccc-b748-f28f5d08ddda"
                    }, 
                    "Network": {
                        "id": "72163d1c-9468-4480-99d9-0888664eb143"
                    }, 
                    "PinToHost": {
                        "id": "12262ab6-9690-4bc3-a2b3-35573b172d54"
                    }, 
                    "Swap": {
                        "id": "43b9e654-337f-4b0d-a896-cbb22ce5a7fc"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db566"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "e69808a9-8a41-40f1-94ba-dd5d385d82d8"
                    }
                }, 
                "id": "b4ed2332-a7ac-4d5f-9596-99a439cb2812", 
                "weights": {
                    "HA": {
                        "id": "98e92667-6161-41fb-b3fa-34f820ccbc4b"
                    }, 
                    "OptimalForCpuEvenDistribution": {
                        "id": "7db4ab05-81ab-42e8-868a-aee2df483edb"
                    }, 
                    "OptimalForHaReservation": {
                        "id": "7f262d70-6cac-11e3-981f-0800200c9a66"
                    }, 
                    "OptimalForMemoryEvenDistribution": {
                        "id": "4134247a-9c58-4b9a-8593-530bb9e37c59"
                    }, 
                    "PreferredHosts": {
                        "id": "591cdb81-ba67-45b4-9642-e28f61a97d57"
                    }, 
                    "VmAffinityGroups": {
                        "id": "84e6ddee-ab0d-42dd-82f0-c297779db567"
                    }, 
                    "VmToHostsAffinityGroups": {
                        "id": "427aed70-dae3-48ba-8fe9-a902a9d563c8"
                    }
                }
            }
        }, 
        "policy_params": {
            "CpuOverCommitDurationMinutes": "2", 
            "HighUtilization": "80"
        }
    }
}

--- Additional comment from Polina on 2018-06-07 11:22 EDT ---



--- Additional comment from Martin Sivák on 2018-06-13 08:22:03 EDT ---

But balancing the Hosted Engine VM is perfectly fine. It is just a VM. What exactly do you mean by "fails"? Is there a reason the engine VM can't move?

--- Additional comment from Polina on 2018-06-17 10:57:46 EDT ---

The environment has VM on hist1 with 1024 MB memory size which is expected to be migrated. Though the balancer chooses the Hosted Engine VM (which is NON_MANAGED_VM) and fails in balancing with error in Tasks.

I've run the test with full debug (see debug configuration below).

In engine.log you can see an error (please see the attachment) 
2018-06-17 17:32:54,244+03 WARN  [org.ovirt.engine.core.bll.BalanceVmCommand] (EE-ManagedThreadFactory-engineScheduled-Thread-23) [dab8e20] Validation of action 'BalanceVm' failed for user SYSTEM. Reasons: VAR__ACTION__MIGRATE,VAR__TYPE__VM,ACTION_TYPE_FAILED_CANNOT_RUN_ACTION_ON_NON_MANAGED_VM



debug configuration-
      <logger category="org.ovirt.engine.core.bll">
        <level name="DEBUG"/>
      </logger>
      <logger category="org.ovirt.engine.core.bll.scheduling">
        <level name="DEBUG"/>
      </logger>

--- Additional comment from Polina on 2018-06-17 10:58 EDT ---



--- Additional comment from Martin Sivák on 2018-06-22 07:23:06 EDT ---

The issue is here: org.ovirt.engine.core.common.validation.VmActionByVmOriginTypeValidator - BalanceVmCommand is not allowed for hosted engine.


So the question is whether we should allow balancing of hosted engine. Notice for example that migration of the hosted engine VM is already supported and there is not much difference between those two. It would also remove another difference between hosted engine and regular VMs.

--- Additional comment from Yaniv Lavi on 2018-06-24 10:33:22 EDT ---

(In reply to Martin Sivák from comment #7)
> The issue is here:
> org.ovirt.engine.core.common.validation.VmActionByVmOriginTypeValidator -
> BalanceVmCommand is not allowed for hosted engine.
> 
> 
> So the question is whether we should allow balancing of hosted engine.
> Notice for example that migration of the hosted engine VM is already
> supported and there is not much difference between those two. It would also
> remove another difference between hosted engine and regular VMs.

Let's remove this limitation, it seems unnecessary at this point.

Comment 2 RHV bug bot 2018-11-28 14:38:20 UTC
WARN: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.2.z': '?'}', ]

For more info please contact: rhv-devops: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.2.z': '?'}', ]

For more info please contact: rhv-devops

Comment 4 Polina 2018-12-20 07:46:41 UTC
The Bz is verified on version:
   ovirt-engine-4.2.8.1-0.1.el7ev.noarch
   vdsm-4.20.45-1.el7ev.x86_64
   libvirt-4.5.0-10.el7_6.3.x86_64

The verification is done by successful running automation tests from the module:

rhevmtests/compute/sla/scheduler_tests/policies_with_memory/policies_with_memory_test.py (this is where the problem was found).

No errors on HE VM Balancing.

Comment 6 errata-xmlrpc 2019-01-22 12:44:50 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, 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/RHBA-2019:0121

Comment 7 Daniel Gur 2019-08-28 13:14:17 UTC
sync2jira

Comment 8 Daniel Gur 2019-08-28 13:19:18 UTC
sync2jira