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 VMAX driver support for controller & port resources #663

Merged
merged 3 commits into from
Aug 5, 2021

Conversation

joseph-v
Copy link
Collaborator

What this PR does / why we need it:
Add VMAX driver support for controller & port resources

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #662

Special notes for your reviewer:

Release note:

LIST CONTROLLERS
Screenshot from 2021-07-29 07-49-30

LIST PORTS
Screenshot from 2021-07-29 07-48-53

@joseph-v joseph-v force-pushed the vmax-controller-port branch from 0d394f1 to a276148 Compare July 29, 2021 04:52
@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #663 (4faf004) into master (16ea0bc) will decrease coverage by 0.06%.
The diff coverage is 55.63%.

@@            Coverage Diff             @@
##           master     #663      +/-   ##
==========================================
- Coverage   70.13%   70.07%   -0.07%     
==========================================
  Files         156      156              
  Lines       14434    14536     +102     
  Branches     1741     1764      +23     
==========================================
+ Hits        10124    10186      +62     
- Misses       3756     3778      +22     
- Partials      554      572      +18     
Impacted Files Coverage Δ
delfin/drivers/dell_emc/vmax/rest.py 32.36% <30.55%> (-0.11%) ⬇️
delfin/drivers/dell_emc/vmax/vmax.py 84.31% <66.66%> (+3.92%) ⬆️
delfin/drivers/dell_emc/vmax/client.py 81.36% <80.95%> (+5.44%) ⬆️
delfin/exception.py 98.97% <100.00%> (+0.02%) ⬆️

status = constants.ControllerStatus.OFFLINE

controller = {
'name': 'director_'
Copy link
Member

Choose a reason for hiding this comment

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

I think we dont need to append 'director'.. lets pick director_id as name, if there is no name available

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, Done.

'slot_' +
str(director_info.get('director_slot_number')),
'soft_version': None,
'cpu_info': 'number_of_cores_'
Copy link
Member

Choose a reason for hiding this comment

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

expecting a model here.. having 'number_of_cores_' here does not looks good for me..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to 'Cores-*'

'connection_status': connection_status,
'health_status': constants.PortHealthStatus.NORMAL,
'type': port_type,
'logical_type': None,
Copy link
Member

Choose a reason for hiding this comment

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

Port logical type is required to distuinquish FA, RDF , etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

@joseph-v joseph-v force-pushed the vmax-controller-port branch from cf3e7d2 to 26d5e87 Compare August 2, 2021 10:42
directors = self.rest.get_director_list(self.array_id,
self.uni_version)
switcher = {
'A': constants.PortLogicalType.MANAGEMENT,
Copy link
Member

Choose a reason for hiding this comment

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

Why is the switcher keys (A,B,C,D) . It has to be (FA, RF, SE ) etc right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In VMAX director name, (Eg. FA-1D) last letter is for Slice. Slice A is for Infrastructure Manager system emulation. Slice B is for HYPERMAX OS Data Services, Slice C for Backend emulation, Slice D-H remaining emulation.

Copy link
Member

Choose a reason for hiding this comment

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

That means D-H slice can be anything (Front End (FA), RDF( RF).. So I might see a port number RF-1D also.. I still believe the the first 2 letters should be used.. below are my understanding.. though I dont see any document explain this..
[DF,DA,DX]-> backend
[RF.RA,RE]-> RDF replication
[FA, FE, EA, EF, SE]-> Front End
[IM] - Infrastrucre manager

This doc has some info https://psrathore244.wordpress.com/2020/09/18/vmax-3-emulation/

@joseph-v joseph-v force-pushed the vmax-controller-port branch 4 times, most recently from 3843d8c to 877cb2f Compare August 4, 2021 02:36
director_emulation, constants.PortLogicalType.OTHER)
if logical_type == constants.PortLogicalType.OTHER:
port_prefix = port_key['directorId'][:2]
if port_prefix in ['FA', 'FE', 'EA', 'EF', 'SE']:
Copy link
Member

Choose a reason for hiding this comment

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

I guess it is safe to have one more comparison here to map backend directors [DF,DA,DX]-> backend. becasue D-H directors are universal.

@joseph-v joseph-v force-pushed the vmax-controller-port branch 4 times, most recently from a36d6b7 to 193bb93 Compare August 4, 2021 07:21
NajmudheenCT
NajmudheenCT previously approved these changes Aug 4, 2021
Copy link
Member

@NajmudheenCT NajmudheenCT left a comment

Choose a reason for hiding this comment

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

LGTM

except Exception as err:
msg = "Failed to get controller metrics from VMAX: {}".format(err)
LOG.error(msg)
raise exception.ControllerNotFound(self.array_id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it correct to wrap all the exception except SSLCertificateFailed to ControllerNotFound?
For example, if user modify the password on the device but not modify the access info in delfin, it would throw ControllerNotFound here.
Same as other list API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, updated to raise generated exception.

resource_type = None
if args:
resource_type = args[2]
elif not args and kwargs:
Copy link
Collaborator

Choose a reason for hiding this comment

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

When comes to this elif, it means that the first if in line 397 not match, so I think there is no need to add the condition not args here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

}
port_list = []
for director in directors:
port_keys = self.rest.get_port_list(
Copy link
Collaborator

Choose a reason for hiding this comment

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

get_port_list would raise NotImplementedError when version < 84, I think we need to handle this exception in this function seperately, to raise NotImplementedError or just write a log without exception raised.
Now it will raise a PortNotFound exception.
Same as other API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Modified to output error log

@joseph-v joseph-v force-pushed the vmax-controller-port branch 2 times, most recently from b2c3293 to dc3ec7f Compare August 5, 2021 04:26
@joseph-v joseph-v force-pushed the vmax-controller-port branch from dc3ec7f to 4faf004 Compare August 5, 2021 04:38
Copy link
Collaborator

@ThisIsClark ThisIsClark left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@NajmudheenCT NajmudheenCT left a comment

Choose a reason for hiding this comment

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

LGTM

@NajmudheenCT NajmudheenCT merged commit ee30ed8 into sodafoundation:master Aug 5, 2021
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.

Update DELLEMC VMAX driver for supporting Controller and Port resources
3 participants