-
Notifications
You must be signed in to change notification settings - Fork 354
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
Implement list_volumes() API for VMAX driver #70
Conversation
free_cap = total_cap - used_cap | ||
|
||
# TODO: Update constants.VolumeStatus to make mapping more precise | ||
switcher = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just optimization suggestion:
switcher can be out of foor loop or even top of try block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
try: | ||
# List all volumes | ||
volumes = self.conn.provisioning.get_volume_list(filters={'data_volume': 'false'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure, no. of chars in a line not >79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if vol['num_of_storage_groups'] == 1: | ||
sg = vol['storageGroupId'][0] | ||
sg_info = self.conn.provisioning.get_storage_group(sg) | ||
v['original_pool_id'] = sg_info['srp'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'original_pool_id' or 'original_id' ?? . Plz cross check models.
one Q:
incase 'num_of_storage_groups' !=1, there will be no 'original_id' of a pool??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is 'original_pool_id' (in class Volume(BASE, DolphinBase)). Currently we meed SG of the volume to get these info. Please see the TODO comment in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. Thanks
def list_volumes(self, storage_id): | ||
|
||
try: | ||
# List all volumes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can u update comment on what are type of volumes from backend will be listed for more clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return volume_list | ||
|
||
except Exception as err: | ||
LOG.error("Failed to get list volumes from vmax: {}".format(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep as VMAX as maintained in other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
LGTM |
used_cap = (total_cap * vol['allocated_percent']) / 100.0 | ||
free_cap = total_cap - used_cap | ||
|
||
status = switcher.get(vol['status'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest , default to 'Unknown', what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Codecov Report
@@ Coverage Diff @@
## master #70 +/- ##
==========================================
- Coverage 29.37% 29.20% -0.18%
==========================================
Files 59 59
Lines 3819 3845 +26
Branches 428 431 +3
==========================================
+ Hits 1122 1123 +1
- Misses 2680 2705 +25
Partials 17 17
|
a6702ef
to
b8e2222
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
This PR implements list_volumes() API for the Dell EMC VMAX driver.
Functionality is verified using VMAX250F backed.
What this PR does / why we need it:
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note: