Skip to content

[GH-94]Add VNX QoS support#95

Merged
jealous merged 1 commit into
developfrom
vnx_qos_support
Mar 7, 2017
Merged

[GH-94]Add VNX QoS support#95
jealous merged 1 commit into
developfrom
vnx_qos_support

Conversation

@peter-wangxu
Copy link
Copy Markdown
Contributor

  • Add VNXIOClass and related operations
  • Add VNXIOPolicy and related operations

@peter-wangxu peter-wangxu force-pushed the vnx_qos_support branch 21 times, most recently from 20e3d58 to 34bc809 Compare March 1, 2017 08:28
Comment thread storops/exception.py
@cli_exception
class VNXIOCLassRunningError(VNXIOClassError):
error_message = 'Can not modify or delete an I/O Class while it is '
'currently running'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently is redundant and you missed a period.

Copy link
Copy Markdown
Contributor Author

@peter-wangxu peter-wangxu Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot modify this message, it's extracted from naviseccli output. I can add the period, since it's part of original output.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Comment thread storops/exception.py
@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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can not modify, delete a policy or update event log settings when the policy is running.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Comment thread storops/exception.py

@cli_exception
class VNXTargetNotReadyError(VNXMigrationError):
error_message = 'The destination LUN is not available for migration'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing period.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure whether there is a period for the error message, since it's harmless, how about just keep it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Comment thread storops/vnx/block_cli.py Outdated
cmd = ['nqm', '-ioclass', '-create', '-name', name, '-iotype', iotype]
cmd += int_var('-minsize', minsize)
cmd += int_var('-maxsize', maxsize)
if lun_ids:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 888 to line 890 can be replaced with cmd += text_var('-luns', lun_ids)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread storops/vnx/block_cli.py Outdated
if lun_ids:
cmd += ['-luns']
cmd += lun_ids
if smp_names:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto


@staticmethod
def get(cli, name=None):
if name:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One return each function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread storops/vnx/resource/nqm.py Outdated
def create(cli, name, ioclasses=None, fail_action=None, time_limit=None,
eval_window=None):
ioclass_names = []
if ioclasses:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated with line 241 to line 243. Extract them to a function, please.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread storops_test/vnx/resource/test_nqm.py Outdated
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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list(map(lambda l: assert_that(l, instance_of(VNXLun)), ioclass.luns))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread storops_test/vnx/resource/test_nqm.py Outdated
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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list(map(lambda l: assert_that(l, instance_of(VNXLun)), ioclass.luns))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread storops_test/vnx/resource/test_nqm.py Outdated
@patch_cli
def test_delete_ioclasse(self):
ioclass = VNXIOClass(name='to_delete', cli=t_cli())
ioclass.delete()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No assert?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Contributor

@jealous jealous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test for check_list, etc.

Comment thread storops/exception.py
@cli_exception
class VNXIOCLassRunningError(VNXIOClassError):
error_message = 'Can not modify or delete an I/O Class while it is '
'currently running'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Comment thread storops/exception.py
@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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Comment thread storops/exception.py

@cli_exception
class VNXTargetNotReadyError(VNXMigrationError):
error_message = 'The destination LUN is not available for migration'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Comment thread storops/lib/common.py
else:
raise ValueError('"{}" must be list or None.'.format(value))
return ret

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test for this function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Comment thread storops/vnx/enums.py
self.tolerance = tolerance

def get_option(self):
if self.method == VNXCtrlMethod.NO_CTRL:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

"""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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

* Add VNXIOClass and related operations
* Add VNXIOPolicy and related operations
@jealous jealous merged commit 60a8dd0 into develop Mar 7, 2017
@jealous jealous deleted the vnx_qos_support branch March 7, 2017 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants