From a6498c3e01f105e57bee521f6c32f33a93c7f003 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Tue, 29 Jan 2019 15:12:19 -0500 Subject: [PATCH] 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 --- nfv/nfv-vim/nfv_vim/host_fsm/_host_tasks.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nfv/nfv-vim/nfv_vim/host_fsm/_host_tasks.py b/nfv/nfv-vim/nfv_vim/host_fsm/_host_tasks.py index 784ead3e..159bd802 100755 --- a/nfv/nfv-vim/nfv_vim/host_fsm/_host_tasks.py +++ b/nfv/nfv-vim/nfv_vim/host_fsm/_host_tasks.py @@ -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)