Skip to content

Commit

Permalink
Remove obsolete MPP multipath support
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Syms <[email protected]>
  • Loading branch information
MarkSymsCtx committed Mar 29, 2023
1 parent 18b79a5 commit e94bdaa
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 270 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ SM_LIBS += srmetadata
SM_LIBS += metadata
SM_LIBS += lvmanager
SM_LIBS += blktap2
SM_LIBS += mpp_mpathutil
SM_LIBS += lcache
SM_LIBS += resetvdis
SM_LIBS += wwid_conf
Expand Down Expand Up @@ -203,7 +202,6 @@ install: precheck
ln -sf $(SM_DEST)lcache.py $(SM_STAGING)$(BIN_DEST)tapdisk-cache-stats
ln -sf /dev/null $(SM_STAGING)$(UDEV_RULES_DIR)/69-dm-lvm-metad.rules
install -m 755 scripts/xs-mpath-scsidev.sh $(SM_STAGING)$(UDEV_SCRIPTS_DIR)
install -m 755 scripts/xe-get-arrayid-lunnum $(SM_STAGING)$(BIN_DEST)
install -m 755 scripts/xe-getarrayidentifier $(SM_STAGING)$(BIN_DEST)
install -m 755 scripts/xe-getlunidentifier $(SM_STAGING)$(BIN_DEST)
install -m 755 scripts/make-dummy-sr $(SM_STAGING)$(LIBEXEC)
Expand Down
2 changes: 1 addition & 1 deletion drivers/BaseISCSI.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def detach(self, sr_uuid, delete=False):
# Remove iscsi_sessions and multipathed keys
if pbdref is not None:
if self.cmd == 'sr_detach':
keys += ["multipathed", "iscsi_sessions", "MPPEnabled"]
keys += ["multipathed", "iscsi_sessions"]
for key in keys:
try:
self.session.xenapi.PBD.remove_from_other_config(pbdref, key)
Expand Down
2 changes: 1 addition & 1 deletion drivers/LVHDoHBASR.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def detach(self, sr_uuid):
pbdref = util.find_my_pbd(self.session, self.host_ref, self.sr_ref)
except:
pass
for key in ["mpath-" + self.SCSIid, "multipathed", "MPPEnabled"]:
for key in ["mpath-" + self.SCSIid, "multipathed"]:
try:
self.session.xenapi.PBD.remove_from_other_config(pbdref, key)
except:
Expand Down
2 changes: 0 additions & 2 deletions drivers/LVHDoISCSISR.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ def _LUNprint(self, sr_uuid):
# issue a report luns:
luns = util.pread2(["/usr/bin/sg_luns", "-q", sgdev]).split('\n')
nluns = len(luns) - 1 # remove the line relating to the final \n
# check if the LUNs are MPP-RDAC Luns
scsi_id = scsiutil.getSCSIid(sgdev)

# make sure we've got that many sg devices present
for i in range(0, 30):
Expand Down
44 changes: 3 additions & 41 deletions drivers/devscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,31 +215,6 @@ def _parseHostId(str):
return val.replace(',', '')


def _genMPPHBA(id):
devs = scsiutil.cacheSCSIidentifiers()
mppdict = {}
for dev in devs:
item = devs[dev]
if item[1] == id:
arr = scsiutil._genArrayIdentifier(dev)
if not len(arr):
continue
try:
cmd = ['/usr/sbin/mppUtil', '-a']
for line in util.doexec(cmd)[1].split('\n'):
if line.find(arr) != -1:
rec = line.split()[0]
cmd2 = ['/usr/sbin/mppUtil', '-g', rec]
li = []
for newline in util.doexec(cmd2)[1].split('\n'):
if newline.find('hostId') != -1:
li.append(_parseHostId(newline))
mppdict[dev.split('/')[-1]] = li
except:
continue
return mppdict


def match_hbadevs(s, filterstr):
driver_name = _get_driver_name(s)
if match_host(s) and not match_blacklist(driver_name) \
Expand Down Expand Up @@ -380,19 +355,6 @@ def scan(srobj):
if obj.SCSIid in vdis:
vdis[obj.SCSIid].numpaths += 1
vdis[obj.SCSIid].path += " [%s]" % key
elif obj.hba == 'mpp':
mppdict = _genMPPHBA(obj.adapter)
if key in mppdict:
item = mppdict[key]
adapters = ''
for i in item:
if len(adapters):
adapters += ', '
obj.numpaths += 1
adapters += i
if len(adapters):
obj.mpp = adapters
vdis[obj.SCSIid] = obj
else:
vdis[obj.SCSIid] = obj

Expand All @@ -401,13 +363,13 @@ def scan(srobj):
d = dom.createElement("BlockDevice")
e.appendChild(d)

for attr in ['path', 'numpaths', 'SCSIid', 'vendor', 'serial', 'size', 'adapter', 'channel', 'id', 'lun', 'hba', 'mpp', 'eth']:
for attr in ['path', 'numpaths', 'SCSIid', 'vendor', 'serial', 'size', 'adapter', 'channel', 'id', 'lun', 'hba', 'eth']:
try:
aval = getattr(obj, attr)
except AttributeError:
if attr in ['mpp'] or attr in ['eth']:
if attr in ['eth']:
continue
raise xs_errors.XenError('InvalidArg', \
raise xs_errors.XenError('InvalidArg',
opterr='Missing required field [%s]' % attr)
entry = dom.createElement(attr)
d.appendChild(entry)
Expand Down
12 changes: 0 additions & 12 deletions drivers/mpath_dmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@
DEVMAPPERPATH = "/dev/mapper"
DEVBYIDPATH = "/dev/disk/by-id"
DEVBYSCSIPATH = "/dev/disk/by-scsibus"
DEVBYMPPPATH = "/dev/disk/by-mpp"
SYSFS_PATH = '/sys/class/scsi_host'
MP_INUSEDIR = "/dev/disk/mpInuse"

MPPGETAIDLNOBIN = "/opt/xensource/bin/xe-get-arrayid-lunnum"


def _is_mpath_daemon_running():
cmd = ["/sbin/pidof", "-s", "/sbin/multipathd"]
Expand Down Expand Up @@ -214,15 +211,6 @@ def deactivate():
for sid in mpath_cli.list_maps():
reset(sid, True)

# Disable any active MPP LUN maps (except the root dev)
systemroot = os.path.realpath(util.getrootdev())
for dev in glob.glob(DEVBYMPPPATH + "/*"):
if os.path.realpath(dev) != systemroot:
sid = os.path.basename(dev).split('-')[0]
reset(sid)
else:
util.SMlog("MPP: Found root dev node, not resetting")

# Check the ISCSI daemon doesn't have any active sessions, if not,
# restart in the new mode
if iscsilib.is_iscsi_daemon_running() and not iscsilib._checkAnyTGT():
Expand Down
27 changes: 1 addition & 26 deletions drivers/mpathcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

import util
import time
import os
import sys
import re
import xs_errors
import lock
import mpath_cli
import mpp_mpathutil
import glob
import json

supported = ['iscsi', 'lvmoiscsi', 'rawhba', 'lvmohba', 'ocfsohba', 'ocfsoiscsi', 'netapp', 'lvmofcoe', 'gfs2']

Expand All @@ -34,11 +29,9 @@
LOCK_NS2 = "mpathcount2"

MAPPER_DIR = "/dev/mapper"
mpp_path_update = False
match_bySCSIid = False
mpath_enabled = True
SCSIid = 'NOTSUPPLIED'
mpp_entry = 'NOTSUPPLIED'

cached_DM_maj = None

Expand Down Expand Up @@ -120,16 +113,7 @@ def get_root_dev_major():
# @entry: string representing previous value
# @remove: callback to remove key
# @add: callback to add key/value pair
def update_config(key, SCSIid, entry, remove, add, mpp_path_update=False):
if mpp_path_update:
remove('multipathed')
remove(key)
remove('MPPEnabled')
add('MPPEnabled', 'true')
add('multipathed', 'true')
add(key, str(entry))
return

def update_config(key, SCSIid, entry, remove, add):
path = os.path.join(MAPPER_DIR, SCSIid)
util.SMlog("MPATH: Updating entry for [%s], current: %s" % (SCSIid, entry))
if os.path.exists(path):
Expand Down Expand Up @@ -203,22 +187,13 @@ def check_devconfig(devconfig, sm_config, config, remove, add):
if not mpath_enabled:
remove(key)
remove('multipathed')
elif mpp_path_update:
util.SMlog("Matched SCSIid, updating entry %s" % str(mpp_entry))
update_config(key, i, mpp_entry, remove, add, mpp_path_update)
else:
if key not in config:
update_config(key, i, "", remove, add)
else:
update_config(key, i, config[key], remove, add)

if __name__ == '__main__':
if len(sys.argv) == 3:
match_bySCSIid = True
SCSIid = sys.argv[1]
mpp_path_update = True
mpp_entry = sys.argv[2]

try:
session = util.get_localAPI_session()
except:
Expand Down
113 changes: 0 additions & 113 deletions drivers/mpp_mpathutil.py

This file was deleted.

2 changes: 0 additions & 2 deletions mk/sm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ tests/run_python_unittests.sh
/opt/xensource/bin/blktap2
/opt/xensource/bin/tapdisk-cache-stats
/opt/xensource/bin/xe-getarrayidentifier
/opt/xensource/bin/xe-get-arrayid-lunnum
/opt/xensource/bin/xe-getlunidentifier
/opt/xensource/debug/tp
/opt/xensource/libexec/check-device-sharing
Expand Down Expand Up @@ -183,7 +182,6 @@ tests/run_python_unittests.sh
/opt/xensource/sm/mpath_null.py
/opt/xensource/sm/mpathcount.py
/opt/xensource/sm/mpathutil.py
/opt/xensource/sm/mpp_mpathutil.py
/opt/xensource/sm/nfs.py
/opt/xensource/sm/refcounter.py
/opt/xensource/sm/resetvdis.py
Expand Down
19 changes: 0 additions & 19 deletions scripts/xe-get-arrayid-lunnum

This file was deleted.

Loading

0 comments on commit e94bdaa

Please sign in to comment.