From ea1d91b71876e82975d52edfa9e3f5460fb32b97 Mon Sep 17 00:00:00 2001 From: Germano Percossi Date: Thu, 14 Aug 2014 12:10:00 +0100 Subject: [PATCH] CA-142451: Failed to report all LUNs advertised on targets sharing the same IQN If a multicontroller array advertises its targets using the same IQN but different IPs and the LUNs in those targets are distinct, we are able to show only LUNs coming from the first IP address. The fix reinstates a line that was removed in commit 391bdf055dff in our old sm.hg repository. The purporse of the line is to first check that we have a valid active iscsi connection using the original pair IP,IQN. Only if it fails (it should not in my opinion) we fall back to other ip addresses. Signed-off-by: Germano Percossi Reviewed-by: Chandrika Srinivasan Imported-by: Siddharth Vinothkumar GitHub: closes #207 on xapi-project/sm (cherry picked from commit 66c89ea0f7f70176fbfcb69654f77afbb2c4111d) --- drivers/ISCSISR.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/ISCSISR.py b/drivers/ISCSISR.py index ca6aec8ba..227f79c49 100755 --- a/drivers/ISCSISR.py +++ b/drivers/ISCSISR.py @@ -228,15 +228,16 @@ def _initPaths(self): util.SMlog("PATHDICT: key %s: %s" % (key,rec)) addrlist.append(key) - # Try to detect an active path in order of priority - for key in self.pathdict: - if self.adapter.has_key(key): - self.tgtidx = key - self.path = self.pathdict[self.tgtidx]['path'] - if os.path.exists(self.path): - util.SMlog("Path found: %s" % self.path) - break - self.address = self.tgtidx + if not os.path.exists(self.path): + # Try to detect an active path in order of priority + for key in self.pathdict: + if self.adapter.has_key(key): + self.tgtidx = key + self.path = self.pathdict[self.tgtidx]['path'] + if os.path.exists(self.path): + util.SMlog("Path found: %s" % self.path) + break + self.address = self.tgtidx self._synchroniseAddrList(addrlist) def _init_adapters(self):