Greg Padgett has uploaded a new change for review.

Change subject: storage: failure to reconnect to authenticated iSCSI LUNs
......................................................................

storage: failure to reconnect to authenticated iSCSI LUNs

Fix failure to reconnect to iSCSI storage domains on LUNs requiring
authentication due to missing CHAP credentials.

The credentials were sent to VDSM when connecting sessions on the host,
but VDSM was not sending them back to the engine when the engine queried
for connection properties.  Without this, the engine couldn't store them
in the database, and thus couldn't send them back out to any host trying
to connect (or reconnect) the storage.

Change-Id: Id717ee5b45adede4f9094f842ead06b0ba91f8b2
Signed-off-by: Greg Padgett <[email protected]>
---
M vdsm/storage/iscsi.py
M vdsm/storage/multipath.py
M vdsm/supervdsmServer.py
3 files changed, 13 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/8523/1

diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index 578b700..2c1707f 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -37,6 +37,7 @@
 from threading import RLock
 
 import iscsiadm
+import supervdsm
 
 IscsiPortal = namedtuple("IscsiPortal", "hostname, port")
 IscsiTarget = namedtuple("IscsiTarget", "portal, tpgt, iqn")
@@ -71,6 +72,9 @@
             IscsiTarget(IscsiPortal("", 0), 0, ""), None)
 
 def getSessionInfo(sessionID):
+    return supervdsm.getProxy().readSessionInfo(sessionID)
+
+def readSessionInfo(sessionID):
     sessionName = "session%d" % sessionID
     connectionName = "connection%d:0" % sessionID
     iscsi_session = "/sys/class/iscsi_session/%s/" % sessionName
@@ -113,7 +117,7 @@
     cred = None
     #FIXME: Don't just assume CHAP
     if username or password:
-        cred = ChapCredentials(user, password)
+        cred = ChapCredentials(username, password)
 
     return IscsiSession(sessionID, iface, target, cred)
 
diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py
index 042b4f5..f546982 100644
--- a/vdsm/storage/multipath.py
+++ b/vdsm/storage/multipath.py
@@ -312,11 +312,11 @@
                             "initiatorname": sess.iface.name
                             }
 
-                    # FIXME: When updating the API remember not to
-                    # send back credential information
+                    # Note that credentials must be sent back in order for
+                    # the engine to tell vdsm how to reconnect later
                     if sess.credentials:
                         cred = sess.credentials
-                        sessionInfo['username'] = cred.username
+                        sessionInfo['user'] = cred.username
                         sessionInfo['password'] = cred.password
 
                     knownSessions[sessionID] = sessionInfo
diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 371dc04..5e4dd77 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -40,6 +40,7 @@
 from storage.multipath import getScsiSerial as _getScsiSerial
 from storage.iscsi import forceIScsiScan as _forceIScsiScan
 from storage.iscsi import getDevIscsiInfo as _getdeviSCSIinfo
+from storage.iscsi import readSessionInfo as _readSessionInfo
 from supervdsm import _SuperVdsmManager, PIDFILE, ADDRESS
 from storage.fileUtils import chown, resolveGid, resolveUid
 from storage.fileUtils import validateAccess as _validateAccess
@@ -118,6 +119,10 @@
         return _getdeviSCSIinfo(*args, **kwargs)
 
     @logDecorator
+    def readSessionInfo(self, sessionID):
+        return _readSessionInfo(sessionID)
+
+    @logDecorator
     def getPathsStatus(self):
         return _getPathsStatus()
 


--
To view, visit http://gerrit.ovirt.org/8523
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id717ee5b45adede4f9094f842ead06b0ba91f8b2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to