"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/volume/drivers/ibm/ibm_storage/ds8k_helper.py" between
cinder-17.0.0.tar.gz and cinder-17.0.1.tar.gz

About: OpenStack Cinder (Core Service: Block Storage) provides persistent block storage to running instances. Its pluggable driver architecture facilitates the creation and management of block storage devices.
The "Victoria" series (latest release).

ds8k_helper.py  (cinder-17.0.0):ds8k_helper.py  (cinder-17.0.1)
skipping to change at line 62 skipping to change at line 62
def filter_alnum(s): def filter_alnum(s):
return ''.join(x if x in string.ascii_letters + return ''.join(x if x in string.ascii_letters +
string.digits else '_' for x in s) if s else '' string.digits else '_' for x in s) if s else ''
class DS8KCommonHelper(object): class DS8KCommonHelper(object):
"""Manage the primary backend, it is common class too.""" """Manage the primary backend, it is common class too."""
OPTIONAL_PARAMS = ['ds8k_host_type', 'lss_range_for_cg'] OPTIONAL_PARAMS = ['ds8k_host_type', 'lss_range_for_cg']
# if use new REST API, please update the version below # if use new REST API, please update the version below
VALID_REST_VERSION_5_7_MIN = '5.7.51.1047' VALID_REST_VERSION_87_51_MIN = '87.51.52.0'
INVALID_STORAGE_VERSION = '8.0.1' INVALID_STORAGE_VERSION = '8.0.1'
REST_VERSION_5_7_MIN_PPRC_CG = '5.7.51.1068' REST_VERSION_87_51_MIN_PPRC_CG = '87.51.63.0'
REST_VERSION_5_8_MIN_PPRC_CG = '5.8.20.1059' REST_VERSION_88_20_MIN_PPRC_CG = '88.20.112.0'
def __init__(self, conf, HTTPConnectorObject=None): def __init__(self, conf, HTTPConnectorObject=None):
self.conf = conf self.conf = conf
self._connector_obj = HTTPConnectorObject self._connector_obj = HTTPConnectorObject
self._storage_pools = None self._storage_pools = None
self._disable_thin_provision = False self._disable_thin_provision = False
self._connection_type = self._get_value('connection_type') self._connection_type = self._get_value('connection_type')
self._existing_lss = None self._existing_lss = None
self.backend = {} self.backend = {}
self.setup() self.setup()
skipping to change at line 149 skipping to change at line 149
try: try:
self._client = restclient.RESTScheduler( self._client = restclient.RESTScheduler(
san_ip, san_ip,
self._get_value('san_login'), self._get_value('san_login'),
clear_pass, clear_pass,
self._connector_obj, self._connector_obj,
verify) verify)
except restclient.TimeoutException: except restclient.TimeoutException:
raise restclient.APIException( raise restclient.APIException(
data=(_("Can't connect to %(host)s") % {'host': san_ip})) data=(_("Can't connect to %(host)s") % {'host': san_ip}))
self.backend['rest_version'] = self._get_version()['bundle_version'] self.backend['rest_version'] = self._get_version()['bundle']
LOG.info("Connection to DS8K storage system %(host)s has been " LOG.info("Connection to DS8K storage system %(host)s has been "
"established successfully, the version of REST is %(rest)s.", "established successfully, the version of REST is %(rest)s.",
{'host': self._get_value('san_ip'), {'host': self._get_value('san_ip'),
'rest': self.backend['rest_version']}) 'rest': self.backend['rest_version']})
def _get_storage_information(self): def _get_storage_information(self):
storage_info = self.get_systems() storage_info = self.get_systems()
self.backend['storage_unit'] = storage_info['id'] self.backend['storage_unit'] = storage_info['id']
self.backend['storage_wwnn'] = storage_info['wwnn'] self.backend['storage_wwnn'] = storage_info['wwnn']
self.backend['storage_version'] = storage_info['release'] self.backend['storage_version'] = storage_info['release']
skipping to change at line 225 skipping to change at line 225
self.backend['host_type_override'] = ( self.backend['host_type_override'] = (
None if ds8k_host_type == 'auto' else ds8k_host_type) None if ds8k_host_type == 'auto' else ds8k_host_type)
def _verify_rest_version(self): def _verify_rest_version(self):
if self.backend['storage_version'] == self.INVALID_STORAGE_VERSION: if self.backend['storage_version'] == self.INVALID_STORAGE_VERSION:
raise exception.VolumeDriverException( raise exception.VolumeDriverException(
message=(_("%s does not support bulk deletion of volumes, " message=(_("%s does not support bulk deletion of volumes, "
"if you want to use this version of driver, " "if you want to use this version of driver, "
"please upgrade the CCL.") "please upgrade the CCL.")
% self.INVALID_STORAGE_VERSION)) % self.INVALID_STORAGE_VERSION))
if ('5.7' in self.backend['rest_version'] and rest_ver = self.backend['rest_version'][0:2]
if ('87' == rest_ver and
dist_version.LooseVersion(self.backend['rest_version']) < dist_version.LooseVersion(self.backend['rest_version']) <
dist_version.LooseVersion(self.VALID_REST_VERSION_5_7_MIN)): dist_version.LooseVersion(self.VALID_REST_VERSION_87_51_MIN)):
raise exception.VolumeDriverException( raise exception.VolumeDriverException(
message=(_("REST version %(invalid)s is lower than " message=(_("REST version %(invalid)s is lower than "
"%(valid)s, please upgrade it in DS8K.") "%(valid)s, please upgrade it in DS8K.")
% {'invalid': self.backend['rest_version'], % {'invalid': self.backend['rest_version'],
'valid': self.VALID_REST_VERSION_5_7_MIN})) 'valid': self.VALID_REST_VERSION_87_51_MIN}))
def verify_rest_version_for_pprc_cg(self): def verify_rest_version_for_pprc_cg(self):
if '8.1' in self.backend['rest_version']: if '8.1' in self.backend['rest_version']:
raise exception.VolumeDriverException( raise exception.VolumeDriverException(
message=_("REST for DS8K 8.1 does not support PPRC " message=_("REST for DS8K 8.1 does not support PPRC "
"consistency group, please upgrade the CCL.")) "consistency group, please upgrade the CCL."))
valid_rest_version = None valid_rest_version = None
if ('5.7' in self.backend['rest_version'] and rest_ver = self.backend['rest_version'][0:2]
if ('87' == rest_ver and
dist_version.LooseVersion(self.backend['rest_version']) < dist_version.LooseVersion(self.backend['rest_version']) <
dist_version.LooseVersion(self.REST_VERSION_5_7_MIN_PPRC_CG)): dist_version.LooseVersion(self.REST_VERSION_87_51_MIN_PPRC_CG)):
valid_rest_version = self.REST_VERSION_5_7_MIN_PPRC_CG valid_rest_version = self.REST_VERSION_87_51_MIN_PPRC_CG
elif ('5.8' in self.backend['rest_version'] and elif ('88' == rest_ver and
dist_version.LooseVersion(self.backend['rest_version']) < dist_version.LooseVersion(self.backend['rest_version']) <
dist_version.LooseVersion(self.REST_VERSION_5_8_MIN_PPRC_CG)): dist_version.LooseVersion(self.REST_VERSION_88_20_MIN_PPRC_CG)):
valid_rest_version = self.REST_VERSION_5_8_MIN_PPRC_CG valid_rest_version = self.REST_VERSION_88_20_MIN_PPRC_CG
if valid_rest_version: if valid_rest_version:
raise exception.VolumeDriverException( raise exception.VolumeDriverException(
message=(_("REST version %(invalid)s is lower than " message=(_("REST version %(invalid)s is lower than "
"%(valid)s, please upgrade it in DS8K.") "%(valid)s, please upgrade it in DS8K.")
% {'invalid': self.backend['rest_version'], % {'invalid': self.backend['rest_version'],
'valid': valid_rest_version})) 'valid': valid_rest_version}))
def verify_pools(self, storage_pools): def verify_pools(self, storage_pools):
if self._connection_type == storage.XIV_CONNECTION_TYPE_FC: if self._connection_type == storage.XIV_CONNECTION_TYPE_FC:
skipping to change at line 761 skipping to change at line 763
return model_update, snapshots_model_update return model_update, snapshots_model_update
def _delete_lun(self, lun_ids_str): def _delete_lun(self, lun_ids_str):
self._client.send('DELETE', '/volumes', self._client.send('DELETE', '/volumes',
params={'ids': lun_ids_str}) params={'ids': lun_ids_str})
def delete_lun_by_id(self, lun_id): def delete_lun_by_id(self, lun_id):
self._client.send('DELETE', '/volumes/%s' % lun_id) self._client.send('DELETE', '/volumes/%s' % lun_id)
def _get_version(self): def _get_version(self):
return self._client.fetchone('GET', '') return self._client.fetchone('GET', '/systems')
@proxy.logger @proxy.logger
def _create_lun(self, volData): def _create_lun(self, volData):
return self._client.fetchid('POST', '/volumes', volData) return self._client.fetchid('POST', '/volumes', volData)
def _get_pool(self, pool_id): def _get_pool(self, pool_id):
return self._client.fetchone('GET', '/pools/%s' % pool_id, return self._client.fetchone('GET', '/pools/%s' % pool_id,
fields=['id', 'name', 'node', 'stgtype', fields=['id', 'name', 'node', 'stgtype',
'cap', 'capavail']) 'cap', 'capavail'])
skipping to change at line 1040 skipping to change at line 1042
'options': ['unconditional', 'issue_target'] 'options': ['unconditional', 'issue_target']
} }
self._client.send('POST', '/cs/pprcs/delete', pair_data) self._client.send('POST', '/cs/pprcs/delete', pair_data)
class DS8KECKDHelper(DS8KCommonHelper): class DS8KECKDHelper(DS8KCommonHelper):
"""Manage ECKD volume.""" """Manage ECKD volume."""
OPTIONAL_PARAMS = ['ds8k_host_type', 'port_pairs', 'ds8k_ssid_prefix', OPTIONAL_PARAMS = ['ds8k_host_type', 'port_pairs', 'ds8k_ssid_prefix',
'lss_range_for_cg'] 'lss_range_for_cg']
# if use new REST API, please update the version below # if use new REST API, please update the version below
VALID_REST_VERSION_5_7_MIN = '5.7.51.1068' VALID_REST_VERSION_87_51_MIN = '87.51.63.0'
VALID_REST_VERSION_5_8_MIN = '5.8.20.1059' VALID_REST_VERSION_88_20_MIN = '88.20.112.0'
MIN_VALID_STORAGE_VERSION = '8.1' MIN_VALID_STORAGE_VERSION = '8.1'
INVALID_STORAGE_VERSION = '8.0.1' INVALID_STORAGE_VERSION = '8.0.1'
@staticmethod @staticmethod
def _gb2cyl(gb): def _gb2cyl(gb):
# now only support 3390, no 3380 or 3390-A # now only support 3390, no 3380 or 3390-A
cyl = int(math.ceil(gb * 1263.28)) cyl = int(math.ceil(gb * 1263.28))
if cyl > 65520: if cyl > 65520:
raise exception.VolumeDriverException( raise exception.VolumeDriverException(
message=(_("For 3390 volume, capacity can be in the range " message=(_("For 3390 volume, capacity can be in the range "
skipping to change at line 1092 skipping to change at line 1094
raise exception.VolumeDriverException( raise exception.VolumeDriverException(
message=(_("%s does not support bulk deletion of volumes, " message=(_("%s does not support bulk deletion of volumes, "
"if you want to use this version of driver, " "if you want to use this version of driver, "
"please upgrade the CCL.") "please upgrade the CCL.")
% self.INVALID_STORAGE_VERSION)) % self.INVALID_STORAGE_VERSION))
# DS8K supports ECKD ESE volume from 8.1 # DS8K supports ECKD ESE volume from 8.1
if (dist_version.LooseVersion(self.backend['storage_version']) < if (dist_version.LooseVersion(self.backend['storage_version']) <
dist_version.LooseVersion(self.MIN_VALID_STORAGE_VERSION)): dist_version.LooseVersion(self.MIN_VALID_STORAGE_VERSION)):
self._disable_thin_provision = True self._disable_thin_provision = True
if (('5.7' in self.backend['rest_version'] and rest_ver = self.backend['rest_version'][0:2]
if (('87' == rest_ver and
dist_version.LooseVersion(self.backend['rest_version']) < dist_version.LooseVersion(self.backend['rest_version']) <
dist_version.LooseVersion(self.VALID_REST_VERSION_5_7_MIN)) or dist_version.LooseVersion(self.VALID_REST_VERSION_87_51_MIN)) or
('5.8' in self.backend['rest_version'] and ('88' == rest_ver and
dist_version.LooseVersion(self.backend['rest_version']) < dist_version.LooseVersion(self.backend['rest_version']) <
dist_version.LooseVersion(self.VALID_REST_VERSION_5_8_MIN))): dist_version.LooseVersion(self.VALID_REST_VERSION_88_20_MIN))):
raise exception.VolumeDriverException( raise exception.VolumeDriverException(
message=(_("REST version %(invalid)s is lower than " message=(_("REST version %(invalid)s is lower than "
"%(valid)s, please upgrade it in DS8K.") "%(valid)s, please upgrade it in DS8K.")
% {'invalid': self.backend['rest_version'], % {'invalid': self.backend['rest_version'],
'valid': (self.VALID_REST_VERSION_5_7_MIN if '5.7' 'valid': (self.VALID_REST_VERSION_87_51_MIN
in self.backend['rest_version'] else if '87' == rest_ver else
self.VALID_REST_VERSION_5_8_MIN)})) self.VALID_REST_VERSION_88_20_MIN)}))
@proxy.logger @proxy.logger
def _get_device_mapping(self): def _get_device_mapping(self):
map_str = self._get_value('ds8k_devadd_unitadd_mapping') map_str = self._get_value('ds8k_devadd_unitadd_mapping')
mappings = map_str.replace(' ', '').upper().split(';') mappings = map_str.replace(' ', '').upper().split(';')
pairs = [m.split('-') for m in mappings] pairs = [m.split('-') for m in mappings]
self.verify_lss_ids(','.join([p[1] for p in pairs])) self.verify_lss_ids(','.join([p[1] for p in pairs]))
return {p[1]: int(p[0], 16) for p in pairs} return {p[1]: int(p[0], 16) for p in pairs}
@proxy.logger @proxy.logger
 End of changes. 15 change blocks. 
23 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)