Skip to content

Commit

Permalink
Release 0.4.0
Browse files Browse the repository at this point in the history
Add support for basic VNX metrics.
  • Loading branch information
Cedric Zhuang committed Dec 12, 2016
2 parents 9ea68dc + d02b29d commit ad0d611
Show file tree
Hide file tree
Showing 112 changed files with 36,427 additions and 1,157 deletions.
92 changes: 53 additions & 39 deletions README.rst
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,42 @@ 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
- VNXStorageGroup
- read/write/total IOPS
- read/write/total MBPS
- read/write size KB
- VNXStoragePool
- read/write/total IOPS
- read/write/total MBPS
- read/write size KB
- Manage Unity System
- supported resources
- show system properties
Expand All @@ -96,53 +123,40 @@ Feature List
- list/create/delete NFS servers
- list/create/delete NFS shares
- list/create/delete DNS servers
- list ip ports.
- list ip ports
- list/create/delete link aggregations
- list/create/delete Consistency Groups
- list/create/delete metric real time query
- list metrics query result
- list disks
- list/create/delete tenants
- supported feature/operations
- CIFS share access control
- NFS share access control
- Remote hosts access
- 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
5 changes: 1 addition & 4 deletions comptest/__init__.py
Expand Up @@ -17,7 +17,7 @@

import logging

from comptest.utils import setup_log, inter_process_locked
from comptest.utils import inter_process_locked
from storops import VNXSystem, UnitySystem, cache

__author__ = 'Cedric Zhuang'
Expand Down Expand Up @@ -55,6 +55,3 @@ def vnx2():
vnx = VNXSystem('192.168.1.94', 'sysadmin', 'sysadmin')
log.debug('initialize vnx system: {}'.format(vnx))
return vnx


setup_log()
1 change: 0 additions & 1 deletion requirements.txt
@@ -1,6 +1,5 @@
enum34>=1.0.4
future>=0.15.1
lxml!=3.5.0,>=3.4.2
paramiko>=1.13.0
python-dateutil>=2.4.2
PyYAML>=3.11
Expand Down
27 changes: 25 additions & 2 deletions storops/__init__.py
Expand Up @@ -15,9 +15,32 @@
# under the License.
from __future__ import unicode_literals

from storops.vnx.resource.system import VNXSystem # noqa
import sys
import logging

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'


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
"""
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():
logger = logging.getLogger(__name__)
logger.info('disabling logging to console.')
logger.setLevel(logging.NOTSET)
logger.handlers = []
48 changes: 47 additions & 1 deletion storops/exception.py
Expand Up @@ -479,6 +479,26 @@ class UnityEthernetPortSpeedNotSupportError(UnityException):
message = "Specified Speed is not supported."


@rest_exception
class UnityVLANUsedByOtherTenantError(UnityException):
error_code = 118939688


@rest_exception
class UnityTenantUUIDInUse(UnityException):
error_code = 118939686


@rest_exception
class UnityTenantNameInUseError(UnityException):
error_code = 118939685


@rest_exception
class UnityVLANAlreadyHasInterfaceError(UnityException):
error_code = 118939689


class UnityShareTypeNotSupportAccessControlError(UnityException):
message = 'share type does not support access control.'

Expand Down Expand Up @@ -519,6 +539,23 @@ class UnityMetricQueryNotFoundError(UnityMetricException):
error_code = 131153932


class SystemAPINotSupported(StoropsException):
message = "System in version {version} doesn't support this API"


@rest_exception
class UnityHostNotInSameTenantError(StoropsException):
error_code = 151036194


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 +933,10 @@ class VNXUserNotFoundError(VNXSecurityException, VNXObjectNotFoundError):
error_message = 'User does not exist'


class VNXStatsException(VNXException):
pass


class VNXRaidGroupError(VNXException):
pass

Expand All @@ -917,7 +958,12 @@ class VNXCreatePoolError(VNXPoolError):


@cli_exception
class VNXPoolNameInUseError(VNXCreatePoolError):
class VNXNameInUseError(VNXException):
error_message = 'Could not set properties:(Name).'


@cli_exception
class VNXPoolNameInUseError(VNXCreatePoolError, VNXNameInUseError):
error_message = ['0x712d8501', 'Pool name is already used']


Expand Down
18 changes: 17 additions & 1 deletion storops/lib/common.py
Expand Up @@ -26,6 +26,7 @@
from os import path, makedirs, stat

import cachez
import math
import six
from enum import Enum as _Enum
from retryz import retry
Expand Down Expand Up @@ -439,6 +440,12 @@ def get_lock_file(name):
return path.join(lock_folder, name)


def get_data_file(name):
data_folder = get_local_folder()
assure_folder(data_folder)
return path.join(data_folder, name)


def round_it(n_digits=3):
def inner(func):
@six.wraps(func)
Expand Down Expand Up @@ -496,12 +503,21 @@ def start(self, as_daemon=True):
self._timer.start()

def stop(self):
if self._timer.is_alive():
log.info('stop timer for {}.'.format(self.function))
self._timer.cancel()
self.is_running = False
log.info('timer stopped for {}.'.format(self.function))

def is_daemon(self):
return self._timer.isDaemon()

def __del__(self):
self.stop()


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


def all_not_nan(*items):
return all(map(lambda item: not math.isnan(item), items))

0 comments on commit ad0d611

Please sign in to comment.