[PATCH] Travis-CI: Use container for test.
by Gris Ge
* Since all required packages have been added to whitelist[1], we are ready to
use container(sudo: false) way for test.
[1]: https://github.com/travis-ci/apt-package-whitelist
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
.travis.yml | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 8fe5bf3..f267aed 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,17 +1,24 @@
-sudo: true
-# python-pywbem and libconfig-dev is not in whitelist yet which stop us using
-# "sudo : false" new container way:
-# https://github.com/travis-ci/travis-ci/issues/4332
-# https://github.com/travis-ci/travis-ci/issues/4329
-
+sudo: false
language: c
-install:
- - sudo apt-get update -qq
- - sudo apt-get install -qq gcc tar make g++ libtool autoconf automake
- libyajl-dev python-pywbem libxml2-dev check
- libglib2.0-dev python-m2crypto libssl-dev libconfig-dev
-
+addons:
+ apt:
+ packages:
+ - gcc
+ - tar
+ - make
+ - g++
+ - libtool
+ - autoconf
+ - automake
+ - libyajl-dev
+ - python-pywbem
+ - libxml2-dev
+ - check
+ - libglib2.0-dev
+ - python-m2crypto
+ - libssl-dev
+ - libconfig-dev
compiler: gcc
--
1.8.3.1
8 years, 9 months
About volume_child_dependency() and volume_child_dependency_rm()
by Gris Ge
Hi Guys,
To draft document about volume replication, I would like to start a
thread discussing design of volume_child_dependency() and
volume_child_dependency_rm().
Background about replication types:
* COPY
Full bitwise copy of the data (occupies full space).
* CLONE
Point in time read writeable space efficient copy of data.
* MIRROR_ASYNC
I/O will be blocked until I/O reached source storage systems.
The source storage system will use copy the changes data to
target system in a predefined interval. There will be a small
data differences between source and target.
* MIRROR_SYNC
I/O will be blocked until I/O reached both source and target
storage systems. There will be no data difference between
source and target storage systems.
Current implementation(not listed is considered as NO_SUPPORT):
* volume_replication()
* ONTAP: CLONE (NetApp FlexClone, no split required)
* Nstor: NO_SUPPORT
* SMIS: COPY and CLONE
* volume_child_dependency()
* ONTAP: Always return False.[1]
* Nstor: Depending on get_child_prop API. I am still seeking
the document. Anyone?
* SMI-S: Not implemented. The NO_SUPPORT error will be raised.
Generally, current implementation is almost NULL.
Definition maybe:
* The 'volume_child_dependency' means whether certain volume
could be deleted without impacting (data access, integrity,
redundancy) other volume.
COPY(ing) COPY(done) CLONE MIRROR
-------------------------------------------------------------
source volume True False True[2] True
target volume True False False True
* The 'volume_child_dependency_rm' means split the replicate
relationship:
* COPY:
Waiting ongoing copy tile finish.
* CLONE:
* Call against source volume:
Convert all target volume to normal volume.
* Call against target volume:
Convert this volume to normal volume.
* MIRROR_ASYNC / _SYNC:
* Call against source/productive volume:
Convert all target/DR volume to normal volume.
* Call against target/DR volume:
Convert this DR volume to normal volume.
Any suggestions?
Thank you in advance.
Best regards.
[1] Fix required: some volume might have snapshot based clone where
split is required:
https://library.netapp.com/ecmdocs/ECMP1368845/html/GUID-CC1CE192-6C31-49...
[2] For special clone like NetApp FlexClone, if not split is required,
False would be OK.
--
Gris Ge
8 years, 9 months
[PATCH 0/2] Enable travis-ci test.
by Gris Ge
* Patch 1/2 is to allow 'make distcheck' to run without libmicrohttpd.
The travis-ci.org is using Ubuntu 12.04 which is shipping old libmicrohttpd.
Gris Ge (2):
Automake: Fix incorrect use of DISTCHECK_CONFIGURE_FLAGS.
Enabled travis-ci.org support.
.travis.yml | 19 +++++++++++++++++++
Makefile.am | 5 +++--
2 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 .travis.yml
--
2.1.4
8 years, 9 months
[PATCH] HP SmartArray plugin: Improve hpssacli output parsing algorithm.
by Gris Ge
* The output of hpssacli contains incorrect indented section which
cause 'duplicate line' PLUGIN_BUG error. To fix it, we only
parse required section.
* Add more comments to explain the workflow of parsing hpssacli output.
* Tested on SmartArray with and without disk enclosure.
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
plugin/hpsa/hpsa.py | 48 +++++++++++++++++++++++++++++++++---------------
1 file changed, 33 insertions(+), 15 deletions(-)
diff --git a/plugin/hpsa/hpsa.py b/plugin/hpsa/hpsa.py
index 42e0bbb..6b273c9 100644
--- a/plugin/hpsa/hpsa.py
+++ b/plugin/hpsa/hpsa.py
@@ -74,38 +74,38 @@ def _sys_status_of(hp_ctrl_status):
def _parse_hpssacli_output(output):
"""
Got a output string of hpssacli to dictionary(nested).
- Skipped these line:
- 1. Starts with 'Note:'
- This is just a message right after controller. We don't neet it
- yet.
- 2. The 'Physical Drives' line.
- It should indented after 'Internal Drive Cage' like.
- If not ignored, we might got duplication line error.
- After ignored, it's phsycial disks will directly stored as
- key of 'Internal Drive Cage' dictionary.
+ Workflow:
+ 0. Check out top and the second indention level space count.
+ 1. Check current line and next line to determine whether current line is
+ a start of new setction.
+ 2. Skip all unrequired sections and their data and sub-sections.
+ 3. If current line is the start of new section, create and empty dict
+ where following subsection or data could be stored.
"""
+ required_sections = ['Array:', 'unassigned']
+
output_lines = [
l for l in output.split("\n")
- if l and not l.startswith('Note:') and
- not l.strip() == 'Physical Drives']
+ if l and not l.startswith('Note:')]
data = {}
# Detemine indention level
- top_indention_level = sorted(
+ (top_indention_level, second_indention_level) = sorted(
set(
len(line) - len(line.lstrip())
- for line in output_lines))[0]
+ for line in output_lines))[0:2]
indent_2_data = {
top_indention_level: data
}
+ flag_required_section = False
+
for line_num in range(len(output_lines)):
cur_line = output_lines[line_num]
- if cur_line.strip() == 'None attached':
- continue
if line_num + 1 == len(output_lines):
+ # The current line is the last line.
nxt_line = ''
else:
nxt_line = output_lines[line_num + 1]
@@ -113,10 +113,27 @@ def _parse_hpssacli_output(output):
cur_indent_count = len(cur_line) - len(cur_line.lstrip())
nxt_indent_count = len(nxt_line) - len(nxt_line.lstrip())
+ if cur_indent_count == top_indention_level:
+ flag_required_section = True
+
+ if cur_indent_count == second_indention_level:
+ flag_required_section = False
+
+ if nxt_indent_count == cur_indent_count:
+ flag_required_section = True
+ else:
+ for required_section in required_sections:
+ if cur_line.lstrip().startswith(required_section):
+ flag_required_section = True
+
+ if flag_required_section is False:
+ continue
+
cur_line_splitted = cur_line.split(": ")
cur_data_pointer = indent_2_data[cur_indent_count]
if nxt_indent_count > cur_indent_count:
+ # Current line is new section title
nxt_line_splitted = nxt_line.split(": ")
new_data = {}
@@ -134,6 +151,7 @@ def _parse_hpssacli_output(output):
else:
cur_data_pointer[cur_line_splitted[0].lstrip()] = \
": ".join(cur_line_splitted[1:]).strip()
+
return data
--
1.8.3.1
8 years, 9 months
[PATCH] MegaRAID plugin: Fix pools() when no pool found.
by Gris Ge
* When disks are configured as JBOD or no volume found,
there will be no 'TOPOLOGY' entry in storcli output.
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
plugin/megaraid/megaraid.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 1aadd4f..d7e6d41 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -473,6 +473,8 @@ def pools(self, search_key=None, search_value=None,
dg_show_output = self._storcli_exec(
["/c%d/dall" % ctrl_num, "show", "all"])
free_space_list = dg_show_output.get('FREE SPACE DETAILS', [])
+ if 'TOPOLOGY' not in dg_show_output:
+ continue
for dg_top in dg_show_output['TOPOLOGY']:
if dg_top['Arr'] != '-':
continue
--
1.8.3.1
8 years, 10 months
[PATCH] MegaRAID Plugin: Fix volume_raid_create() when have multiple cards.
by Gris Ge
Issue:
volume_raid_create() will incorrectly raise ErrorNumber.INVALID_ARGUMENT
about disk not from the same controller when trying to create
volume on second controller.
Root cause:
Old code skip the controller number check when controller ID is 0.
On second controller, the check will look like 1 != '1', that
means raise error anyway.
Fix:
Convert string to int before checking controller ID.
Don't skip controller ID check on 0.
Special thanks to Bruno Goncalves who found this bug.
Signed-off-byr Gris Ge <fge(a)redhat.com>
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
plugin/megaraid/megaraid.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index d921c8e..1aadd4f 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -700,19 +700,23 @@ def volume_raid_create(self, name, raid_type, disks, strip_size,
(cur_ctrl_num, cur_enclosure_num, slot_num) = \
disk.plugin_data.split(':')
- if ctrl_num and cur_ctrl_num != ctrl_num:
+ cur_ctrl_num = int(cur_ctrl_num)
+ cur_enclosure_num = int(cur_enclosure_num)
+
+ if ctrl_num is not None and cur_ctrl_num != ctrl_num:
raise LsmError(
ErrorNumber.INVALID_ARGUMENT,
"Illegal input disks argument: disks are not from the "
"same controller/system.")
- if enclosure_num and cur_enclosure_num != enclosure_num:
+ if enclosure_num is not None and \
+ cur_enclosure_num != enclosure_num:
raise LsmError(
ErrorNumber.INVALID_ARGUMENT,
"Illegal input disks argument: disks are not from the "
"same disk enclosure.")
- ctrl_num = int(cur_ctrl_num)
+ ctrl_num = cur_ctrl_num
enclosure_num = cur_enclosure_num
slot_nums.append(slot_num)
@@ -722,7 +726,7 @@ def volume_raid_create(self, name, raid_type, disks, strip_size,
cmds = [
"/c%s" % ctrl_num, "add", "vd", mega_raid_type,
'size=all', "name=%s" % name,
- "drives=%s:%s" % (enclosure_num, ','.join(slot_nums))]
+ "drives=%d:%s" % (enclosure_num, ','.join(slot_nums))]
if raid_type == Volume.RAID_TYPE_RAID10 or \
raid_type == Volume.RAID_TYPE_RAID50 or \
--
1.8.3.1
8 years, 10 months