create volume with group_id , volume status will always "creating" if there is driver exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Undecided
|
yixuan zhang |
Bug Description
Test step:
1.Since creating a volume with a replication group id may cause some problem in our cinder driver.
We tried to disable this function in our cinder driver.
2.After we added and exception in cinder driver,
We Tried to create a volume with group id
cinder create --group_id *** --volume_type *** 1
3.There is an exception in our cinder driver as expected.
4.Check the volume status, it is always "creating", the volume status can't update to "error".
5.There is an exception below:
File "cinder/
ObjectActio
Analyse:
1. cinder/
The group was assigned to the consistency group before create_raw_volume:
if volume.group_id:
cg = consistencygrou
2.The _clean_cg_in_volume was not invoked if there is an exception in cinder driver:
def _create_
ret = self.driver.
return ret
3. Then it will do revert. when check updates, it found consistency group was in the updates.
cinder/
def save(self):
updates = self.cinder_
if updates:
# NOTE(xyang): Allow this to pass if 'consistencygroup' is
# set to None. This is to support backward compatibility.
# Also remove 'consistencygroup' from updates because
# consistencygroup is the name of a relationship in the ORM
# Volume model, so SQLA tries to do some kind of update of
# the foreign key based on the provided updates if
# 'consistencygroup' is in updates.
if updates.
Fix proposal:
invoke _clean_cg_in_volume even when there is an exception in cinder driver:
def _create_
try:
ret = self.driver.
except exception.
with excutils.
return ret
create_
Changed in cinder: | |
assignee: | nobody → yixuan zhang (yixuan-z) |
Fix proposed to branch: master /review. openstack. org/516882
Review: https:/