From 5dfc14390938d48dbaac4bb75d381f6d705f4414 Mon Sep 17 00:00:00 2001 From: zhongjun Date: Thu, 19 Nov 2015 11:46:14 +0800 Subject: [PATCH] QoS support for shares QoS is a common attribute, so add the QoS capability in common capabilities doc. This is a simple first step towards what the blueprints proposes. Partially implements: bp manila-support-qos Change-Id: I377bf0abcc62239c9a1a5ee5c28c336b2b6c410a --- .../devref/capabilities_and_extra_specs.rst | 17 ++++++++++++++--- doc/source/devref/driver_requirements.rst | 5 +++-- .../devref/pool-aware-manila-scheduler.rst | 4 ++-- manila/scheduler/host_manager.py | 8 ++++---- manila/share/driver.py | 2 +- .../share/drivers/emc/plugins/vnx/connection.py | 2 +- manila/share/drivers/hitachi/hds_hnas.py | 2 +- manila/share/drivers/hpe/hpe_3par_driver.py | 2 +- manila/share/drivers/huawei/v3/connection.py | 2 +- .../netapp/dataontap/cluster_mode/lib_base.py | 2 +- manila/tests/api/v1/test_scheduler_stats.py | 8 ++++---- manila/tests/api/views/test_scheduler_stats.py | 8 ++++---- manila/tests/scheduler/test_host_manager.py | 6 +++--- manila/tests/share/drivers/emc/test_driver.py | 2 +- .../share/drivers/hdfs/test_hdfs_native.py | 2 +- .../share/drivers/hpe/test_hpe_3par_driver.py | 6 +++--- .../share/drivers/huawei/test_huawei_nas.py | 4 ++-- manila/tests/share/drivers/ibm/test_gpfs.py | 2 +- .../share/drivers/netapp/dataontap/fakes.py | 8 ++++---- manila/tests/share/drivers/test_generic.py | 2 +- .../share/drivers/test_glusterfs_native.py | 2 +- manila/tests/share/test_driver.py | 2 +- 22 files changed, 55 insertions(+), 43 deletions(-) diff --git a/doc/source/devref/capabilities_and_extra_specs.rst b/doc/source/devref/capabilities_and_extra_specs.rst index 4d2c2257d9..0c32fe82e3 100644 --- a/doc/source/devref/capabilities_and_extra_specs.rst +++ b/doc/source/devref/capabilities_and_extra_specs.rst @@ -85,6 +85,17 @@ be created. thick. So, a Manila pool will always report thin_provisioning as True or False. Added in Liberty. +* `qos` - indicates that a backend/pool can provide shares using some + QoS (Quality of Service) specification. The default value of the qos + capability (if a driver doesn't report it) is False. Administrators + can make a share type use QoS by setting this extra-spec to ' True' and + also setting the relevant QoS-related extra specs for the drivers being used. + Administrators can prevent a share type from using QoS by setting this + extra-spec to ' False'. Different drivers have different ways of specifying + QoS limits (or guarantees) and this extra spec merely allows the scheduler to + filter by pools that either have or don't have QoS support enabled. Added in + Mitaka. + Reporting Capabilities ---------------------- Drivers report capabilities as part of the updated stats (e.g. capacity) @@ -113,15 +124,15 @@ example vendor prefix: 'my_capability_2': True, # stats & capabilities #/ 'pools': [ - {'pool_name': + {'pool_name': 'thin-dedupe-compression pool', #\ 'total_capacity_gb': 500, # mandatory stats for 'free_capacity_gb': 230, # pools - 'QoS_support': 'False', # | 'reserved_percentage': 0, #/ #\ 'dedupe': True, # common capabilities 'compression': True, # + 'qos': True, # this backend supports QoS 'thin_provisioning': True, # 'max_over_subscription_ratio': 10, # (mandatory for thin) 'provisioned_capacity_gb': 270, # (mandatory for thin) @@ -134,7 +145,7 @@ example vendor prefix: {'pool_name': 'thick pool', 'total_capacity_gb': 1024, 'free_capacity_gb': 1024, - 'QoS_support': 'False', + 'qos': False, 'reserved_percentage': 0, 'dedupe': False, 'compression': False, diff --git a/doc/source/devref/driver_requirements.rst b/doc/source/devref/driver_requirements.rst index 76cb9df7aa..1f199f6b4f 100644 --- a/doc/source/devref/driver_requirements.rst +++ b/doc/source/devref/driver_requirements.rst @@ -93,7 +93,8 @@ function correctly in Manila, such as: - dedupe: whether the backend supports deduplication; - compression: whether the backend supports compressed shares; - thin_provisioning: whether the backend is overprovisioning shares; -- pools: list of storage pools managed by this driver instance. +- pools: list of storage pools managed by this driver instance; +- qos: whether the backend supports quality of service for shares. .. note:: for more information please see http://docs.openstack.org/developer/manila/devref/capabilities_and_extra_specs.html @@ -197,4 +198,4 @@ Shares can be created within Consistency Groups in order to guarantee snapshot consistency of multiple shares. In order to make use of this feature, driver vendors must report this capability and implement its functions to work according to the backend, so the feature can be properly invoked through -Manila API. \ No newline at end of file +Manila API. diff --git a/doc/source/devref/pool-aware-manila-scheduler.rst b/doc/source/devref/pool-aware-manila-scheduler.rst index f0bc39b2c7..4f44c6dbd0 100644 --- a/doc/source/devref/pool-aware-manila-scheduler.rst +++ b/doc/source/devref/pool-aware-manila-scheduler.rst @@ -191,7 +191,7 @@ pools: 'total_capacity_gb': 500, # mandatory stats for 'free_capacity_gb': 230, # pools 'allocated_capacity_gb': 270, # | - 'QoS_support': 'False', # | + 'qos': True, # | 'reserved_percentage': 0, #/ 'dying_disks': 100, #\ @@ -203,7 +203,7 @@ pools: 'total_capacity_gb': 1024, 'free_capacity_gb': 1024, 'allocated_capacity_gb': 0, - 'QoS_support': 'False', + 'qos': False, 'reserved_percentage': 0, 'dying_disks': 200, diff --git a/manila/scheduler/host_manager.py b/manila/scheduler/host_manager.py index ecb47730bd..7f2a1911bf 100644 --- a/manila/scheduler/host_manager.py +++ b/manila/scheduler/host_manager.py @@ -108,7 +108,7 @@ class HostState(object): self.vendor_name = None self.driver_version = 0 self.storage_protocol = None - self.QoS_support = False + self.qos = False # Mutable available resources. # These will change as resources are virtually "consumed". self.total_capacity_gb = 0 @@ -164,7 +164,7 @@ class HostState(object): 'total_capacity_gb': 500, # mandatory stats for 'free_capacity_gb': 230, # pools 'allocated_capacity_gb': 270, # | - 'QoS_support': 'False', # | + 'qos': 'False', # | 'reserved_percentage': 0, #/ 'dying_disks': 100, #\ @@ -176,7 +176,7 @@ class HostState(object): 'total_capacity_gb': 1024, 'free_capacity_gb': 1024, 'allocated_capacity_gb': 0, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dying_disks': 200, @@ -346,7 +346,7 @@ class PoolState(HostState): self.free_capacity_gb = capability['free_capacity_gb'] self.allocated_capacity_gb = capability.get( 'allocated_capacity_gb', 0) - self.QoS_support = capability.get('QoS_support', False) + self.qos = capability.get('qos', False) self.reserved_percentage = capability['reserved_percentage'] # NOTE(xyang): provisioned_capacity_gb is the apparent total # capacity of all the shares created on a backend, which is diff --git a/manila/share/driver.py b/manila/share/driver.py index 9357629d13..6ab6966c03 100644 --- a/manila/share/driver.py +++ b/manila/share/driver.py @@ -813,7 +813,7 @@ class ShareDriver(object): total_capacity_gb='unknown', free_capacity_gb='unknown', reserved_percentage=0, - QoS_support=False, + qos=False, pools=self.pools or None, snapshot_support=self.snapshots_are_supported, ) diff --git a/manila/share/drivers/emc/plugins/vnx/connection.py b/manila/share/drivers/emc/plugins/vnx/connection.py index bcaf8c05b5..08b86c1e92 100644 --- a/manila/share/drivers/emc/plugins/vnx/connection.py +++ b/manila/share/drivers/emc/plugins/vnx/connection.py @@ -525,7 +525,7 @@ class VNXStorageConnection(driver.StorageConnection): pool_name=pool['name'], total_capacity_gb=total_size, free_capacity_gb=total_size - used_size, - QoS_support=False, + qos=False, reserved_percentage=self.reserved_percentage, ) stats_dict['pools'].append(pool_stat) diff --git a/manila/share/drivers/hitachi/hds_hnas.py b/manila/share/drivers/hitachi/hds_hnas.py index dbcb3cd4c6..ef2634fb3d 100644 --- a/manila/share/drivers/hitachi/hds_hnas.py +++ b/manila/share/drivers/hitachi/hds_hnas.py @@ -351,7 +351,7 @@ class HDSHNASDriver(driver.ShareDriver): 'total_capacity_gb': total_space, 'free_capacity_gb': free_space, 'reserved_percentage': reserved, - 'QoS_support': False, + 'qos': False, } LOG.info(_LI("HNAS Capabilities: %(data)s."), diff --git a/manila/share/drivers/hpe/hpe_3par_driver.py b/manila/share/drivers/hpe/hpe_3par_driver.py index 109ca4df01..7c0beb9349 100644 --- a/manila/share/drivers/hpe/hpe_3par_driver.py +++ b/manila/share/drivers/hpe/hpe_3par_driver.py @@ -422,7 +422,7 @@ class HPE3ParShareDriver(driver.ShareDriver): 'provisioned_capacity_gb': 0, 'reserved_percentage': reserved_share_percentage, 'max_over_subscription_ratio': max_over_subscription_ratio, - 'QoS_support': False, + 'qos': False, 'thin_provisioning': True, # 3PAR default is thin } diff --git a/manila/share/drivers/huawei/v3/connection.py b/manila/share/drivers/huawei/v3/connection.py index 0c75d62412..0010cddbd7 100644 --- a/manila/share/drivers/huawei/v3/connection.py +++ b/manila/share/drivers/huawei/v3/connection.py @@ -252,7 +252,7 @@ class V3StorageConnection(driver.HuaweiBase): self.configuration.safe_get( 'max_over_subscription_ratio')), allocated_capacity_gb=capacity['CONSUMEDCAPACITY'], - QoS_support=False, + qos=False, reserved_percentage=0, thin_provisioning=[True, False], dedupe=[True, False], diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py index 97fa549b5c..90ca460db1 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py @@ -260,7 +260,7 @@ class NetAppCmodeFileStorageLibrary(object): 'total_capacity_gb': total_capacity_gb, 'free_capacity_gb': free_capacity_gb, 'allocated_capacity_gb': allocated_capacity_gb, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dedupe': [True, False], 'compression': [True, False], diff --git a/manila/tests/api/v1/test_scheduler_stats.py b/manila/tests/api/v1/test_scheduler_stats.py index 89aaa313e5..23490874aa 100644 --- a/manila/tests/api/v1/test_scheduler_stats.py +++ b/manila/tests/api/v1/test_scheduler_stats.py @@ -36,7 +36,7 @@ FAKE_POOLS = [ 'reserved_percentage': 0, 'driver_version': '1.0.0', 'storage_protocol': 'iSCSI', - 'QoS_support': 'False', + 'qos': 'False', }, }, { @@ -52,7 +52,7 @@ FAKE_POOLS = [ 'reserved_percentage': 0, 'driver_version': '1.0.1', 'storage_protocol': 'iSER', - 'QoS_support': 'True', + 'qos': 'True', }, }, ] @@ -161,7 +161,7 @@ class SchedulerStatsControllerTestCase(test.TestCase): 'reserved_percentage': 0, 'driver_version': '1.0.0', 'storage_protocol': 'iSCSI', - 'QoS_support': 'False', + 'qos': 'False', }, }, { @@ -177,7 +177,7 @@ class SchedulerStatsControllerTestCase(test.TestCase): 'reserved_percentage': 0, 'driver_version': '1.0.1', 'storage_protocol': 'iSER', - 'QoS_support': 'True', + 'qos': 'True', }, }, ], diff --git a/manila/tests/api/views/test_scheduler_stats.py b/manila/tests/api/views/test_scheduler_stats.py index 382833d37c..0354617ace 100644 --- a/manila/tests/api/views/test_scheduler_stats.py +++ b/manila/tests/api/views/test_scheduler_stats.py @@ -27,7 +27,7 @@ POOL1 = { 'capabilities': { 'pool_name': 'pool1', 'driver_handles_share_servers': False, - 'QoS_support': 'False', + 'qos': 'False', 'timestamp': '2015-03-15T19:15:42.611690', 'allocated_capacity_gb': 5, 'total_capacity_gb': 10, @@ -41,7 +41,7 @@ POOL2 = { 'capabilities': { 'pool_name': 'pool2', 'driver_handles_share_servers': False, - 'QoS_support': 'False', + 'qos': 'False', 'timestamp': '2015-03-15T19:15:42.611690', 'allocated_capacity_gb': 15, 'total_capacity_gb': 20, @@ -59,7 +59,7 @@ POOLS_DETAIL_VIEW = { 'capabilities': { 'pool_name': 'pool1', 'driver_handles_share_servers': False, - 'QoS_support': 'False', + 'qos': 'False', 'timestamp': '2015-03-15T19:15:42.611690', 'allocated_capacity_gb': 5, 'total_capacity_gb': 10, @@ -72,7 +72,7 @@ POOLS_DETAIL_VIEW = { 'capabilities': { 'pool_name': 'pool2', 'driver_handles_share_servers': False, - 'QoS_support': 'False', + 'qos': 'False', 'timestamp': '2015-03-15T19:15:42.611690', 'allocated_capacity_gb': 15, 'total_capacity_gb': 20, diff --git a/manila/tests/scheduler/test_host_manager.py b/manila/tests/scheduler/test_host_manager.py index 143e6803f7..faa26c6fdc 100644 --- a/manila/tests/scheduler/test_host_manager.py +++ b/manila/tests/scheduler/test_host_manager.py @@ -589,7 +589,7 @@ class HostStateTestCase(test.TestCase): 'total_capacity_gb': 500, 'free_capacity_gb': 230, 'allocated_capacity_gb': 270, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dying_disks': 100, 'super_hero_1': 'spider-man', @@ -600,7 +600,7 @@ class HostStateTestCase(test.TestCase): 'total_capacity_gb': 1024, 'free_capacity_gb': 1024, 'allocated_capacity_gb': 0, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dying_disks': 200, 'super_hero_1': 'superman', @@ -638,7 +638,7 @@ class HostStateTestCase(test.TestCase): 'total_capacity_gb': 10000, 'free_capacity_gb': 10000, 'allocated_capacity_gb': 0, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, }, ], diff --git a/manila/tests/share/drivers/emc/test_driver.py b/manila/tests/share/drivers/emc/test_driver.py index 3625b51707..050571af03 100644 --- a/manila/tests/share/drivers/emc/test_driver.py +++ b/manila/tests/share/drivers/emc/test_driver.py @@ -121,7 +121,7 @@ class EMCShareFrameworkTestCase(test.TestCase): data['total_capacity_gb'] = 'unknown' data['free_capacity_gb'] = 'unknown' data['reserved_percentage'] = 0 - data['QoS_support'] = False + data['qos'] = False data['pools'] = None data['snapshot_support'] = True self.assertEqual(data, self.driver._stats) diff --git a/manila/tests/share/drivers/hdfs/test_hdfs_native.py b/manila/tests/share/drivers/hdfs/test_hdfs_native.py index e6cd1336dd..15915f1410 100644 --- a/manila/tests/share/drivers/hdfs/test_hdfs_native.py +++ b/manila/tests/share/drivers/hdfs/test_hdfs_native.py @@ -405,7 +405,7 @@ class HDFSNativeShareDriverTestCase(test.TestCase): return_value=(11111.0, 12345.0)) result = self._driver.get_share_stats(True) expected_keys = [ - 'QoS_support', 'driver_version', 'share_backend_name', + 'qos', 'driver_version', 'share_backend_name', 'free_capacity_gb', 'total_capacity_gb', 'driver_handles_share_servers', 'reserved_percentage', 'vendor_name', 'storage_protocol', diff --git a/manila/tests/share/drivers/hpe/test_hpe_3par_driver.py b/manila/tests/share/drivers/hpe/test_hpe_3par_driver.py index 820285ddea..a27f4d844f 100644 --- a/manila/tests/share/drivers/hpe/test_hpe_3par_driver.py +++ b/manila/tests/share/drivers/hpe/test_hpe_3par_driver.py @@ -505,7 +505,7 @@ class HPE3ParDriverTestCase(test.TestCase): expected_result = { 'driver_handles_share_servers': True, - 'QoS_support': False, + 'qos': False, 'driver_version': self.driver.VERSION, 'free_capacity_gb': 0, 'max_over_subscription_ratio': None, @@ -559,7 +559,7 @@ class HPE3ParDriverTestCase(test.TestCase): expected_result = { 'driver_handles_share_servers': True, - 'QoS_support': False, + 'qos': False, 'driver_version': expected_version, 'free_capacity_gb': expected_free, 'max_over_subscription_ratio': None, @@ -594,7 +594,7 @@ class HPE3ParDriverTestCase(test.TestCase): self.mock_mediator.get_fpg_status.return_value = {'not_called': 1} expected_result = { - 'QoS_support': False, + 'qos': False, 'driver_handles_share_servers': True, 'driver_version': expected_version, 'free_capacity_gb': 0, diff --git a/manila/tests/share/drivers/huawei/test_huawei_nas.py b/manila/tests/share/drivers/huawei/test_huawei_nas.py index 0d7a8da095..9ccee584dd 100644 --- a/manila/tests/share/drivers/huawei/test_huawei_nas.py +++ b/manila/tests/share/drivers/huawei/test_huawei_nas.py @@ -1404,7 +1404,7 @@ class HuaweiShareDriverTestCase(test.TestCase): expected['reserved_percentage'] = 0 expected['total_capacity_gb'] = 0.0 expected['free_capacity_gb'] = 0.0 - expected['QoS_support'] = False + expected['qos'] = False expected["snapshot_support"] = False expected["pools"] = [] pool = dict( @@ -1412,7 +1412,7 @@ class HuaweiShareDriverTestCase(test.TestCase): total_capacity_gb=2.0, free_capacity_gb=1.0, allocated_capacity_gb=1.0, - QoS_support=False, + qos=False, reserved_percentage=0, compression=[True, False], dedupe=[True, False], diff --git a/manila/tests/share/drivers/ibm/test_gpfs.py b/manila/tests/share/drivers/ibm/test_gpfs.py index b949c72ff6..e83e083ec7 100644 --- a/manila/tests/share/drivers/ibm/test_gpfs.py +++ b/manila/tests/share/drivers/ibm/test_gpfs.py @@ -166,7 +166,7 @@ class GPFSShareDriverTestCase(test.TestCase): mock.Mock(return_value=(11111.0, 12345.0))) result = self._driver.get_share_stats(True) expected_keys = [ - 'QoS_support', 'driver_version', 'share_backend_name', + 'qos', 'driver_version', 'share_backend_name', 'free_capacity_gb', 'total_capacity_gb', 'driver_handles_share_servers', 'reserved_percentage', 'vendor_name', 'storage_protocol', diff --git a/manila/tests/share/drivers/netapp/dataontap/fakes.py b/manila/tests/share/drivers/netapp/dataontap/fakes.py index eb088ede90..b6f89c5fc7 100644 --- a/manila/tests/share/drivers/netapp/dataontap/fakes.py +++ b/manila/tests/share/drivers/netapp/dataontap/fakes.py @@ -437,7 +437,7 @@ POOLS = [ 'total_capacity_gb': 3.3, 'free_capacity_gb': 1.1, 'allocated_capacity_gb': 2.2, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dedupe': [True, False], 'compression': [True, False], @@ -449,7 +449,7 @@ POOLS = [ 'total_capacity_gb': 6.0, 'free_capacity_gb': 2.0, 'allocated_capacity_gb': 4.0, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dedupe': [True, False], 'compression': [True, False], @@ -464,7 +464,7 @@ POOLS_VSERVER_CREDS = [ 'total_capacity_gb': 'unknown', 'free_capacity_gb': 1.1, 'allocated_capacity_gb': 0.0, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dedupe': [True, False], 'compression': [True, False], @@ -476,7 +476,7 @@ POOLS_VSERVER_CREDS = [ 'total_capacity_gb': 'unknown', 'free_capacity_gb': 2.0, 'allocated_capacity_gb': 0.0, - 'QoS_support': 'False', + 'qos': 'False', 'reserved_percentage': 0, 'dedupe': [True, False], 'compression': [True, False], diff --git a/manila/tests/share/drivers/test_generic.py b/manila/tests/share/drivers/test_generic.py index ade7d5efbf..3b6d52c0fa 100644 --- a/manila/tests/share/drivers/test_generic.py +++ b/manila/tests/share/drivers/test_generic.py @@ -1356,7 +1356,7 @@ class GenericShareDriverTestCase(test.TestCase): fake_stats = {'fake_key': 'fake_value'} self._driver._stats = fake_stats expected_keys = [ - 'QoS_support', 'driver_version', 'share_backend_name', + 'qos', 'driver_version', 'share_backend_name', 'free_capacity_gb', 'total_capacity_gb', 'driver_handles_share_servers', 'reserved_percentage', 'vendor_name', 'storage_protocol', diff --git a/manila/tests/share/drivers/test_glusterfs_native.py b/manila/tests/share/drivers/test_glusterfs_native.py index d83e3c7a8c..f857b462b5 100644 --- a/manila/tests/share/drivers/test_glusterfs_native.py +++ b/manila/tests/share/drivers/test_glusterfs_native.py @@ -408,7 +408,7 @@ class GlusterfsNativeShareDriverTestCase(test.TestCase): 'driver_version': '1.1', 'storage_protocol': 'glusterfs', 'reserved_percentage': 0, - 'QoS_support': False, + 'qos': False, 'total_capacity_gb': 'unknown', 'free_capacity_gb': 'unknown', 'pools': None, diff --git a/manila/tests/share/test_driver.py b/manila/tests/share/test_driver.py index 0746c3438f..e4edec305a 100644 --- a/manila/tests/share/test_driver.py +++ b/manila/tests/share/test_driver.py @@ -121,7 +121,7 @@ class ShareDriverTestCase(test.TestCase): def test_get_share_stats_refresh_true(self): conf = configuration.Configuration(None) expected_keys = [ - 'QoS_support', 'driver_version', 'share_backend_name', + 'qos', 'driver_version', 'share_backend_name', 'free_capacity_gb', 'total_capacity_gb', 'driver_handles_share_servers', 'reserved_percentage', 'vendor_name', 'storage_protocol',