INFINIDAT: add support for overprovisioning
The driver reports max_over_subscription_ratio as defined by the user in the cinder configuration file, in addition to whether the volumes are thin-provisioned or not. This allows overprovisioning in thin-provisioned volumes in InfiniBox. Change-Id: I862ec2d06c169562aa8bbc95ab202cd5eb88440d
This commit is contained in:
parent
58c1ea70c8
commit
88080cb45c
@ -48,7 +48,7 @@ class InfiniboxDriverTestCaseBase(test.TestCase):
|
||||
self.configuration.infinidat_storage_protocol = 'fc'
|
||||
self.configuration.san_ip = 'mockbox'
|
||||
self.configuration.infinidat_pool_name = 'mockpool'
|
||||
self.configuration.san_thin_provision = 'thin'
|
||||
self.configuration.san_thin_provision = True
|
||||
self.configuration.san_login = 'user'
|
||||
self.configuration.san_password = 'pass'
|
||||
self.configuration.volume_backend_name = 'mock'
|
||||
@ -60,6 +60,7 @@ class InfiniboxDriverTestCaseBase(test.TestCase):
|
||||
self.configuration.chap_username = None
|
||||
self.configuration.chap_password = None
|
||||
self.configuration.infinidat_use_compression = None
|
||||
self.configuration.max_over_subscription_ratio = 10.0
|
||||
|
||||
self.driver = infinidat.InfiniboxVolumeDriver(
|
||||
configuration=self.configuration)
|
||||
@ -190,6 +191,13 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
|
||||
self.assertRaises(exception.VolumeDriverException,
|
||||
self.driver.get_volume_stats)
|
||||
|
||||
def test_get_volume_stats_max_over_subscription_ratio(self):
|
||||
result = self.driver.get_volume_stats()
|
||||
# check the defaults defined in setUp
|
||||
self.assertEqual(10.0, result['max_over_subscription_ratio'])
|
||||
self.assertTrue(result['thin_provisioning_support'])
|
||||
self.assertFalse(result['thick_provisioning_support'])
|
||||
|
||||
@mock.patch("cinder.volume.volume_types.get_volume_type_qos_specs")
|
||||
def test_create_volume(self, *mocks):
|
||||
self.driver.create_volume(test_volume)
|
||||
|
@ -441,6 +441,8 @@ class InfiniboxVolumeDriver(san.SanISCSIDriver):
|
||||
total_capacity_gb = float(physical_capacity_bytes) / units.Gi
|
||||
qos_support = (hasattr(self._system.compat, "has_qos") and
|
||||
self._system.compat.has_qos())
|
||||
max_osr = self.configuration.max_over_subscription_ratio
|
||||
thin = self.configuration.san_thin_provision
|
||||
self._volume_stats = dict(volume_backend_name=self._backend_name,
|
||||
vendor_name=VENDOR_NAME,
|
||||
driver_version=self.VERSION,
|
||||
@ -449,7 +451,10 @@ class InfiniboxVolumeDriver(san.SanISCSIDriver):
|
||||
total_capacity_gb=total_capacity_gb,
|
||||
free_capacity_gb=free_capacity_gb,
|
||||
consistent_group_snapshot_enabled=True,
|
||||
QoS_support=qos_support)
|
||||
QoS_support=qos_support,
|
||||
thin_provisioning_support=thin,
|
||||
thick_provisioning_support=not thin,
|
||||
max_over_subscription_ratio=max_osr)
|
||||
return self._volume_stats
|
||||
|
||||
def _create_volume(self, volume):
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- Added support for oversubscription in thin provisioning in the INFINIDAT
|
||||
InfiniBox driver. To use oversubscription, define
|
||||
``max_over_subscription_ratio`` in the cinder configuration file.
|
Loading…
Reference in New Issue
Block a user