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
This commit is contained in:
jeremy.zhang 2018-06-19 20:28:27 +08:00
parent 1aa9231cb2
commit 4ad3a254d4

View File

@ -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},