Debian: Host delete fails in VIM due to K8s API parm change

Bug #1995742 reported by Eric MacDonald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Al Bailey

Bug Description

Brief Description
-----------------
With the introduction of kubernetes 12 the delete API changed.
This leads to a traceback in the VIM which results in a host delete reject.

Severity
--------
Major: Host delete is a required function

Steps to Reproduce
------------------
system host-lock controller-1
sleep 60
system host-delete controller-1

Expected Behavior
------------------
controller-1 gets deleted

Actual Behavior
----------------
controller-1 is not deleted

Reproducibility
---------------
100%

System Configuration
--------------------
AIO DX with kubernetes pods running

Branch/Pull Time/Commit
-----------------------
SW_VERSION="22.12"
BUILD_TARGET="Host Installer"
BUILD_TYPE="Formal"
BUILD_ID="2022-11-02_18-00-10"
SRC_BUILD_ID="196"JOB="wrcp-master-debian"
BUILD_BY="jenkins"
BUILD_NUMBER="144"
BUILD_HOST="yow-wrcp-lx.wrs.com"
BUILD_DATE="2022-11-02 22:00:10 +0000"

Last Pass
---------
Prior to Kubernetes 12

Timestamp/Logs
--------------
2022-11-04T17:07:38.120 controller-0 VIM_Thread[90708] INFO _host_director.py.549 Host controller-1 state change notification.
2022-11-04T17:07:38.121 controller-0 VIM_Thread[90708] DEBUG nfvi_infrastructure_api.py.3908 Host rest-api delete path: /nfvi-plugins/v1/hosts/1efaa81d-16bc-4690-8ceb-74c53523d66e.
2022-11-04T17:07:38.137 controller-0 VIM_Thread[90708] ERROR Caught exception while trying to delete controller-1 kubernetes host services, error=TypeError: delete_node() takes 2 positional arguments but 3 were given.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nfv_plugins/nfvi_plugins/nfvi_infrastructure_api.py", line 2353, in delete_host_services
    future.result = (yield)
Exception: TypeError: delete_node() takes 2 positional arguments but 3 were given
2022-11-04T17:07:38.139 controller-0 VIM_Thread[90708] DEBUG _host_tasks.py.121 Task (delete-host_controller-1) complete.
2022-11-04T17:07:38.139 controller-0 VIM_Thread[90708] INFO _host_state_deleting.py.66 Delete failed for controller-1.
2022-11-04T17:07:38.139 controller-0 VIM_Thread[90708] INFO _host_state_deleting.py.40 Exiting state (deleting) for controller-1.

Test Activity
-------------
Developer Testing

Workaround
----------
None

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nfv (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/nfv/+/863686

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nfv (master)

Reviewed: https://review.opendev.org/c/starlingx/nfv/+/863686
Committed: https://opendev.org/starlingx/nfv/commit/d4b1cfd8cd91c20acc15899a89d3bb34afcf8e79
Submitter: "Zuul (22348)"
Branch: master

commit d4b1cfd8cd91c20acc15899a89d3bb34afcf8e79
Author: Al Bailey <email address hidden>
Date: Fri Nov 4 18:19:24 2022 +0000

    Fix host-delete for host that has k8s pods

    Attempting to delete a host that had pods on it
    was failing. This was due to an exception in nfv
    when calling the kubernetes client.

    On CentOS 7 python-kubernetes version 8 is used.
    On Debian Bullseye python-kubernetes version 12 is used.

    The delete_node API has changed in version 12.
    'body' needs to be a named argument.

    Closes-Bug: 1995742
    Signed-off-by: Al Bailey <email address hidden>
    Change-Id: I1ad56f4363ed2cc416335f37fdf20b39cd22ee1b

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
assignee: nobody → Al Bailey (albailey1974)
importance: Undecided → Medium
tags: added: stx.8.0 stx.nfv
tags: added: stx.debian
summary: - Host delete fails in VIM due to K8s API parm change
+ Debian: Host delete fails in VIM due to K8s API parm change
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.