Compare commits

...

4 Commits

Author SHA1 Message Date
huy b57a40a67e Update cinder driver workaround 2022-02-08 16:45:55 +07:00
huy fa95a26109 Update cinder driver workaround 2022-02-08 16:44:21 +07:00
huy ec44cb09e7 Update cinder driver workaround 2022-02-08 16:36:54 +07:00
huy 25fccefe6d patch cinder driver 2021-12-22 10:44:07 +07:00
1 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
# Workaround:
# 461: allow to create volume from snapshot
# 527: adjust iodepth for faster deletion
# 591: add failure case when creating a volume
# Vitastor Driver for OpenStack Cinder
#
# --------------------------------------------
@ -455,7 +460,7 @@ class VitastorDriver(driver.CloneableImageVD,
vol_name = utils.convert_str(volume.name)
snap_name = utils.convert_str(snapshot.name)
snap = self._get_image(vol_name+'@'+snap_name)
snap = self._get_image("volume-"+snapshot.volume_id+'@'+snap_name)
if not snap:
raise exception.SnapshotNotFound(snapshot_id = snap_name)
snap_inode_id = int(resp['responses'][0]['kvs'][0]['value']['id'])
@ -524,7 +529,7 @@ class VitastorDriver(driver.CloneableImageVD,
for kv in layers:
args = [
'vitastor-cli', 'rm-data', '--pool', str(kv['value']['pool_id']),
'--inode', str(kv['value']['id']), '--progress', '0',
'--inode', str(kv['value']['id']), '--iodepth', '4', '--progress', '0',
*(self._vitastor_args())
]
try:
@ -584,6 +589,8 @@ class VitastorDriver(driver.CloneableImageVD,
{ 'request_put': { 'key': 'config/inode/'+pool_s+'/'+str(image_id), 'value': json.dumps({
**cfg, 'name': vol_name,
}) } },
], 'failure': [
{ 'request_put': { 'key': 'index/maxid/'+pool_s, 'value': image_id } },
] })
if not resp.get('succeeded'):
# repeat