From 4ad3a254d4c3dde11f7f9242ef0f951e7dc73cf8 Mon Sep 17 00:00:00 2001 From: "jeremy.zhang" Date: Tue, 19 Jun 2018 20:28:27 +0800 Subject: [PATCH] Fix the usage of RBDVolumeProxy in getting manageable volumes Pass the 'client' and 'ioctx' paramters to the RBDVolumeProxy() to reuse external connection that already established, which will reduce load to the ceph cluster. Change-Id: I14f41bd10242c037301bc97986c95d72954d7bcc --- cinder/volume/drivers/rbd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index e2f5eaed5b7..eee904567f6 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -1555,7 +1555,9 @@ class RBDDriver(driver.CloneableImageVD, driver.MigrateVD, with RADOSClient(self) as client: for image_name in self.RBDProxy().list(client.ioctx): image_id = volume_utils.extract_id_from_volume_name(image_name) - with RBDVolumeProxy(self, image_name, read_only=True) as image: + with RBDVolumeProxy(self, image_name, read_only=True, + client=client.cluster, + ioctx=client.ioctx) as image: try: image_info = { 'reference': {'source-name': image_name},