Cinder proxy paging
cinder proxy paging Change-Id: Icc881edfac618afb58bfaec4ce37c3d2252cd384
This commit is contained in:
parent
7c5a2be507
commit
cfafc8d47a
|
@ -77,6 +77,10 @@ volume_manager_opts = [
|
||||||
default=5,
|
default=5,
|
||||||
help='seconds between cascading and cascaded cinders'
|
help='seconds between cascading and cascaded cinders'
|
||||||
'when synchronizing volume data'),
|
'when synchronizing volume data'),
|
||||||
|
cfg.IntOpt('pagination_limit',
|
||||||
|
default=50,
|
||||||
|
help='pagination limit query for volume between cascading'
|
||||||
|
'and cascaded volume'),
|
||||||
cfg.IntOpt('voltype_sync_interval',
|
cfg.IntOpt('voltype_sync_interval',
|
||||||
default=3600,
|
default=3600,
|
||||||
help='seconds between cascading and cascaded cinders'
|
help='seconds between cascading and cascaded cinders'
|
||||||
|
@ -534,12 +538,27 @@ class CinderProxy(manager.SchedulerDependentManager):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self._change_since_time is None:
|
if self._change_since_time is None:
|
||||||
search_opt = {'all_tenants': True,
|
page_limit = CONF.pagination_limit
|
||||||
'sort_key': 'updated_at',
|
LOG.debug(_('cascade info, pagination_limit: %s'), page_limit)
|
||||||
'sort_dir': 'desc',
|
marker = None
|
||||||
'limit': '50',
|
volumes = []
|
||||||
}
|
while True:
|
||||||
volumes = cinderClient.volumes.list(search_opts=search_opt)
|
search_opt = {'all_tenants': True,
|
||||||
|
'sort_key': 'updated_at',
|
||||||
|
'sort_dir': 'desc',
|
||||||
|
'marker': marker,
|
||||||
|
'limit': page_limit,
|
||||||
|
}
|
||||||
|
vols = cinderClient.volumes.list(search_opts=search_opt)
|
||||||
|
LOG.debug(_('cascade info, pagination volumes query.marker'
|
||||||
|
'%s, vols:%s'), marker, vols)
|
||||||
|
if (vols):
|
||||||
|
volumes.extend(vols)
|
||||||
|
marker = vols[-1]._info['id']
|
||||||
|
LOG.debug(_('cascade info, marker: %s'), marker)
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
break
|
||||||
LOG.info(_('Cascade info: change since time is none,'
|
LOG.info(_('Cascade info: change since time is none,'
|
||||||
'volumes:%s'), volumes)
|
'volumes:%s'), volumes)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue