Skip to content

Commit

Permalink
Force deletes using tgt to workaround bug 1159948
Browse files Browse the repository at this point in the history
Tgt has a bug where it can have multiple copies of an initiator
if there has been a reconnect.

See https://bugs.launchpad.net/cinder/+bug/1159948

Change-Id: I9a1b6757eb780efbaa1403016e50de7c0e45d720
(cherry picked from commit b842186)
  • Loading branch information
vishvananda committed Mar 25, 2013
1 parent 6a29bda commit 4645123
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cinder/tests/test_iscsi.py
Expand Up @@ -101,7 +101,8 @@ def setUp(self):
self.flags(volumes_dir=self.persist_tempdir)
self.script_template = "\n".join([
'tgt-admin --update iqn.2011-09.org.foo.bar:blaa',
'tgt-admin --delete iqn.2010-10.org.openstack:volume-blaa'])
'tgt-admin --force '
'--delete iqn.2010-10.org.openstack:volume-blaa'])

def tearDown(self):
try:
Expand Down
3 changes: 3 additions & 0 deletions cinder/volume/iscsi.py
Expand Up @@ -190,7 +190,10 @@ def remove_iscsi_target(self, tid, lun, vol_id, **kwargs):
else:
raise exception.ISCSITargetRemoveFailed(volume_id=vol_id)
try:
# NOTE(vish): --force is a workaround for bug:
# https://bugs.launchpad.net/cinder/+bug/1159948
self._execute('tgt-admin',
'--force',
'--delete',
iqn,
run_as_root=True)
Expand Down

0 comments on commit 4645123

Please sign in to comment.