Arik Hadas has submitted this change and it was merged.
Change subject: core: prevent host in maintenance while vm runs on it in db
......................................................................
core: prevent host in maintenance while vm runs on it in db
Before switching a host to maintenance, we set its status to prepare-to-
maintenance and migrate the VMs that run on it. Only when no VMs run on
the host, we switch it to maintenance.
The problem is that we count on the number of VMs that are reported by
the host. It is racy because we might get this report from VDSM before
the Down event arrived or after the Down event has been ignored.
This patch refine the check that is done before switching a host to
maintenance to check that no VM is running on the host in the database
as well. We check the database only if VDSM reports that no VM runs on
it so it should be fine performance wise.
Change-Id: Ia953d71bb0b036ed0e1e65527c650e955a031fa1
Bug-Url:
https://bugzilla.redhat.com/1325938
Signed-off-by: Arik Hadas <ahadas(a)redhat.com>
---
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDao.java
M
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDynamicDaoImpl.java
M
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDynamicDaoTest.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/monitoring/MonitoringStrategyFactory.java
M
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/monitoring/VirtMonitoringStrategy.java
M
backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/monitoring/MultipleServicesMonitoringStrategyTest.java
M
backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/monitoring/VirtMonitoringStrategyTest.java
M packaging/dbscripts/vms_sp.sql
8 files changed, 66 insertions(+), 6 deletions(-)
Approvals:
Jenkins CI: Passed CI tests
Arik Hadas: Verified; Looks good to me, approved
--
To view, visit
https://gerrit.ovirt.org/57230
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia953d71bb0b036ed0e1e65527c650e955a031fa1
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Shahar Havivi <shavivi(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>