← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1403836] Re: Nova volume attach fails for a iscsi disk with CHAP enabled.

 

Reviewed:  https://review.openstack.org/249291
Committed: https://git.openstack.org/cgit/openstack/os-win/commit/?id=b72790bacfd356021b2dd870ade6c9c216fd14a0
Submitter: Jenkins
Branch:    master

commit b72790bacfd356021b2dd870ade6c9c216fd14a0
Author: Lucian Petrut <lpetrut@xxxxxxxxxxxxxxxxxxxxxx>
Date:   Fri Nov 20 16:20:40 2015 +0200

    iSCSI initiator refactoring using iscsidsc.dll
    
    This patch adds a new iscsi initiator utils class,
    leveraging iscsidsc.dll functions.
    
    The advantages are:
    * Same error output as iscsicli, without the proccess spawn
      overhead
    * Improved overall performance, having finer control over
      the iSCSI initiator and avoiding unnecessary operations
    * Fixed bugs related to LUN discovery
    * Static targets are used instead of having portal discovery
      sessions. This will let us use backends that require
      discovery credentials (which may be different than the
      credentials used when logging in targets)
    * improved MPIO support (the caller must request logging in the
      target for each of the available portals. Logging in multiple
      targets exporting the same LUN is also supported). Also, a
      specific initiator can be requested when creating sessions.
    
    Closes-Bug: #1403836
    Closes-Bug: #1372823
    Closes-Bug: #1372827
    
    Co-Authored-By: Alin Balutoiu <abalutoiu@xxxxxxxxxxxxxxxxxxxxxx>
    Change-Id: Ie037cf1712a28e85e5eca445eea3df883c6b6831


** Changed in: os-win
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1403836

Title:
  Nova volume attach fails for a iscsi disk with CHAP enabled.

Status in OpenStack Compute (nova):
  In Progress
Status in os-win:
  Fix Released

Bug description:
  I was trying nova volume attach of a disk with CHAP enabled on
  Windows(HyperV driver), I notice that the attach volume fails with
  CHAP authentication enforced and the same works without CHAP
  authentication set.

  My current setup is Juno based:

  I saw a similar bug reported as
  https://bugs.launchpad.net/nova/+bug/1397549  .  The fix of which is
  as per

  https://review.openstack.org/#/c/137623/ and
  https://review.openstack.org/#/c/134592/ .

  Even after incorporating  these changes  things do not work and it
  needs an additional fix.

  Issue: The issue even after having  the code as in the commits
  mentioned earlier is that – when we try to do nova volume-attach ,  on
  Hyperv host we first do a login to portal , then attach the volume to
  target.

  Now, if we login to portal without chap authentication – it will fail
  (Authentication failure) and hence the code needs to be changed here
  (https://github.com/openstack/nova/blob/master/nova/virt/hyperv/volumeutilsv2.py#L64-65
  ) .

  
  Resoultion: While creating/adding  the new portal we need to add it with the CHAP credentials (as the way it is done on target.connect) . 

  Sample snippet of the fix would be;
  if portal:
              portal[0].Update()
          else:
              # Adding target portal to iscsi initiator. Sending targets
               LOG.debug("Create a new portal")
                                             auth = {}
              if auth_username and auth_password:
                  auth['AuthenticationType'] = self._CHAP_AUTH_TYPE
                  auth['ChapUsername'] = auth_username
                  auth['ChapSecret'] = auth_password
              LOG.debug(auth)        
              portal = self._conn_storage.MSFT_iSCSITargetPortal
              portal.New(TargetPortalAddress=target_address,
                         TargetPortalPortNumber=target_port, **auth)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1403836/+subscriptions


References