summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-16 18:23:04 +0000
committerGerrit Code Review <review@openstack.org>2017-06-16 18:23:04 +0000
commita4bbdd14ab5c84ce856c3731b5887acb20763f27 (patch)
tree6d7a3f263be22030926e8658632bd91596dd6f3c
parent464e8fc8ea3d02d59cc1b2ccafaabebf92f831f0 (diff)
parent9b088ca82a2612f0cf73cfa6bc670c6e5b5f64b6 (diff)
Merge "Ibm storage: added new option for qos type"
-rw-r--r--cinder/tests/unit/volume/drivers/ibm/test_xiv_proxy.py61
-rw-r--r--cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py29
-rw-r--r--releasenotes/notes/xiv-new-qos-independent-type-58885c77efe24798.yaml7
3 files changed, 93 insertions, 4 deletions
diff --git a/cinder/tests/unit/volume/drivers/ibm/test_xiv_proxy.py b/cinder/tests/unit/volume/drivers/ibm/test_xiv_proxy.py
index a18a425..6e47800 100644
--- a/cinder/tests/unit/volume/drivers/ibm/test_xiv_proxy.py
+++ b/cinder/tests/unit/volume/drivers/ibm/test_xiv_proxy.py
@@ -600,6 +600,67 @@ class XIVProxyTest(test.TestCase):
600 perf_name = p._check_perf_class_on_backend({}) 600 perf_name = p._check_perf_class_on_backend({})
601 self.assertEqual('', perf_name) 601 self.assertEqual('', perf_name)
602 602
603 def test_qos_class_name_contains_qos_type(self):
604 """Test backend naming
605
606 Test if the naming convention is correct
607 when getting the right specs with qos type
608 """
609 driver = mock.MagicMock()
610 driver.VERSION = "VERSION"
611
612 p = self.proxy(
613 self.default_storage_info,
614 mock.MagicMock(),
615 test_mock.cinder.exception,
616 driver)
617
618 p.ibm_storage_cli = mock.MagicMock()
619 p.ibm_storage_cli.cmd.perf_class_list.return_value.as_list = []
620 perf_name = p._check_perf_class_on_backend({'bw': '100',
621 'type': 'independent'})
622
623 self.assertEqual('cinder-qos_bw_100_type_independent', perf_name)
624
625 def test_qos_called_with_type_parameter(self):
626 """Test xcli call for qos creation with type"""
627 driver = mock.MagicMock()
628 driver.VERSION = "VERSION"
629
630 p = self.proxy(
631 self.default_storage_info,
632 mock.MagicMock(),
633 test_mock.cinder.exception,
634 driver)
635
636 p.ibm_storage_cli = mock.MagicMock()
637 p.ibm_storage_cli.cmd.perf_class_list.return_value.as_list = []
638 perf_name = p._check_perf_class_on_backend({'bw': '100',
639 'type': 'independent'})
640 p.ibm_storage_cli.cmd.perf_class_create.assert_called_once_with(
641 perf_class=perf_name,
642 type='independent')
643
644 def test_qos_called_with_wrong_type_parameter(self):
645 """Test xcli call for qos creation with wrong type"""
646 driver = mock.MagicMock()
647 driver.VERSION = "VERSION"
648
649 p = self.proxy(
650 self.default_storage_info,
651 mock.MagicMock(),
652 test_mock.cinder.exception,
653 driver)
654
655 p.ibm_storage_cli = mock.MagicMock()
656 p.ibm_storage_cli.cmd.perf_class_list.return_value.as_list = []
657 p.ibm_storage_cli.cmd.perf_class_create.side_effect = (
658 errors.XCLIError('llegal value'))
659
660 ex = getattr(p, "_get_exception")()
661 self.assertRaises(ex, p._check_perf_class_on_backend,
662 {'bw': '100', 'type': 'BAD'})
663
603 def test_qos_class_on_backend_name_correct(self): 664 def test_qos_class_on_backend_name_correct(self):
604 """Test backend naming 665 """Test backend naming
605 666
diff --git a/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py b/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
index 310368b..4c33889 100644
--- a/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
+++ b/cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py
@@ -111,6 +111,13 @@ class XIVProxy(proxy.IBMStorageProxy):
111 """Proxy between the Cinder Volume and Spectrum Accelerate Storage. 111 """Proxy between the Cinder Volume and Spectrum Accelerate Storage.
112 112
113 Supports IBM XIV, Spectrum Accelerate, A9000, A9000R 113 Supports IBM XIV, Spectrum Accelerate, A9000, A9000R
114 Version: 2.1.0
115 Required pyxcli version: 1.1.2
116
117 2.0 - First open source driver version
118 2.1.0 - Support Consistency groups through Generic volume groups
119 - Support XIV\A9000 Volume independent QoS
120
114 """ 121 """
115 async_rates = ( 122 async_rates = (
116 Rate(rpo=120, schedule='00:01:00'), 123 Rate(rpo=120, schedule='00:01:00'),
@@ -172,6 +179,10 @@ class XIVProxy(proxy.IBMStorageProxy):
172 self.ibm_storage_remote_cli = self._init_xcli(remote_id) 179 self.ibm_storage_remote_cli = self._init_xcli(remote_id)
173 self._event_service_start() 180 self._event_service_start()
174 self._update_stats() 181 self._update_stats()
182 LOG.info("IBM Storage %(common_ver)s "
183 "xiv_proxy %(proxy_ver)s. ",
184 {'common_ver': self.full_version,
185 'proxy_ver': self.full_version})
175 self._update_system_id() 186 self._update_system_id()
176 if remote_id: 187 if remote_id:
177 self._update_active_schedule_objects() 188 self._update_active_schedule_objects()
@@ -355,8 +366,10 @@ class XIVProxy(proxy.IBMStorageProxy):
355 366
356 # list is not empty, check if class has the right values 367 # list is not empty, check if class has the right values
357 for perf_class in classes_list: 368 for perf_class in classes_list:
358 if (not perf_class.max_iops == specs.get('iops', '0') or 369 if (not perf_class.get('max_iops',
359 not perf_class.max_bw == specs.get('bw', '0')): 370 None) == specs.get('iops', '0') or
371 not perf_class.get('max_bw',
372 None) == specs.get('bw', '0')):
360 raise self.meta['exception'].VolumeBackendAPIException( 373 raise self.meta['exception'].VolumeBackendAPIException(
361 data=PERF_CLASS_VALUES_ERROR % 374 data=PERF_CLASS_VALUES_ERROR %
362 {'details': perf_class_name}) 375 {'details': perf_class_name})
@@ -374,8 +387,16 @@ class XIVProxy(proxy.IBMStorageProxy):
374 def _create_qos_class(self, perf_class_name, specs): 387 def _create_qos_class(self, perf_class_name, specs):
375 """Create the qos class on the backend.""" 388 """Create the qos class on the backend."""
376 try: 389 try:
377 self._call_xiv_xcli("perf_class_create", 390 # check if we have a shared (default) perf class
378 perf_class=perf_class_name) 391 # or an independent perf class
392 if 'type_' in perf_class_name:
393 _type = perf_class_name.split('type_')[1]
394 self._call_xiv_xcli("perf_class_create",
395 perf_class=perf_class_name,
396 type=_type)
397 else:
398 self._call_xiv_xcli("perf_class_create",
399 perf_class=perf_class_name)
379 400
380 except errors.XCLIError as e: 401 except errors.XCLIError as e:
381 details = self._get_code_and_status_or_message(e) 402 details = self._get_code_and_status_or_message(e)
diff --git a/releasenotes/notes/xiv-new-qos-independent-type-58885c77efe24798.yaml b/releasenotes/notes/xiv-new-qos-independent-type-58885c77efe24798.yaml
new file mode 100644
index 0000000..31b8452
--- /dev/null
+++ b/releasenotes/notes/xiv-new-qos-independent-type-58885c77efe24798.yaml
@@ -0,0 +1,7 @@
1---
2features:
3 - Added independent and shared types for qos classes in XIV & A9000.
4 Shared type enables to share bandwidth and IO rates between volumes
5 of the same class. Independent type gives each volume the same
6 bandwidth and IO rates without being affected by other volumes in
7 the same qos class.