Comment 19 for bug 1398078

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

Reviewed: https://review.openstack.org/145608
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=941e5f761be165accaabbdeec1608189b04ab67e
Submitter: Jenkins
Branch: master

commit 941e5f761be165accaabbdeec1608189b04ab67e
Author: John Griffith <email address hidden>
Date: Wed Jan 7 15:04:07 2015 -0700

    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