Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emc vnx block driver #392

Closed
wants to merge 2 commits into from
Closed

Add emc vnx block driver #392

wants to merge 2 commits into from

Conversation

jiangyutan
Copy link
Contributor

@jiangyutan jiangyutan commented Nov 23, 2020

add emc vnx storage driver to community

@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #392 (063cdfa) into v0.8.0-maint (4d8429d) will increase coverage by 0.38%.
The diff coverage is 68.32%.

@@               Coverage Diff                @@
##           v0.8.0-maint     #392      +/-   ##
================================================
+ Coverage         66.88%   67.27%   +0.38%     
================================================
  Files                88       99      +11     
  Lines              6025     7490    +1465     
  Branches            690      914     +224     
================================================
+ Hits               4030     5039    +1009     
- Misses             1784     2129     +345     
- Partials            211      322     +111     
Impacted Files Coverage Δ
delfin/drivers/utils/navicli_client.py 37.03% <37.03%> (ø)
delfin/drivers/utils/ssh_client.py 42.16% <42.68%> (+0.50%) ⬆️
delfin/drivers/hitachi/vsp/rest_handler.py 55.97% <55.97%> (ø)
...in/drivers/dell_emc/vnx_block/component_handler.py 68.07% <68.07%> (ø)
delfin/drivers/dell_emc/vnx_block/navi_handler.py 68.19% <68.19%> (ø)
delfin/drivers/dell_emc/vnx_block/alert_handler.py 70.93% <70.93%> (ø)
delfin/drivers/ibm/storwize_svc/ssh_handler.py 72.18% <72.18%> (ø)
delfin/drivers/hitachi/vsp/vsp_stor.py 75.30% <75.30%> (ø)
delfin/drivers/utils/tools.py 76.92% <76.92%> (ø)
delfin/drivers/ibm/storwize_svc/storwize_svc.py 96.15% <96.15%> (ø)
... and 17 more

@kumarashit
Copy link
Collaborator

Use proper template and put PR description

if used_map:
used_cap = used_map.get('used_cap')
if used_cap == 0:
status = constants.StorageStatus.ABNORMAL
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the status be abnormal if used_cap is 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The state of vnx block storage is determined by whether the usage and the remaining amount can be fetched. The usage is the amount allocated or used by all Lun. If the remaining amount or usage is 0, it means that the command line may not be able to obtain the stored related information, so it is set to abnormal

Copy link
Collaborator

Choose a reason for hiding this comment

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

But then the storage status being abnormal is misleading. It means the storage system is down

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cancelled

else:
# If no data is returned, it indicates that there
# may be a problem with the network or the device.
# Default return OFFLINE
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the data is not available, it doesn't mean storage is OFFLINE. It maybe a temporary network issue from Client. This is misleading

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

return self.handler_volume(volumes, pool_ids, storage_id)

except Exception as e:
err_msg = "Failed to get list volumes from EmcVnxStor: %s" % (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
err_msg = "Failed to get list volumes from EmcVnxStor: %s" % (
err_msg = "Failed to get list of volumes from EmcVnxStor: %s" % (

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

@@ -0,0 +1,469 @@
# Copyright 2020 The SODA Authors.
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this copyright?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

def get_agent(self):
"""get agent info"""
agent_model = {}
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about moving the whole try catch block into common function and here simply call that common function. This common function can return result

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implementation method self.navi_ Exe is a public method, but different resource contents return different processing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, i got that..i was saying that there is lots of code repetition which can be avoided by simply getting the result and processing separately

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

re = out.strip()
if re:
result = re
if 'Caller not privileged' in result:
Copy link
Collaborator

Choose a reason for hiding this comment

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

To avoid multiple if elif, can we not keep a map of string and the exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Many exceptions are judged by the returned value content, while some information in the returned content is to change, such as IP, etc., so only a part of the keywords can be intercepted to judge, so map and other methods cannot be used at present.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I doubt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

kumarashit
kumarashit previously approved these changes Nov 26, 2020
Copy link
Collaborator

@kumarashit kumarashit left a comment

Choose a reason for hiding this comment

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

LGTM

@jiangyutan jiangyutan closed this Dec 7, 2020
@jiangyutan jiangyutan deleted the vnx_block20201106 branch December 7, 2020 02:13
amanr032 pushed a commit to amanr032/delfin that referenced this pull request Dec 5, 2022
After redis config change restart service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants