Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem has obviously already been solved in Pike release. It's only one line and basically replacing diff_iterate() with v.size(). This reduces the CPU load for cinder-volume.

control1:~ # diff -u /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py.dist /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py
--- /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py.dist  2017-10-17 12:16:01.936816297 +0200
+++ /usr/lib/python2.7/site-packages/cinder/volume/drivers/rbd.py       2017-10-18 15:05:39.105953958 +0200
@@ -367,7 +367,8 @@
                     # non-default volume_name_template settings.  Template
                     # must start with "volume".
                     with RBDVolumeProxy(self, t, read_only=True) as v:
-                        v.diff_iterate(0, v.size(), None, self._iterate_cb)
+                        self._total_usage += v.size()

     def _update_volume_stats(self):
         stats = {

https://review.openstack.org/#/c/508455/