Hitachi raidcom wrapper
Project description
Work in progress
hiraid is a Python raidcom wrapper for communicating with Hitachi enterprise storage arrays. raidcom output is parsed to json and also stored beneath storageobject.views.
The primary purpose of this library is to underpin the Hitachi Vantara opensource ansible project: https://github.com/hv-ps/Hitachi.Raidcom.Ansible
Install
pip3 install git+https://github.com/hv-ps/hiraid.git
Quick start
from hiraid.raidcom import Raidcom
storage_serial = 53511
horcm_instance = 0 storage = Raidcom(storage_serial,0)
ports = storage.getport()
print(json.dumps(ports.view,indent=4))
print(json.dumps(ports.stats))
Index your host groups, luns and associated ldevs
storage.getpool(key='basic')
ports = storage.getport().view.keys()
hostgroups = storage.concurrent_gethostgrps(ports=ports)
allhsds = [f"{port}-{gid}" for port in hostgroups.view for gid in hostgroups.view[port]['_GIDS']]
storage.concurrent_getportlogins(ports=ports)
storage.concurrent_gethbawwns(portgids=allhsds)
storage.concurrent_getluns(portgids=allhsds)
ldevlist = set([ self.raidcom.views['_ports'][port]['_GIDS'][gid]['_LUNS'][lun]['LDEV'] for port in self.raidcom.views['_ports'] for gid in self.raidcom.views['_ports'][port].get('_GIDS',{}) for lun in self.raidcom.views['_ports'][port]['_GIDS'][gid].get('LUNS',{}) ])
storage.concurrent_getldevs(ldevlist)
file = f"/var/tmp/{storage.serial}__{datetime.now().strftime('%d-%m-%Y%H.%M.%S')}.json"
with open(file,'w') as w:
w.write(json.dumps(storage.views,indent=4))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file hiraid-1.0.17-py3-none-any.whl
.
File metadata
- Download URL: hiraid-1.0.17-py3-none-any.whl
- Upload date:
- Size: 60.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51d325529949f8f8ac8ed2af758163540db6d2dd552cbefdac484f335b4749bb |
|
MD5 | 411e1527b16ce1be7d92fb9a46a5ab64 |
|
BLAKE2b-256 | ec7fdffd2af54086e7611ff57ea796caae6d5738d13ba8a038558eefd55d3ab9 |