Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
huy | b57a40a67e | |
huy | fa95a26109 | |
huy | ec44cb09e7 | |
huy | 25fccefe6d |
|
@ -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
|
# Vitastor Driver for OpenStack Cinder
|
||||||
#
|
#
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
|
@ -455,7 +460,7 @@ class VitastorDriver(driver.CloneableImageVD,
|
||||||
vol_name = utils.convert_str(volume.name)
|
vol_name = utils.convert_str(volume.name)
|
||||||
snap_name = utils.convert_str(snapshot.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:
|
if not snap:
|
||||||
raise exception.SnapshotNotFound(snapshot_id = snap_name)
|
raise exception.SnapshotNotFound(snapshot_id = snap_name)
|
||||||
snap_inode_id = int(resp['responses'][0]['kvs'][0]['value']['id'])
|
snap_inode_id = int(resp['responses'][0]['kvs'][0]['value']['id'])
|
||||||
|
@ -524,7 +529,7 @@ class VitastorDriver(driver.CloneableImageVD,
|
||||||
for kv in layers:
|
for kv in layers:
|
||||||
args = [
|
args = [
|
||||||
'vitastor-cli', 'rm-data', '--pool', str(kv['value']['pool_id']),
|
'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())
|
*(self._vitastor_args())
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
|
@ -584,6 +589,8 @@ class VitastorDriver(driver.CloneableImageVD,
|
||||||
{ 'request_put': { 'key': 'config/inode/'+pool_s+'/'+str(image_id), 'value': json.dumps({
|
{ 'request_put': { 'key': 'config/inode/'+pool_s+'/'+str(image_id), 'value': json.dumps({
|
||||||
**cfg, 'name': vol_name,
|
**cfg, 'name': vol_name,
|
||||||
}) } },
|
}) } },
|
||||||
|
], 'failure': [
|
||||||
|
{ 'request_put': { 'key': 'index/maxid/'+pool_s, 'value': image_id } },
|
||||||
] })
|
] })
|
||||||
if not resp.get('succeeded'):
|
if not resp.get('succeeded'):
|
||||||
# repeat
|
# repeat
|
||||||
|
|
Loading…
Reference in New Issue