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

Hnas controller PR #1000

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion delfin/drivers/hitachi/hnas/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
}

NODE_INDEX = {
'node_len': 2,
'node_len': 7,
'status_index': 2,
'name_index': 1,
'id_index': 0
Expand Down
30 changes: 15 additions & 15 deletions delfin/drivers/hitachi/hnas/nas_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_disk(self, storage_id):
self.format_data_to_map(disk_info, 'Capacity')
disks_list = []
for disk_map in disk_map_list:
if 'Status' in disk_map:
if 'Status' in disk_map and 'HDSdevname' in disk_map:
size = disk_map['Capacity'].split('GiB')[0] + "GB"
status = constants.DiskStatus.NORMAL \
if disk_map['Status'] == 'OK' \
Expand Down Expand Up @@ -307,20 +307,20 @@ def list_controllers(self, storage_id):
nodes_array = self.get_table_data(node_info)
for nodes in nodes_array:
node = nodes.split()
if len(node) > constant.NODE_INDEX['node_len']:
status = constants.ControllerStatus.NORMAL \
if node[
constant.NODE_INDEX[
'status_index']] == 'ONLINE' \
else constants.ControllerStatus.OFFLINE
controller_model = {
'name': node[constant.NODE_INDEX['name_index']],
'storage_id': storage_id,
'native_controller_id': node[
constant.NODE_INDEX['id_index']],
'status': status
}
controller_list.append(controller_model)
if not nodes or len(node) < constant.NODE_INDEX['node_len']:
break
status = constants.ControllerStatus.NORMAL \
if node[constant.NODE_INDEX[
'status_index']] == 'ONLINE' \
else constants.ControllerStatus.OFFLINE
controller_model = {
'name': node[constant.NODE_INDEX['name_index']],
'storage_id': storage_id,
'native_controller_id': node[
constant.NODE_INDEX['id_index']],
'status': status
}
controller_list.append(controller_model)
return controller_list
except exception.DelfinException as e:
err_msg = "Failed to get controllers from " \
Expand Down
6 changes: 5 additions & 1 deletion delfin/drivers/hitachi/vsp/vsp_stor.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,11 @@ def list_storage_host_groups(self, context):
host_group_list = []
host_grp_relation_list = []
if not host_groups:
return host_group_list
result = {
'storage_host_groups': host_group_list,
'storage_host_grp_host_rels': host_grp_relation_list
}
return result
group_with_port = HitachiVspDriver.handle_group_with_port(
host_groups)
for port in group_with_port:
Expand Down
13 changes: 13 additions & 0 deletions delfin/tests/unit/drivers/hitachi/hnas/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,19 @@
ID Node Name Status FS Access Aggs Netwrk FC EVS IDs\r
-- --------------- -------- ---------- ---------- ------ --- -------\r
1 pba-hnas-1-1 ONLINE OK Degraded OK OK [0,1,2]\r
2 pba-hnas-1-2 ONLINE OK OK OK OK [0,2]\r
\r
Cluster Communications Status:\r
\r
Cluster Interconnect\r
From To=> Node 1 Node 2 \r
Node 1 -- OK \r
Node 2 OK -- \r
\r
Management Network\r
From To=> Node 1 Node 2 \r
Node 1 -- OK \r
Node 2 OK -- \r
pba-hnas-1-1:$ """

FC_PORT_INFO = """\r
Expand Down