Merge "Ignore host audits with potentially outdated info"

This commit is contained in:
Zuul 2019-03-19 20:11:37 +00:00 committed by Gerrit Code Review
commit 194b365998
2 changed files with 14 additions and 5 deletions

View File

@ -138,7 +138,16 @@ def _audit_nfvi_hosts_callback(timer_id):
if not host.is_deleted():
deletable_host_groups.remove(host.name)
host.nfvi_host_update(nfvi_host)
if 30 <= host.elapsed_time_in_state:
# Only process the audited host information if the host has
# been in the current state for at least 30 seconds. This is
# necessary because the host state information comes from
# maintenance and the maintenance states may lag the states in
# the VIM because the VIM and maintenance process some actions
# at the same time (e.g. when a host is locked).
host.nfvi_host_update(nfvi_host)
else:
DLOG.info("Ignoring audit reply for host %s" % nfvi_host.name)
for host_name in deletable_host_groups:
host = host_table[host_name]

View File

@ -247,10 +247,10 @@ class DisableHostTask(state_machine.StateTask):
task_work_list.append(NotifyInstancesHostDisabledTaskWork(self, host))
if host.host_service_configured(objects.HOST_SERVICES.CONTAINER):
# Only disable the container services if the host is being locked
# and we are not running in a single controller configuration. In
# a single controller configuration we keep the container services
# running.
if self._host.is_locking():
# (or is already locked) and we are not running in a single
# controller configuration. In a single controller configuration we
# keep the container services running.
if self._host.is_locking() or self._host.is_locked():
from nfv_vim import directors
sw_mgmt_director = directors.get_sw_mgmt_director()
if not sw_mgmt_director.single_controller: