When ceph does the backend of cinder, if the clone volume depth exceeds the configured size, the volume will be flattened.
If the flatten operation is too long, the cinder-volume can not report the status to the cinder-scheduler,
The cinder-scheduler considers the cinder-volume to be down.
cinder-volume log
--------------------------------------------
2017-03-21 21:06:00.949 31396 DEBUG cinder.volume.drivers.rbd [req-3659d466-af71-4774-9d06-e877d4b761f3 331aa7019d414a9cb48fde06cfbc7b64 aefa89215813437ab91a2c1acd9338d8 - default default] opening connection to ceph cluster (timeout=30). _connect_to_rados /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py:328
2017-03-21 21:06:01.048 31396 DEBUG cinder.volume.drivers.rbd [req-3659d466-af71-4774-9d06-e877d4b761f3 331aa7019d414a9cb48fde06cfbc7b64 aefa89215813437ab91a2c1acd9338d8 - default default] Volume volume-a53d2778-d436-484c-8fe5-67651253f727 is not a clone. _get_clone_info /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py:634
2017-03-21 21:06:01.050 31396 DEBUG cinder.volume.drivers.rbd [req-3659d466-af71-4774-9d06-e877d4b761f3 331aa7019d414a9cb48fde06cfbc7b64 aefa89215813437ab91a2c1acd9338d8 - default default] maximum clone depth (2) has been reached - flattening source volume create_cloned_volume /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py:487
2017-03-21 21:06:01.077 31396 DEBUG cinder.volume.drivers.rbd [req-3659d466-af71-4774-9d06-e877d4b761f3 331aa7019d414a9cb48fde06cfbc7b64 aefa89215813437ab91a2c1acd9338d8 - default default] flattening source volume volume-67e4b760-7213-49d9-a13d-285cdd7db955 create_cloned_volume /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py:497
2017-03-21 21:06:54.615 31450 DEBUG oslo_service.periodic_task [req-34c3a89d-025d-4e9e-b225-5cbfd6fcfee5 - - - - -] Running periodic task VolumeManager._publish_service_capabilities run_periodic_tasks /usr/lib/python2.7/site-packages/oslo_service/periodic_task.py:215
2017-03-21 21:06:54.620 31450 DEBUG cinder.manager [req-34c3a89d-025d-4e9e-b225-5cbfd6fcfee5 - - - - -] Notifying Schedulers of capabilities ... _publish_service_capabilities /usr/lib/python2.7/site-packages/cinder/manager.py:165
2017-03-21 21:06:54.623 31450 DEBUG oslo_messaging._drivers.amqpdriver [req-34c3a89d-025d-4e9e-b225-5cbfd6fcfee5 - - - - -] CAST unique_id: 7fc461297cf94b45ac4fd1e515ad9e1f FANOUT topic 'cinder-scheduler' _send /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:437
2017-03-21 21:06:54.638 31450 DEBUG oslo_service.periodic_task [req-34c3a89d-025d-4e9e-b225-5cbfd6fcfee5 - - - - -] Running periodic task VolumeManager._report_driver_status run_periodic_tasks /usr/lib/python2.7/site-packages/oslo_service/periodic_task.py:215
2017-03-21 21:06:54.639 31450 DEBUG cinder.volume.drivers.lvm [req-34c3a89d-025d-4e9e-b225-5cbfd6fcfee5 - - - - -] Updating volume stats _update_volume_stats /usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py:204
------------------------------------------------
cinder-volume service status
-------------------------------------------
# cinder service-list
+------------------+------------+------+----------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+------------+------+----------+-------+----------------------------+-----------------+
| cinder-backup | newton | nova | enabled | up | 2017-03-21T13:06:45.000000 | - |
| cinder-scheduler | newton | nova | enabled | up | 2017-03-21T13:06:53.000000 | - |
| cinder-volume | newton@lvm | nova | disabled | up | 2017-03-21T13:06:49.000000 | - |
| cinder-volume | newton@rbd | nova | enabled | up | 2017-03-21T13:05:57.000000 | - |
+------------------+------------+------+----------+-------+----------------------------+-----------------+
# cinder service-list
+------------------+------------+------+----------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+------------+------+----------+-------+----------------------------+-----------------+
| cinder-backup | newton | nova | enabled | up | 2017-03-21T13:06:55.000000 | - |
| cinder-scheduler | newton | nova | enabled | up | 2017-03-21T13:06:53.000000 | - |
| cinder-volume | newton@lvm | nova | disabled | up | 2017-03-21T13:06:49.000000 | - |
| cinder-volume | newton@rbd | nova | enabled | down | 2017-03-21T13:05:57.000000 | - |
+------------------+------------+------+----------+-------+----------------------------+-----------------+
# cinder service-list
+------------------+------------+------+----------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+------------+------+----------+-------+----------------------------+-----------------+
| cinder-backup | newton | nova | enabled | up | 2017-03-21T13:06:55.000000 | - |
| cinder-scheduler | newton | nova | enabled | up | 2017-03-21T13:06:53.000000 | - |
| cinder-volume | newton@lvm | nova | disabled | up | 2017-03-21T13:06:59.000000 | - |
| cinder-volume | newton@rbd | nova | enabled | up | 2017-03-21T13:06:57.000000 | - |
+------------------+------------+------+----------+-------+----------------------------+-----------------+
#
Reproduce the steps
-------------------------------
1.modify config
#vim /etc/cinder/cinder.conf
rbd_max_clone_depth = 2
2.Create a volume vol1 ,size 100G
3.Create a volume vol2 from vol1
4.Create a volume vol3 from vol2
5.Check cinder-volume service status
Fix proposed to branch: master /review. openstack. org/448350
Review: https:/