Skip to content

Commit

Permalink
Merge branch 'master' into svc_host
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjiangyu-ghca authored May 6, 2022
2 parents c378e7c + e53d3a1 commit 5a55352
Show file tree
Hide file tree
Showing 29 changed files with 2,039 additions and 41 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ This is one of the SODA Core Projects and is maintained by SODA Foundation direc

## Quick Start - To Use/Experience

[https://docs.sodafoundation.io](https://docs.sodafoundation.io/)
[https://docs.sodafoundation.io/guides/user-guides/delfin](https://docs.sodafoundation.io/guides/user-guides/delfin/)

## Quick Start - To Develop

[https://docs.sodafoundation.io](https://docs.sodafoundation.io/)
[https://docs.sodafoundation.io/guides/developer-guides/delfin](https://docs.sodafoundation.io/guides/developer-guides/delfin/)

## Latest Releases

Expand Down
9 changes: 9 additions & 0 deletions delfin/api/schemas/storage_capabilities_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,15 @@
'maxLength': 255}
},
},
'ioSize': {
'type': 'object',
'properties': {
'unit': {'type': 'string', 'enum': ["KB"]},
'description': {'type': 'string',
'minLength': 1,
'maxLength': 255}
},
},
'readIoSize': {
'type': 'object',
'properties': {
Expand Down
7 changes: 5 additions & 2 deletions delfin/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ class PortLogicalType(object):
class DiskStatus(object):
NORMAL = 'normal'
ABNORMAL = 'abnormal'
DEGRADED = 'degraded'
OFFLINE = 'offline'

ALL = (NORMAL, ABNORMAL, OFFLINE)
ALL = (NORMAL, ABNORMAL, DEGRADED, OFFLINE)


class DiskPhysicalType(object):
Expand Down Expand Up @@ -262,10 +263,12 @@ class HostOSTypes(object):
WINDOWS_SERVER_2012 = 'Windows Server 2012'
ORACLE_VM = 'Oracle VM'
OPEN_VMS = 'Open VMS'
MAC_OS = 'Mac OS'
UNKNOWN = 'Unknown'

ALL = (LINUX, WINDOWS, SOLARIS, HP_UX, AIX, XEN_SERVER, VMWARE_ESX,
LINUX_VIS, WINDOWS_SERVER_2012, ORACLE_VM, OPEN_VMS, UNKNOWN)
LINUX_VIS, WINDOWS_SERVER_2012, ORACLE_VM, OPEN_VMS, MAC_OS,
UNKNOWN)


class InitiatorStatus(object):
Expand Down
204 changes: 204 additions & 0 deletions delfin/drivers/dell_emc/vmax/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,210 @@ def list_disks(self, storage_id):
LOG.error("Failed to get disk details from VMAX")
raise

def list_storage_host_initiators(self, storage_id):
try:
# Get list of initiators
initiators = self.rest.get_initiator_list(self.array_id,
self.uni_version)

initiator_list = []
for initiator in initiators:
initiator_info = self.rest.get_initiator(
self.array_id, self.uni_version, initiator)
type_string = initiator_info.get('type', '').upper()
initiator_type = constants.InitiatorType.UNKNOWN
if 'FIBRE' in type_string:
initiator_type = constants.InitiatorType.FC
if 'ISCSI' in type_string:
initiator_type = constants.InitiatorType.ISCSI

initiator_status = constants.InitiatorStatus.ONLINE
if not initiator_info.get('on_fabric', False):
initiator_status = constants.InitiatorStatus.OFFLINE

initiator_item = {
'name': initiator,
'storage_id': storage_id,
'native_storage_host_initiator_id': initiator,
'alias': initiator_info.get('alias'),
'wwn': initiator_info.get('initiatorId'),
'type': initiator_type,
'status': initiator_status,
'native_storage_host_id': initiator_info.get('host'),
}
initiator_list.append(initiator_item)
return initiator_list

except Exception:
LOG.error("Failed to get host initiator details from VMAX")
raise

def list_storage_hosts(self, storage_id):
try:
# Get list of storage hosts
hosts = self.rest.get_host_list(self.array_id,
self.uni_version)
host_list = []
for host in hosts:
host_info = self.rest.get_host(
self.array_id, self.uni_version, host)

host_item = {
'storage_id': storage_id,
'native_storage_host_id': host_info.get('hostId'),
'name': host_info.get('hostId'),
'os_type': constants.HostOSTypes.UNKNOWN,
'status': constants.HostStatus.NORMAL,
}
host_list.append(host_item)
return host_list

except Exception:
LOG.error("Failed to get storage host details from VMAX")
raise

def list_storage_host_groups(self, storage_id):
try:
# Get list of storage host groups
host_groups = self.rest.get_host_group_list(self.array_id,
self.uni_version)
host_group_list = []
storage_host_grp_relation_list = []
for host_group in host_groups:
host_group_info = self.rest.get_host_group(
self.array_id, self.uni_version, host_group)
host_group_item = {
'name': host_group,
'storage_id': storage_id,
'native_storage_host_group_id': host_group,
}
host_group_list.append(host_group_item)

for storage_host in host_group_info['host']:
storage_host_group_relation = {
'storage_id': storage_id,
'native_storage_host_group_id': host_group,
'native_storage_host_id': storage_host.get('hostId')
}
storage_host_grp_relation_list \
.append(storage_host_group_relation)

result = {
'storage_host_groups': host_group_list,
'storage_host_grp_host_rels': storage_host_grp_relation_list
}

return result

except Exception:
LOG.error("Failed to get storage host group details from VMAX")
raise

def list_port_groups(self, storage_id):
try:
# Get list of port groups
port_groups = self.rest.get_port_group_list(self.array_id,
self.uni_version)
port_group_list = []
port_group_relation_list = []
for port_group in port_groups:
port_group_info = self.rest.get_port_group(
self.array_id, self.uni_version, port_group)
port_group_item = {
'name': port_group,
'storage_id': storage_id,
'native_port_group_id': port_group,
}
port_group_list.append(port_group_item)

for port in port_group_info['symmetrixPortKey']:
port_name = port['directorId'] + ':' + port['portId']
port_group_relation = {
'storage_id': storage_id,
'native_port_group_id': port_group,
'native_port_id': port_name
}
port_group_relation_list.append(port_group_relation)
result = {
'port_groups': port_group_list,
'port_grp_port_rels': port_group_relation_list
}
return result

except Exception:
LOG.error("Failed to get port group details from VMAX")
raise

def list_volume_groups(self, storage_id):
try:
# Get list of volume groups
volume_groups = self.rest.get_volume_group_list(self.array_id,
self.uni_version)
volume_group_list = []
volume_group_relation_list = []
for volume_group in volume_groups:
# volume_group_info = self.rest.get_volume_group(
# self.array_id, self.uni_version, volume_group)

volume_group_item = {
'name': volume_group,
'storage_id': storage_id,
'native_volume_group_id': volume_group,
}
volume_group_list.append(volume_group_item)

# List all volumes except data volumes
volumes = self.rest.get_volume_list(
self.array_id, version=self.uni_version,
params={'data_volume': 'false',
'storageGroupId': volume_group})
if not volumes:
continue
for volume in volumes:
volume_group_relation = {
'storage_id': storage_id,
'native_volume_group_id': volume_group,
'native_volume_id': volume
}
volume_group_relation_list.append(volume_group_relation)

result = {
'volume_groups': volume_group_list,
'vol_grp_vol_rels': volume_group_relation_list
}
return result

except Exception:
LOG.error("Failed to get volume group details from VMAX")
raise

def list_masking_views(self, storage_id):
try:
# Get list of masking_views
masking_views = self.rest.get_masking_view_list(self.array_id,
self.uni_version)
masking_view_list = []
for masking_view in masking_views:
mv_info = self.rest.get_masking_view(
self.array_id, self.uni_version, masking_view)

masking_view_item = {
'name': masking_view,
'storage_id': storage_id,
'native_masking_view_id': mv_info['maskingViewId'],
'native_storage_host_id': mv_info.get('hostId'),
'native_storage_host_group_id': mv_info.get(
'hostGroupId'),
'native_volume_group_id': mv_info.get('storageGroupId'),
'native_port_group_id': mv_info.get('portGroupId'),
}
masking_view_list.append(masking_view_item)
return masking_view_list

except Exception:
LOG.error("Failed to get masking views details from VMAX")
raise

def list_alerts(self, query_para):
"""Get all alerts from an array."""
return self.rest.get_alerts(query_para, version=self.uni_version,
Expand Down
Loading

0 comments on commit 5a55352

Please sign in to comment.