]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Deal with tgt already exists errors
authorJohn Griffith <john.griffith@solidfire.com>
Wed, 7 Jan 2015 22:04:07 +0000 (15:04 -0700)
committerJohn Griffith <john.griffith@solidfire.com>
Thu, 8 Jan 2015 00:40:26 +0000 (00:40 +0000)
commit941e5f761be165accaabbdeec1608189b04ab67e
treeb559bfceb4b21dfde69d62035b15f9c99ff170cf
parent0269a26f13ed36b670e55b92f7645fb989cbce86
Deal with tgt already exists errors

So there's a major problem in the iscsi code (and has been
for quite some time).  The tgt show command sometimes seems
to be corrupt and the issued command is actually a tgt create.
The result is that we already have a tgt and the call raises
which then causes the operation to fail.

An example of the issue:
  Stdout: Unexpected error while running command.Command:
  sudo cinder-rootwrap /etc/cinder/rootwrap.conf tgt-admin
  --update iqn.2010-10.org.openstack:volume-f055d3c5-db7a-
  484e-9d0d-b98495439413
  Exit code: 22
  Stdout:
  Command:tgtadm -C 0 --lld iscsi --op new --mode target
  --tid 1 -T iqn.2010-10.org.openstack:volume-f055d3c5-db7a-
  484e-9d0d-b98495439413
  exited with code: 22.
  Stderr: u'tgtadm: this target already exists

What's disturbing however is that in that section of code
we're sending a --op show!!  Could be something we're
doing with our member executor?  Or maybe something to
do with the new oslo concurrency code?

Regardless, his patch intends to provide a clear marker for
ER in the case that create export fails due to the
target entry already existing.

Also this patch will enable us to go ahead and just use
the existing target rather than bomb out and fail everything.
Root cause of why we're getting a second create is still
unknown and needs addressed, but this might help in getting
more info as well as keeping things stable until we address
the root issue.

Change-Id: I0faf4d49b2d3e631b08ec1dff4361ff2376e3308
Partial-Bug: #1398078
cinder/tests/targets/test_tgt_driver.py
cinder/volume/targets/tgt.py