Add delay time for sync between cascading and cascaded vm status
Change-Id: I6dc4e9ded698db46103d8ce218307d10728f4b72
This commit is contained in:
parent
d60ac07ff9
commit
7caf4f39db
|
@ -1,5 +1,6 @@
|
||||||
import base64
|
import base64
|
||||||
import contextlib
|
import contextlib
|
||||||
|
import datetime
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -555,6 +556,7 @@ class ComputeManager(manager.Manager):
|
||||||
@periodic_task.periodic_task(spacing=CONF.sync_instance_state_interval,
|
@periodic_task.periodic_task(spacing=CONF.sync_instance_state_interval,
|
||||||
run_immediately=True)
|
run_immediately=True)
|
||||||
def _heal_instance_state(self, context):
|
def _heal_instance_state(self, context):
|
||||||
|
time_shift_tolerance = 3
|
||||||
heal_interval = CONF.sync_instance_state_interval
|
heal_interval = CONF.sync_instance_state_interval
|
||||||
if not heal_interval:
|
if not heal_interval:
|
||||||
return
|
return
|
||||||
|
@ -586,7 +588,12 @@ class ComputeManager(manager.Manager):
|
||||||
}
|
}
|
||||||
servers = cascadedNovaCli.servers.list(
|
servers = cascadedNovaCli.servers.list(
|
||||||
search_opts=search_opts_args)
|
search_opts=search_opts_args)
|
||||||
self._change_since_time = timeutils.isotime()
|
LOG.debug(_('the current time is %s'), timeutils.utcnow())
|
||||||
|
_change_since_time = timeutils.utcnow() - \
|
||||||
|
datetime.timedelta(seconds=time_shift_tolerance)
|
||||||
|
self._change_since_time = timeutils.isotime(_change_since_time)
|
||||||
|
LOG.debug(_('the change since time is %s'),
|
||||||
|
self._change_since_time)
|
||||||
if len(servers) > 0:
|
if len(servers) > 0:
|
||||||
LOG.debug(_('Updated the servers %s '), servers)
|
LOG.debug(_('Updated the servers %s '), servers)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue