Avoid doing extra AddNewVolWithNaAsync calls.

Using a trial and error method to determine the format of
AddNewVolWithNaAsync causes issues on some server models. When
repeatedly deleting and creating the RAID array on Cyborg with
CDI3A2U XCC firmware we occasionally see hanged web sessions and
on rare occasions an incorrectly formatted AddNewVolWithNaAsync
call will return success and not create the array.
To reduce the number of AddNewVolWithNaAsync calls we determine
when GetDefaultVolProp requires the extra controller slot number
argument and in this case we directly use the
AddNewVolWithNaAsync call with the extra controller type argument
as these 2 changes go hand in hand in the XCC firmware. This logic
reduces the amount of AddNewVolWithNaAsync calls by one and the
issues described above can no longer be observed.

Change-Id: Icdaa5ef0fb5629ad965e37cbbecdcf892f6e315f
This commit is contained in:
Vlad Spoiala 2023-03-23 10:22:19 +02:00
parent 65c66422e4
commit bcfbd8f1c5
2 changed files with 8 additions and 22 deletions

View File

@ -1493,6 +1493,7 @@ class XCCClient(IMMClient):
url = '/api/function/raid_conf?params=raidlink_GetDefaultVolProp'
args = (url, cid, 0, params['drives'])
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
usesctrlslot = False
if not props: # newer firmware requires raidlevel too
args = (url, cid, params['raidlevel'], 0, params['drives'])
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
@ -1501,6 +1502,7 @@ class XCCClient(IMMClient):
args = (url, cid, params['raidlevel'], 0, params['drives'])
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
if 'return' in props and props['return'] == 22:
usesctrlslot = True
# Jan 2023 XCC FW - with controller slot number
args = (url, cid, params['raidlevel'], 0, params['drives'], cslotno)
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
@ -1574,23 +1576,14 @@ class XCCClient(IMMClient):
parms = {'raidlink_AddNewVolWithNaAsync': arglist}
rsp = self.wc.grab_json_response(url, parms)
if rsp['return'] == 14: # newer firmware
if 'supported_cpwb' in props: # June 2022 XCC FW
if 'supported_cpwb' in props and not usesctrlslot: # no ctrl_type
arglist = '{0},{1},{2},{3},{4},{5},{6},'.format(
cnum, params['raidlevel'], params['spans'],
params['perspan'], 0, params['drives'], params['hotspares'])
arglist += ''.join(vols)
parms = {'raidlink_AddNewVolWithNaAsync': arglist}
rsp = self.wc.grab_json_response(url, parms)
if not rsp: # Jan 2023 XCC FW
if cid[2] == 2:
cnum = cid[1]
arglist = '{0},{1},{2},{3},{4},{5},'.format(
cnum, params['raidlevel'], params['spans'],
params['perspan'], params['drives'], params['hotspares'])
arglist += ''.join(vols) + ',{0}'.format(cid[2])
parms = {'raidlink_AddNewVolWithNaAsync': arglist}
rsp = self.wc.grab_json_response(url, parms)
else: # June 2022 XCC FW
else: # with ctrl_type
if cid[2] == 2:
cnum = cid[1]
arglist = '{0},{1},{2},{3},{4},{5},'.format(

View File

@ -815,6 +815,7 @@ class OEMHandler(generic.OEMHandler):
url = '/api/function/raid_conf?params=raidlink_GetDefaultVolProp'
args = (url, cid, 0, params['drives'])
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
usesctrlslot = False
if not props: # newer firmware requires raidlevel too
args = (url, cid, params['raidlevel'], 0, params['drives'])
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
@ -823,6 +824,7 @@ class OEMHandler(generic.OEMHandler):
args = (url, cid, params['raidlevel'], 0, params['drives'])
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
if 'return' in props and props['return'] == 22:
usesctrlslot = True
# Jan 2023 XCC FW - with controller slot number
args = (url, cid, params['raidlevel'], 0, params['drives'], cslotno)
props = self.wc.grab_json_response(','.join([str(x) for x in args]))
@ -897,23 +899,14 @@ class OEMHandler(generic.OEMHandler):
parms = {'raidlink_AddNewVolWithNaAsync': arglist}
rsp = self.wc.grab_json_response(url, parms)
if rsp['return'] == 14: # newer firmware
if 'supported_cpwb' in props: # June 2022 XCC FW
if 'supported_cpwb' in props and not usesctrlslot: # no ctrl_type
arglist = '{0},{1},{2},{3},{4},{5},{6},'.format(
cnum, params['raidlevel'], params['spans'],
params['perspan'], 0, params['drives'], params['hotspares'])
arglist += ''.join(vols)
parms = {'raidlink_AddNewVolWithNaAsync': arglist}
rsp = self.wc.grab_json_response(url, parms)
if not rsp: # Jan 2023 XCC FW
if cid[2] == 2:
cnum = cid[1]
arglist = '{0},{1},{2},{3},{4},{5},'.format(
cnum, params['raidlevel'], params['spans'],
params['perspan'], params['drives'], params['hotspares'])
arglist += ''.join(vols) + ',{0}'.format(cid[2])
parms = {'raidlink_AddNewVolWithNaAsync': arglist}
rsp = self.wc.grab_json_response(url, parms)
else: # June 2022 XCC FW
else: # with ctrl_type
if cid[2] == 2:
cnum = cid[1]
arglist = '{0},{1},{2},{3},{4},{5},'.format(