Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1229976

Summary: [rbd-openstack]: cinder "rbd_max_clone_depth" doesn't enforce a flatten on the rbd volume after the depth is reached
Product: Red Hat OpenStack Reporter: shilpa <smanjara>
Component: openstack-cinderAssignee: Jon Bernard <jobernar>
Status: CLOSED CURRENTRELEASE QA Contact: nlevinki <nlevinki>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: ceph-eng-bugs, eharney, flucifre, geguileo, hnallurv, jdillama, jdurgin, jobernar, jschluet, kdreyer, scohen, yeylon
Target Milestone: ---   
Target Release: 8.0 (Liberty)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-7.0.0-2.el7ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-16 10:50:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1230323    

Description shilpa 2015-06-10 04:53:32 UTC
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

Comment 4 Josh Durgin 2015-07-15 00:10:37 UTC
This is a bug in the cinder rbd driver.

Comment 7 Sean Cohen 2015-10-15 12:50:37 UTC
https://review.openstack.org/#/c/205202/ was already merged in August 1st for Liberty.
Moving to POST.
Sean