From 2940c2d096b2e778ddef26f7384db6bcd7da8c70 Mon Sep 17 00:00:00 2001 From: Jinru Yan Date: Thu, 9 Jul 2015 09:30:45 +0800 Subject: [PATCH] Report capability of multiattach for FlashSystem This patch enables the multiattach capability reporting in _update_volume_stats. This will allow nova to attach and detach a volume to multiple virtual machine instances. Change-Id: Ie66850c954168612dd1c17c14e75cd64c0c6d1e7 Implements: blueprint ibm-flashsystem-multiattach --- .../volume/drivers/ibm/flashsystem_common.py | 22 ++++++++++--------- cinder/volume/drivers/ibm/flashsystem_fc.py | 3 ++- .../volume/drivers/ibm/flashsystem_iscsi.py | 3 ++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cinder/volume/drivers/ibm/flashsystem_common.py b/cinder/volume/drivers/ibm/flashsystem_common.py index 9744dbbf3..678eecb8a 100644 --- a/cinder/volume/drivers/ibm/flashsystem_common.py +++ b/cinder/volume/drivers/ibm/flashsystem_common.py @@ -72,10 +72,11 @@ class FlashSystemDriver(san.SanDriver): initialize/terminate 1.0.3 - Initial driver for iSCSI 1.0.4 - Split Flashsystem driver into common and FC + 1.0.5 - Report capability of volume multiattach """ - VERSION = "1.0.4" + VERSION = "1.0.5" def __init__(self, *args, **kwargs): super(FlashSystemDriver, self).__init__(*args, **kwargs) @@ -843,16 +844,17 @@ class FlashSystemDriver(san.SanDriver): """Retrieve stats info from volume group.""" LOG.debug("Updating volume stats.") - data = {} - data['vendor_name'] = 'IBM' - data['driver_version'] = self.VERSION - data['storage_protocol'] = self._protocol - - data['total_capacity_gb'] = 0 - data['free_capacity_gb'] = 0 - data['reserved_percentage'] = self.configuration.reserved_percentage - data['QoS_support'] = False + data = { + 'vendor_name': 'IBM', + 'driver_version': self.VERSION, + 'storage_protocol': self._protocol, + 'total_capacity_gb': 0, + 'free_capacity_gb': 0, + 'reserved_percentage': self.configuration.reserved_percentage, + 'QoS_support': False, + 'multiattach': True, + } pool = FLASHSYSTEM_VOLPOOL_NAME backend_name = self.configuration.safe_get('volume_backend_name') diff --git a/cinder/volume/drivers/ibm/flashsystem_fc.py b/cinder/volume/drivers/ibm/flashsystem_fc.py index ba3ac951d..329b0207f 100644 --- a/cinder/volume/drivers/ibm/flashsystem_fc.py +++ b/cinder/volume/drivers/ibm/flashsystem_fc.py @@ -63,10 +63,11 @@ class FlashSystemFCDriver(fscommon.FlashSystemDriver, initialize/terminate 1.0.3 - Initial driver for iSCSI 1.0.4 - Split Flashsystem driver into common and FC + 1.0.5 - Report capability of volume multiattach """ - VERSION = "1.0.4" + VERSION = "1.0.5" def __init__(self, *args, **kwargs): super(FlashSystemFCDriver, self).__init__(*args, **kwargs) diff --git a/cinder/volume/drivers/ibm/flashsystem_iscsi.py b/cinder/volume/drivers/ibm/flashsystem_iscsi.py index b378a0812..5634a0b20 100644 --- a/cinder/volume/drivers/ibm/flashsystem_iscsi.py +++ b/cinder/volume/drivers/ibm/flashsystem_iscsi.py @@ -62,10 +62,11 @@ class FlashSystemISCSIDriver(fscommon.FlashSystemDriver, initialize/terminate 1.0.3 - Initial driver for iSCSI 1.0.4 - Split Flashsystem driver into common and FC + 1.0.5 - Report capability of volume multiattach """ - VERSION = "1.0.4" + VERSION = "1.0.5" def __init__(self, *args, **kwargs): super(FlashSystemISCSIDriver, self).__init__(*args, **kwargs) -- 2.45.2