diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-09-27 12:32:32 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-09-27 12:32:32 -0700 |
| commit | 628a993ce29cfdee00463c16b932f23e30bc52bf (patch) | |
| tree | 7422f14e83ea720132e87e49efa9700ca8a74fb8 | |
| parent | a6aee3667b5c4437501eeecfb7d8ed8bf14d76e0 (diff) | |
| download | nova-628a993ce29cfdee00463c16b932f23e30bc52bf.tar.gz nova-628a993ce29cfdee00463c16b932f23e30bc52bf.tar.xz nova-628a993ce29cfdee00463c16b932f23e30bc52bf.zip | |
libvirt: Improve the idempotency of iscsi detach
When detaching an iscsi volume it is possible for the iscsi commands
to run concurrently, causing a target to be deleted by one greenthread
while the other is continuing. When removing the iscsi connection,
we should always ignore exit code 21 because that means that the
target has already been removed.
Fixes bug 1057719
Change-Id: I0c9f2623f85a817e2be506f9a6d523d45c76848a
| -rw-r--r-- | nova/virt/libvirt/volume.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/virt/libvirt/volume.py b/nova/virt/libvirt/volume.py index 941fd4924..cf08ea85e 100644 --- a/nova/virt/libvirt/volume.py +++ b/nova/virt/libvirt/volume.py @@ -199,8 +199,8 @@ class LibvirtISCSIVolumeDriver(LibvirtVolumeDriver): devices = [dev for dev in devices if dev.startswith(device_prefix)] if not devices: self._iscsiadm_update(iscsi_properties, "node.startup", "manual", - check_exit_code=[0, 255]) + check_exit_code=[0, 21, 255]) self._run_iscsiadm(iscsi_properties, ("--logout",), - check_exit_code=[0, 255]) + check_exit_code=[0, 21, 255]) self._run_iscsiadm(iscsi_properties, ('--op', 'delete'), check_exit_code=[0, 21, 255]) |
