We have metioned this case in original design [1], there is a common implementation in [2] (if driver not support revert_to_snapshot will call it)
this common implementation will first create a temp volume from snapshot, and then copy temp volume to origin volume [3]
Although If volume.size > snapshot.size, it's a safe case, but we still need shrink volume to snapshot.size (which is not supported in volume dirver)
So, I prefer to add this size check before we do the real revert action.
Link: [1] https://review.openstack.org/#/c/316540/27/specs/pike/cinder-volume-revert-by-snapshot.rst@125 [2] https://github.com/openstack/cinder/blob/2ec51c3/cinder/volume/manager.py#L934 [3] https://github.com/openstack/cinder/blob/2ec51c3/cinder/volume/manager.py#L911
We have metioned this case in original design [1], there is a common implementation in [2] (if driver not support revert_to_snapshot will call it)
this common implementation will first create a temp volume from snapshot, and then copy temp volume to origin volume [3]
Although If volume.size > snapshot.size, it's a safe case, but we still need shrink volume to snapshot.size (which is not supported in volume dirver)
So, I prefer to add this size check before we do the real revert action.
Link: /review. openstack. org/#/c/ 316540/ 27/specs/ pike/cinder- volume- revert- by-snapshot. rst@125 /github. com/openstack/ cinder/ blob/2ec51c3/ cinder/ volume/ manager. py#L934 /github. com/openstack/ cinder/ blob/2ec51c3/ cinder/ volume/ manager. py#L911
[1] https:/
[2] https:/
[3] https:/