Skip to content

Commit

Permalink
Merge pull request #88 from xenserver/fix_multipath
Browse files Browse the repository at this point in the history
Fix multipath
  • Loading branch information
DeliZhangX authored Nov 13, 2020
2 parents f782c9b + 5b9f051 commit 74807bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
16 changes: 1 addition & 15 deletions src/XenCert/StorageHandlerUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@
DDT_SECTOR_SIZE = 512 # one sector size: 512 bytes
DDT_DEFAULT_BLOCK_SIZE = 512 # one block size: 512 sectors, 256KB

multiPathDefaultsMap = { 'udev_dir':'/dev',
'polling_interval':'5',
'selector': "round-robin 0",
'path_grouping_policy':'failover',
'getuid_callout':"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace /dev/%n",
'prio_callout':'none',
'path_checker':'readsector0',
'rr_min_io':'1000',
'rr_weight':'uniform',
'failback':'manual',
'no_path_retry':'fail',
'user_friendly_names':'no',
'bindings_file':"/var/lib/multipath/bindings" }


def _init_adapters():
# Generate a list of active adapters
Expand Down Expand Up @@ -716,7 +702,7 @@ def parse_config(vendor, product):
re_product = re.compile(attr_map['product'].strip('"'))
if (re_vendor.search(vendor) and re_product.search(product)):
xencert_print("matched vendor and product")
device_config = dict(multiPathDefaultsMap.items() + attr_map.items())
device_config = dict(d["defaults"] + attr_map.items())
break
except Exception, e:
xencert_print("Failed to get multipath config for vendor: %s and product: %s. Exception: %s" % (vendor, product, str(e)))
Expand Down
5 changes: 5 additions & 0 deletions src/XenCert/blockunblockiscsipaths
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import util
import xen.lowlevel.xs
import random

from XenCertLog import xencert_print

def help():
print "Usage: blockunblockiscsipaths <block/unblock> <noOfPaths> <IP1>,<IP2>,..."
sys.exit(-1)
Expand All @@ -44,6 +46,7 @@ def unblock_ip(ip):
util.SMlog("There was an exception in blocking ip: %s" % ip)

# Test Cmdline args
xencert_print("Entering blockunblockiscsipaths")
if len(sys.argv) != 4:
help()

Expand All @@ -59,9 +62,11 @@ else:
paths = ''
for ip in newList:
if op == 'block':
xencert_print('blockunblockiscsipaths - blocking ip %s' % ip)
paths += ip
block_ip(ip)
elif op == 'unblock':
xencert_print('blockunblockiscsipaths - unblocking ip %s' % ip)
unblock_ip(ip)
else:
continue
Expand Down

0 comments on commit 74807bc

Please sign in to comment.