Kubernetes: Remove VIM hypervisor query if plugin disabled

After the openstack application is removed, stale hypervisor information
in the VIM's database could cause repeated controller host swacts when a
worker host lock/unlock is attempted.  Qualifying the hypervisor query
with an enabled compute plugin will resolve this.  Note that subsequent
openstack application apply will re-initialize the VIM's hypervisor
information in the database.

Story: 2004520
Task: 29186

Change-Id: I7365fb88c71f3152864239aa629798e66b5c988a
Signed-off-by: Kevin Smith <kevin.smith@windriver.com>
This commit is contained in:
Kevin Smith 2019-01-29 15:12:19 -05:00
parent 2ab1a23a59
commit a6498c3e01
1 changed files with 9 additions and 6 deletions

View File

@ -172,8 +172,9 @@ class EnableHostTask(state_machine.StateTask):
self, host, objects.HOST_SERVICES.GUEST))
task_work_list.append(NotifyHostServicesEnabledTaskWork(
self, host, force_pass=True))
task_work_list.append(QueryHypervisorTaskWork(
self, host, force_pass=True))
if host.host_service_configured(objects.HOST_SERVICES.COMPUTE):
task_work_list.append(QueryHypervisorTaskWork(
self, host, force_pass=True))
super(EnableHostTask, self).__init__(
'enable-host_%s' % host.name, task_work_list)
@ -236,8 +237,9 @@ class DisableHostTask(state_machine.StateTask):
if host.host_service_configured(objects.HOST_SERVICES.CONTAINER):
task_work_list.append(DisableHostServicesTaskWork(
self, host, objects.HOST_SERVICES.CONTAINER))
task_work_list.append(QueryHypervisorTaskWork(
self, host, force_pass=True))
if host.host_service_configured(objects.HOST_SERVICES.COMPUTE):
task_work_list.append(QueryHypervisorTaskWork(
self, host, force_pass=True))
task_work_list.append(NotifyInstancesHostDisablingTaskWork(self, host))
if host.host_service_configured(objects.HOST_SERVICES.COMPUTE):
task_work_list.append(NotifyHostDisabledTaskWork(
@ -248,8 +250,9 @@ class DisableHostTask(state_machine.StateTask):
task_work_list.append(NotifyInstancesHostDisabledTaskWork(self, host))
task_work_list.append(notify_host_services_task(
self, host, force_pass=True))
task_work_list.append(QueryHypervisorTaskWork(
self, host, force_pass=True))
if host.host_service_configured(objects.HOST_SERVICES.COMPUTE):
task_work_list.append(QueryHypervisorTaskWork(
self, host, force_pass=True))
super(DisableHostTask, self).__init__(
'disable-host_%s' % host.name, task_work_list)