summaryrefslogtreecommitdiff
path: root/ironic/drivers/base.py
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2018-01-16 09:21:37 -0800
committerJulia Kreger <juliaashleykreger@gmail.com>2018-02-07 10:23:47 -0800
commit4f79cb3932f2518ab3f06b86ceea065cbb399e8c (patch)
treeeddfeceda3ea2fda3959aff5c7d77ce510345cc3 /ironic/drivers/base.py
parent12d3157a968820e85c975edb5f45554230d2bf50 (diff)
downloadironic-4f79cb3932f2518ab3f06b86ceea065cbb399e8c.tar.gz
Don't try to lock for vif detach
Historically, we did not have a prohibition upon removing a VIF entry stored in the extra field, however the VIF attachment/detachment feature resulted in a task being created which by default attempts to pull a reservation lock unless explicitly shared. This is problematic as part of the process of undeploying a node as exclusive locks are generated. Presently, if any of those locked tasks run long, such as a new image being required or for some crazy reason, the BMC power request hangs for a few minutes, the VIF record may be orphaned and never removed, as the expectation is that nova deletes the VIF record from ironic. This allows the VIF record to be removed when a node is no longer in active use and possibly subject to a lock being held for a long period of time, such as when setting up for CLEANING. Additionally, this patch moves the actual VIF record deletion until after the detachment action in the event that it fails. This allows for the state in ironic to be consistent instead of the record being removed before the detachment occurs. Change-Id: Ib7544e43a2b26441d4f562b584bbc7fee6a11fea Closes-Bug: #1743652
Diffstat (limited to 'ironic/drivers/base.py')
-rw-r--r--ironic/drivers/base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py
index 7412f88c2..33e77ebf2 100644
--- a/ironic/drivers/base.py
+++ b/ironic/drivers/base.py
@@ -1031,6 +1031,10 @@ class NetworkInterface(BaseInterface):
def vif_detach(self, task, vif_id):
"""Detach a virtual network interface from a node
+ Warning: This method is called by the conductor as a shared
+ task, to ensure that a vif can be detached during a long-lived lock.
+ Such as those that occur when a node is being unprovisioned.
+
:param task: A TaskManager instance.
:param vif_id: A VIF ID to detach
:raises: NetworkError, VifNotAttached