"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cinder/volume/drivers/solidfire.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).

solidfire.py  (cinder-17.0.0):solidfire.py  (cinder-17.0.1)
skipping to change at line 103 skipping to change at line 103
cfg.IntOpt('sf_cluster_pairing_timeout', cfg.IntOpt('sf_cluster_pairing_timeout',
default=60, default=60,
min=3, min=3,
help='Sets time in seconds to wait for clusters to complete ' help='Sets time in seconds to wait for clusters to complete '
'pairing.'), 'pairing.'),
cfg.IntOpt('sf_volume_pairing_timeout', cfg.IntOpt('sf_volume_pairing_timeout',
default=3600, default=3600,
min=30, min=30,
help='Sets time in seconds to wait for a migrating volume to ' help='Sets time in seconds to wait for a migrating volume to '
'complete pairing and sync.')] 'complete pairing and sync.'),
cfg.IntOpt('sf_api_request_timeout',
default=30,
min=30,
help='Sets time in seconds to wait for an api request to '
'complete.'),
cfg.IntOpt('sf_volume_clone_timeout',
default=600,
min=60,
help='Sets time in seconds to wait for a clone of a volume or '
'snapshot to complete.'
)]
CONF = cfg.CONF CONF = cfg.CONF
CONF.register_opts(sf_opts, group=configuration.SHARED_CONF_GROUP) CONF.register_opts(sf_opts, group=configuration.SHARED_CONF_GROUP)
# SolidFire API Error Constants # SolidFire API Error Constants
xExceededLimit = 'xExceededLimit' xExceededLimit = 'xExceededLimit'
xAlreadyInVolumeAccessGroup = 'xAlreadyInVolumeAccessGroup' xAlreadyInVolumeAccessGroup = 'xAlreadyInVolumeAccessGroup'
xVolumeAccessGroupIDDoesNotExist = 'xVolumeAccessGroupIDDoesNotExist' xVolumeAccessGroupIDDoesNotExist = 'xVolumeAccessGroupIDDoesNotExist'
xNotInVolumeAccessGroup = 'xNotInVolumeAccessGroup' xNotInVolumeAccessGroup = 'xNotInVolumeAccessGroup'
skipping to change at line 646 skipping to change at line 657
kwargs.get(('port'), backend_conf.sf_api_port)) kwargs.get(('port'), backend_conf.sf_api_port))
sanitized_mvip = volume_utils.sanitize_host(endpoint['mvip']) sanitized_mvip = volume_utils.sanitize_host(endpoint['mvip'])
endpoint['url'] = 'https://%s:%s' % (sanitized_mvip, endpoint['url'] = 'https://%s:%s' % (sanitized_mvip,
endpoint['port']) endpoint['port'])
endpoint['svip'] = kwargs.get('svip', backend_conf.sf_svip) endpoint['svip'] = kwargs.get('svip', backend_conf.sf_svip)
if not endpoint.get('mvip', None) and kwargs.get('backend_id', None): if not endpoint.get('mvip', None) and kwargs.get('backend_id', None):
endpoint['mvip'] = kwargs.get('backend_id') endpoint['mvip'] = kwargs.get('backend_id')
return endpoint return endpoint
@retry(retry_exc_tuple, tries=6) @retry(retry_exc_tuple, tries=6)
def _issue_api_request(self, method, params, version='1.0', endpoint=None): def _issue_api_request(self, method, params, version='1.0',
endpoint=None, timeout=None):
if params is None: if params is None:
params = {} params = {}
if endpoint is None: if endpoint is None:
endpoint = self.active_cluster['endpoint'] endpoint = self.active_cluster['endpoint']
if not timeout:
timeout = self.configuration.sf_api_request_timeout
payload = {'method': method, 'params': params} payload = {'method': method, 'params': params}
url = '%s/json-rpc/%s/' % (endpoint['url'], version) url = '%s/json-rpc/%s/' % (endpoint['url'], version)
with warnings.catch_warnings(): with warnings.catch_warnings():
warnings.simplefilter( warnings.simplefilter(
"ignore", "ignore",
requests.packages.urllib3.exceptions.InsecureRequestWarning) requests.packages.urllib3.exceptions.InsecureRequestWarning)
req = requests.post(url, req = requests.post(url,
data=json.dumps(payload), data=json.dumps(payload),
auth=(endpoint['login'], endpoint['passwd']), auth=(endpoint['login'], endpoint['passwd']),
verify=self.verify_ssl, verify=self.verify_ssl,
timeout=30) timeout=timeout)
response = req.json() response = req.json()
req.close() req.close()
if (('error' in response) and if (('error' in response) and
(response['error']['name'] in self.retryable_errors)): (response['error']['name'] in self.retryable_errors)):
msg = ('Retryable error (%s) encountered during ' msg = ('Retryable error (%s) encountered during '
'SolidFire API call.' % response['error']['name']) 'SolidFire API call.' % response['error']['name'])
LOG.debug(msg) LOG.debug(msg)
LOG.debug("API response: %s", response) LOG.debug("API response: %s", response)
raise SolidFireRetryableException(message=msg) raise SolidFireRetryableException(message=msg)
skipping to change at line 849 skipping to change at line 863
if not self.configuration.sf_emulate_512: if not self.configuration.sf_emulate_512:
conn_info['provider_geometry'] = ('%s %s' % (4096, 4096)) conn_info['provider_geometry'] = ('%s %s' % (4096, 4096))
conn_info['provider_id'] = ( conn_info['provider_id'] = (
self._create_provider_id_string(vol_id, sfaccount['accountID'])) self._create_provider_id_string(vol_id, sfaccount['accountID']))
return conn_info return conn_info
def _get_model_info(self, sfaccount, sf_volume_id, endpoint=None): def _get_model_info(self, sfaccount, sf_volume_id, endpoint=None):
volume = None volume = None
iteration_count = 0 volume_list = self._get_volumes_by_sfaccount(
while not volume and iteration_count < 600: sfaccount['accountID'], endpoint=endpoint)
volume_list = self._get_volumes_by_sfaccount(
sfaccount['accountID'], endpoint=endpoint) for v in volume_list:
for v in volume_list: if v['volumeID'] == sf_volume_id:
if v['volumeID'] == sf_volume_id: volume = v
volume = v break
break
iteration_count += 1
if not volume: if not volume:
LOG.error('Failed to retrieve volume SolidFire-' LOG.error('Failed to retrieve volume SolidFire-'
'ID: %s in get_by_account!', sf_volume_id) 'ID: %s in get_by_account!', sf_volume_id)
raise exception.VolumeNotFound(volume_id=sf_volume_id) raise exception.VolumeNotFound(volume_id=sf_volume_id)
model_update = self._build_connection_info(sfaccount, volume, model_update = self._build_connection_info(sfaccount, volume,
endpoint=endpoint) endpoint=endpoint)
return model_update return model_update
skipping to change at line 927 skipping to change at line 939
raise SolidFireAPIException(msg) raise SolidFireAPIException(msg)
sf_cloned_id = data['result']['volumeID'] sf_cloned_id = data['result']['volumeID']
# NOTE(jdg): all attributes are copied via clone, need to do an update # NOTE(jdg): all attributes are copied via clone, need to do an update
# to set any that were provided # to set any that were provided
params = self._get_default_volume_params(vref, is_clone=is_clone) params = self._get_default_volume_params(vref, is_clone=is_clone)
params['volumeID'] = sf_cloned_id params['volumeID'] = sf_cloned_id
data = self._issue_api_request('ModifyVolume', params) data = self._issue_api_request('ModifyVolume', params)
model_update = self._get_model_info(sf_account, sf_cloned_id) def _wait_volume_is_active():
if model_update is None: try:
mesg = _('Failed to get model update from clone') model_info = self._get_model_info(sf_account, sf_cloned_id)
raise SolidFireAPIException(mesg) if model_info:
raise loopingcall.LoopingCallDone(model_info)
except exception.VolumeNotFound:
LOG.debug('Waiting for cloned volume [%s] - [%s] to become '
'active', sf_cloned_id, vref.id)
pass
try:
timer = loopingcall.FixedIntervalWithTimeoutLoopingCall(
_wait_volume_is_active)
model_update = timer.start(
interval=1,
timeout=self.configuration.sf_volume_clone_timeout).wait()
except loopingcall.LoopingCallTimeOut:
msg = _('Failed to get model update from clone [%s] - [%s]' %
(sf_cloned_id, vref.id))
LOG.error(msg)
raise SolidFireAPIException(msg)
rep_settings = self._retrieve_replication_settings(vref) rep_settings = self._retrieve_replication_settings(vref)
if self.replication_enabled and rep_settings: if self.replication_enabled and rep_settings:
try: try:
vref['volumeID'] = sf_cloned_id vref['volumeID'] = sf_cloned_id
rep_updates = self._replicate_volume( rep_updates = self._replicate_volume(
vref, params, sf_account, rep_settings) vref, params, sf_account, rep_settings)
model_update.update(rep_updates) model_update.update(rep_updates)
except SolidFireDriverException: except SolidFireDriverException:
with excutils.save_and_reraise_exception(): with excutils.save_and_reraise_exception():
 End of changes. 6 change blocks. 
16 lines changed or deleted 45 lines changed or added

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