Martin Sivák has uploaded a new change for review.

Change subject: Treat migration state as Up and check engine health normally
......................................................................

Treat migration state as Up and check engine health normally

We used to treat migration source state as Vm up Health bad.
That is not the correct report as the source Vm still works
properly during live-merge.

This caused a situation when a migration caused other hosts
to try to start the Vm and fail because of sanlock protection.

This moves migration source state to the group of states with
Vm up Health <query the status page> behaviour.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1093366
Change-Id: If3c813461909103b11266c902ccc51b2df2d0d36
Signed-off-by: Martin Sivak <[email protected]>
(cherry picked from commit 0554e4208c4915863baeaa16fa5baeb678bfa0cf)
---
M ovirt_hosted_engine_ha/broker/submonitors/engine_health.py
1 file changed, 9 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-ha 
refs/changes/03/29903/1

diff --git a/ovirt_hosted_engine_ha/broker/submonitors/engine_health.py 
b/ovirt_hosted_engine_ha/broker/submonitors/engine_health.py
index 69d8e4b..7557a50 100644
--- a/ovirt_hosted_engine_ha/broker/submonitors/engine_health.py
+++ b/ovirt_hosted_engine_ha/broker/submonitors/engine_health.py
@@ -71,21 +71,19 @@
                 self.update_result(json.dumps(d))
                 return
         vm_status = stats['statsList'][0]['status'].lower()
-        if vm_status in ('powering up',
-                         'powering down',
-                         'waitforlaunch',
-                         'migration source',
-                         'rebootinprogress',
-                         'restoringstate',
-                         'savingstate',
-                         'paused'):
+
+        # Report states that are not really Up, but should be
+        # reported as such
+        if vm_status in ('paused', 'waitforlaunch', 'restoringstate'):
             self._log.info("VM status: %s", vm_status,
                            extra=log_filter.lf_args('status', 60))
             d = {'vm': 'up', 'health': 'bad', 'detail': vm_status,
                  'reason': 'bad vm status'}
             self.update_result(json.dumps(d))
             return
-        if vm_status not in ('up', 'running'):
+
+        # Check for states that are definitely down
+        if vm_status in ('down', 'migration destination'):
             self._log.info("VM not running on this host, status %s", vm_status,
                            extra=log_filter.lf_args('status', 60))
             d = {'vm': 'down', 'health': 'bad', 'detail': vm_status,
@@ -93,7 +91,8 @@
             self.update_result(json.dumps(d))
             return
 
-        # VM is up, let's see if engine is up by polling health status page
+        # VM is probably up, let's see if engine is up by polling
+        # health status page
         p = subprocess.Popen([constants.HOSTED_ENGINE_BINARY,
                               '--check-liveliness'],
                              stdout=subprocess.PIPE, stderr=subprocess.PIPE)


-- 
To view, visit http://gerrit.ovirt.org/29903
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3c813461909103b11266c902ccc51b2df2d0d36
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-ha
Gerrit-Branch: ovirt-hosted-engine-ha-1.1
Gerrit-Owner: Martin Sivák <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to