def _find_LUN(svid): basepath = "/dev/disk/by-csldev/" if svid.startswith("NETAPP_"): # special attention for NETAPP SVIDs svid_parts = svid.split("__") globstr = basepath + "NETAPP__LUN__" + "*" + svid_parts[2] + "*" + svid_parts[-1] + "*" else: globstr = basepath + svid + "*" path = util.wait_for_path_multi(globstr, MAX_TIMEOUT) if not len(path): return [] #Find CSLDEV paths svid_to_use = re.sub("-[0-9]*:[0-9]*:[0-9]*:[0-9]*$","",os.path.basename(path)) devs = scsiutil._genReverseSCSIidmap(svid_to_use, pathname="csldev") #Find scsiID for dev in devs: try: SCSIid = scsiutil.getSCSIid(dev) except: pass #Find root device and return if not SCSIid: return [] else: device=mpath_dmp.path(SCSIid) XenCertPrint("DEBUG: device path : %s"%(device)) return [device]
def _find_LUN(svid): basepath = "/dev/disk/by-csldev/" if svid.startswith("NETAPP_"): # special attention for NETAPP SVIDs svid_parts = svid.split("__") globstr = basepath + "NETAPP__LUN__" + "*" + svid_parts[2] + "*" + svid_parts[-1] + "*" else: globstr = basepath + svid + "*" path = util.wait_for_path_multi(globstr, MAX_TIMEOUT) if not len(path): return [] svid_to_use = re.sub("-[0-9]*:[0-9]*:[0-9]*:[0-9]*$","",os.path.basename(path)) return scsiutil._genReverseSCSIidmap(svid_to_use, pathname="csldev")
def _find_LUN(svid): basepath = "/dev/disk/by-csldev/" if svid.startswith("NETAPP_"): # special attention for NETAPP SVIDs svid_parts = svid.split("__") globstr = basepath + "NETAPP__LUN__" + "*" + svid_parts[ 2] + "*" + svid_parts[-1] + "*" else: globstr = basepath + svid + "*" path = util.wait_for_path_multi(globstr, MAX_TIMEOUT) if not len(path): return [] svid_to_use = re.sub("-[0-9]*:[0-9]*:[0-9]*:[0-9]*$", "", os.path.basename(path)) return scsiutil._genReverseSCSIidmap(svid_to_use, pathname="csldev")