Description of problem:
Create cinder volume from volume(cinder clone) with rbd_max_clone_depth set to a number. rbd_max_clone_depth is not honoured. After the max number is reached, the cloned cinder volumes are still rbd clones and not flattened volumes.
Version-Release number of selected component (if applicable):
ceph-0.94.1-11.el7cp.x86_64
openstack-cinder-2014.2.3-3.el7ost.noarch
How reproducible:
100%
Steps to Reproduce:
1. Interface cinder with rbd
2. Edit cinder config file with rbd entry:
[DEFAULT]
enabled_backends = rbd
glance_api_version = 2
[rbd]
volume_driver = cinder.volume.drivers.rbd.RBDDriver
rbd_pool = volumes
rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_flatten_volume_from_snapshot = false
rbd_max_clone_depth = 2
rbd_store_chunk_size = 4
rados_connect_timeout = -1
rbd_user = cinder
rbd_secret_uuid = fb0040d4-3b4a-48dd-9982-eb7dde3ada3a
It would be simpler to try with rbd_max_clone_depth = 0
3. Restart cinder services
4. Now create three volumes from a source cinder volume by cloning the cinder volume using "cinder create --source-volid"
5. Check the ceph cluster for info on all the cinder volumes created in step#3
"rbd info volumes/volume-id"
Actual results:
After creating three cloned cinder volumes, the subsequent rbd volumes are still rbd clones and not flattened volumes.
Expected results:
The subsequent rbd volumes should be flattened and not rbd clones.
Additional info:
#cinder create --display-name vol5 1
# cinder create --source-volid 50351034-73d4-4c25-a490-b378bfbcf187 --display-name vol5-vol1 1
Create three such cinder volumes from vol5.
Info on the third volume with rbd_max_clone_depth set to 2.
# rbd info volumes/volume-ed0e869e-7fb5-41bf-a7f0-acbf359c9b4e
rbd image 'volume-ed0e869e-7fb5-41bf-a7f0-acbf359c9b4e':
size 1024 MB in 256 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.127943e823c8a
format: 2
features: layering
flags:
parent: volumes/volume-50351034-73d4-4c25-a490-b378bfbcf187
overlap: 1024 MB