[GH-94]Add VNX QoS support#95
Conversation
peter-wangxu
commented
Feb 20, 2017
- Add VNXIOClass and related operations
- Add VNXIOPolicy and related operations
20e3d58 to
34bc809
Compare
| @cli_exception | ||
| class VNXIOCLassRunningError(VNXIOClassError): | ||
| error_message = 'Can not modify or delete an I/O Class while it is ' | ||
| 'currently running' |
There was a problem hiding this comment.
currently is redundant and you missed a period.
There was a problem hiding this comment.
I cannot modify this message, it's extracted from naviseccli output. I can add the period, since it's part of original output.
| @cli_exception | ||
| class VNXIOPolicyRunningError(VNXIOPolicyError): | ||
| error_message = 'Can not modify a Policy, delete a Policy or update event ' | ||
| 'log settings while it is currently running' |
There was a problem hiding this comment.
Can not modify, delete a policy or update event log settings when the policy is running.
|
|
||
| @cli_exception | ||
| class VNXTargetNotReadyError(VNXMigrationError): | ||
| error_message = 'The destination LUN is not available for migration' |
There was a problem hiding this comment.
I am not sure whether there is a period for the error message, since it's harmless, how about just keep it?
| cmd = ['nqm', '-ioclass', '-create', '-name', name, '-iotype', iotype] | ||
| cmd += int_var('-minsize', minsize) | ||
| cmd += int_var('-maxsize', maxsize) | ||
| if lun_ids: |
There was a problem hiding this comment.
line 888 to line 890 can be replaced with cmd += text_var('-luns', lun_ids)
There was a problem hiding this comment.
lun_ids is a list of id, could not use text_var
As I found lun_ids must be a list of parameters, and cannot be joined as one single string parameter.
| if lun_ids: | ||
| cmd += ['-luns'] | ||
| cmd += lun_ids | ||
| if smp_names: |
|
|
||
| @staticmethod | ||
| def get(cli, name=None): | ||
| if name: |
| def create(cli, name, ioclasses=None, fail_action=None, time_limit=None, | ||
| eval_window=None): | ||
| ioclass_names = [] | ||
| if ioclasses: |
There was a problem hiding this comment.
Duplicated with line 241 to line 243. Extract them to a function, please.
| assert_that(ioclass.io_type, equal_to('ReadWrite')) | ||
| assert_that(ioclass.io_size_range, equal_to('Any')) | ||
| assert_that(ioclass.control_method, equal_to('No Control')) | ||
| assert_that(ioclass.luns[0], instance_of(VNXLun)) |
There was a problem hiding this comment.
list(map(lambda l: assert_that(l, instance_of(VNXLun)), ioclass.luns))| assert_that(ioclass.control_method, equal_to('Limit')) | ||
| assert_that(ioclass.metric_type, equal_to('Bandwidth')) | ||
| assert_that(ioclass.goal_value, equal_to('1000.0 MB/s')) | ||
| assert_that(ioclass.luns[0], instance_of(VNXLun)) |
There was a problem hiding this comment.
list(map(lambda l: assert_that(l, instance_of(VNXLun)), ioclass.luns))| @patch_cli | ||
| def test_delete_ioclasse(self): | ||
| ioclass = VNXIOClass(name='to_delete', cli=t_cli()) | ||
| ioclass.delete() |
34bc809 to
1c3a039
Compare
jealous
left a comment
There was a problem hiding this comment.
Please add test for check_list, etc.
| @cli_exception | ||
| class VNXIOCLassRunningError(VNXIOClassError): | ||
| error_message = 'Can not modify or delete an I/O Class while it is ' | ||
| 'currently running' |
| @cli_exception | ||
| class VNXIOPolicyRunningError(VNXIOPolicyError): | ||
| error_message = 'Can not modify a Policy, delete a Policy or update event ' | ||
| 'log settings while it is currently running' |
|
|
||
| @cli_exception | ||
| class VNXTargetNotReadyError(VNXMigrationError): | ||
| error_message = 'The destination LUN is not available for migration' |
| else: | ||
| raise ValueError('"{}" must be list or None.'.format(value)) | ||
| return ret | ||
|
|
There was a problem hiding this comment.
Please add test for this function.
| self.tolerance = tolerance | ||
|
|
||
| def get_option(self): | ||
| if self.method == VNXCtrlMethod.NO_CTRL: |
| """Aggregator for ioclass_luns and ioclass_snapshots.""" | ||
| lun_list, smp_list = [], [] | ||
| if self.ioclass_luns: | ||
| lun_list = map(lambda l: VNXLun(lun_id=l.lun_id, name=l.name, |
1c3a039 to
4deea2f
Compare
4deea2f to
2f69fb6
Compare
* Add VNXIOClass and related operations * Add VNXIOPolicy and related operations
2f69fb6 to
53ce294
Compare