Skip to content

Commit

Permalink
[GH-67] Implement the VNX metrics collection fwk
Browse files Browse the repository at this point in the history
Implement the VNX metrics/statistics collection/calculation framework
based on the work done on Unity.  Details below:
* Refactoring some of the common classes to common module.
* Add enable/disable statistics on VNXSystem
* Add enable/disable persist statistics on VNXSystem
* Setup calculator for VNX.
* Add metrics properties support for VNX's resource list.
* Add metrics dump support for VNX resources.
* Bump the version to 0.4.0.

Add following metrics:
* VNXStorageProcessor
  * read_iops
  * write_iops
  * total_iops
  * read_mbps
  * write_mbps
  * total_mbps
  * read_size_kb
  * write_size_kb
* VNXLun
  * read_iops
    * read_iops_sp_a
    * read_iops_sp_b
  * write_iops
    * write_iops_sp_a
    * write_iops_sp_b
  * total_iops
  * read_mbps
    * read_mbps_sp_a
    * read_mbps_sp_b
  * write_mbps
    * write_mbps_sp_a
    * write_mbps_sp_b
  * total_mbps
  * implicit_trespasses_ps
    * implicit_trespasses_ps_sp_a
    * implicit_trespasses_ps_sp_b
  * explicit_trespasses_ps
    * explicit_trespasses_ps_sp_a
    * explicit_trespasses_ps_sp_b
  * utilization
    * utilization_sp_a
    * utilization_sp_b
  * read_size_kb
  * write_size_kb
* VNXDisk
  * read_iops
  * write_iops
  * total_iops
  * read_mbps
  * write_mbps
  * total_mbps
  * utilization
  * read_size_kb
  * write_size_kb
* VNXSPPort
  * read_iops
  * write_iops
  * total_iops
  * read_mbps
  * write_mbps
  * total_mbps
  * read_size_kb
  * write_size_kb
  • Loading branch information
Cedric Zhuang committed Dec 7, 2016
1 parent a1741d5 commit a78d932
Show file tree
Hide file tree
Showing 56 changed files with 33,389 additions and 564 deletions.
81 changes: 43 additions & 38 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ StorOps: The Python Library for VNX & Unity
.. image:: https://landscape.io/github/emc-openstack/storops/master/landscape.svg?style=flat
:target: https://landscape.io/github/emc-openstack/storops/

VERSION: 0.3.0
VERSION: 0.4.0

A minimalist Python library to manage VNX/Unity systems.
This document lies in the source code and go with the release.
Expand All @@ -37,14 +37,6 @@ Make sure naviseccli is installed if you want to manage VNX.

*PIP Install Failed?*

If you have trouble install the `lxml` dependency. Please try to set
environment variable `STATICBUILD` to `true` on your platform.

If you are on windows, you could also download and install the wheel version
of `lxml` `here
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python>`_.


Feature List
------------

Expand Down Expand Up @@ -80,7 +72,34 @@ Feature List
- initiator and connection management
- create/delete mirror view
- create/delete DNS

- supported metrics
- VNXStorageProcessor
- read/write/total IOPS
- read/write/total MBPS
- read/write size KB
- VNXLun
- read/write/total IOPS
- read/write IOPS of SPA
- read/write IOPS of SPB
- read/write/total MBPS
- read/write MBPS of SPA
- read/write MBPS of SPB
- implicit/explicit trespasses per second
- implicit/explicit trespasses per second of SPA
- implicit/explicit trespasses per second of SPB
- utilization
- utilization of SPA
- utilization of SPB
- read/write size KB
- VNXDisk
- read/write/total IOPS
- read/write/total MBPS
- utilization
- read/write size KB
- VNXSPPort
- read/write/total IOPS
- read/write/total MBPS
- read/write size KB
- Manage Unity System
- supported resources
- show system properties
Expand Down Expand Up @@ -109,40 +128,26 @@ Feature List
- Persist historical metric data to csv files
- supported metrics
- disk
- read IOPS
- write IOPS
- read bandwidth
- write bandwidth
- read/write IOPS
- read/write bandwidth
- utilization
- lun
- read IOPS
- write IOPS
- read bandwidth
- write bandwidth
- read/write IOPS
- read/write bandwidth
- utilization
- filesystem
- read IOPS
- write IOPS
- read bandwidth
- write bandwidth
- read/write IOPS
- read/write bandwidth
- storage processor
- net in bandwidth
- net out bandwidth
- block read IOPS
- block write IOPS
- block read bandwidth
- block write bandwidth
- CIFS read IOPS
- CIFS write IOPS
- CIFS read bandwidth
- CIFS write bandwidth
- NFS read IOPS
- NFS write IOPS
- NFS read bandwidth
- NFS write bandwidth
- net in/out bandwidth
- block read/write IOPS
- block read/write bandwidth
- CIFS read/write IOPS
- CIFS read/write bandwidth
- NFS read/write IOPS
- NFS read/write bandwidth
- utilization
- block cache read hit ratio
- block cache write hit ratio
- block cache read/write hit ratio

Tutorial
--------
Expand Down
21 changes: 12 additions & 9 deletions storops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import sys
import logging

from storops.vnx.resource.system import VNXSystem # noqa
from storops.unity.enums import * # noqa
from storops.unity.resource.system import UnitySystem # noqa
from storops.vnx.enums import * # noqa
from storops.unity.enums import * # noqa
from storops.vnx.resource.system import VNXSystem # noqa

__author__ = 'Cedric Zhuang'

Expand All @@ -30,14 +30,17 @@ def enable_log(level=logging.DEBUG):
"""Enable console logging.
This is a utils method for try run with storops.
:param level: log level, default to DEBUG
"""
log = logging.getLogger(__name__)
log.setLevel(level)
if not log.handlers:
log.addHandler(logging.StreamHandler(sys.stdout))
logger = logging.getLogger(__name__)
logger.setLevel(level)
if not logger.handlers:
logger.info('enabling logging to console.')
logger.addHandler(logging.StreamHandler(sys.stdout))


def disable_log():
log = logging.getLogger(__name__)
log.setLevel(logging.NOTSET)
log.handlers = []
logger = logging.getLogger(__name__)
logger.info('disabling logging to console.')
logger.setLevel(logging.NOTSET)
logger.handlers = []
12 changes: 12 additions & 0 deletions storops/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ class UnityMetricQueryNotFoundError(UnityMetricException):
error_code = 131153932


class VNXStatsError(VNXException):
pass


class VNXPerMonNotEnabledError(VNXStatsError):
pass


class NaviseccliNotAvailableError(VNXException):
message = ("naviseccli not found. please make sure it's installed"
" and available in path.")
Expand Down Expand Up @@ -896,6 +904,10 @@ class VNXUserNotFoundError(VNXSecurityException, VNXObjectNotFoundError):
error_message = 'User does not exist'


class VNXStatsException(VNXException):
pass


class VNXRaidGroupError(VNXException):
pass

Expand Down
4 changes: 4 additions & 0 deletions storops/lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,7 @@ def is_daemon(self):

def __del__(self):
self.stop()


def all_not_none(*items):
return all(map(lambda item: item is not None, items))
Loading

0 comments on commit a78d932

Please sign in to comment.