[Kimchi-devel] [PATCH v2 0/5] Support creating iSCSI storage pool

Zhou Zheng Sheng zhshzhou at linux.vnet.ibm.com
Sun Dec 22 10:55:40 UTC 2013


Hi,

This patch series is about creating iSCSI storage pool. I firstly
refactored a little bit to make the storage pool creation API nicer,
then add unit test for pool XML generation. The front-end is also
changed to suit the new back-end API. Then I implement iSCSI pool XML
generation and also add a test to actually create a iSCSI pool and
delete it.

v1 -> v2
  I take Royce's advice and arrange pool source information under a
  "source" key. A pool definition is now like the following.
    {'type': 'netfs', 'name': 'XXX,
     'source': {'host': 'X.X.X.X', 'path': '/export/path'}}
  or
    {'type': 'logical', 'name': 'XXX,
     'source': {'devices': ['/dev/sdX', '/dev/sdY']}}

  Sheldon thinks the pool XML generation code should be put into a
  separated file. I also see Bing Bu's email on refactoring.
  Ming says we can make the hard coded path constants configurable.
  I think in future we may also add code for validating the pool
  source, for example, try to mount an NFS export or login iSCSI
  target. All these worth an overall refactor so they are not the
  scope of this patch series. I think we can do this after the iSCSI
  support is ready.

  As Pradeep suggested, I add test to create and delete iSCSI storage
  pool in test_model.py. It requires an existing iSCSI target on
  localhost. You can use targetcli to create one, or it just skips the
  test if it detects no target to use.

Thanks for all your review! I want to hear your comments on the new
API schema, so I can make it stable and save time for front-end work.

Zhou Zheng Sheng (5):
  storagepool: dispatch _get_pool_xml() to respective
    _get_XXX_storagepool_xml() function
  storagepool: rename and consolidate arguments of creating (back end)
  storagepool: rename and consolidate arguments of creating (front end)
  storagepool: Support Creating iSCSI storagepool in model.py
  test_model: test creating iSCSI storage pool

 Makefile.am                              |   2 +
 docs/API.md                              |  24 +++--
 src/kimchi/Makefile.am                   |   1 +
 src/kimchi/iscsi.py                      |  57 +++++++++++
 src/kimchi/model.py                      | 160 +++++++++++++++++++++----------
 tests/Makefile.am                        |   1 +
 tests/test_model.py                      |  91 ++++++++++--------
 tests/test_storagepool.py                | 111 +++++++++++++++++++++
 ui/js/src/kimchi.storagepool_add_main.js |  13 ++-
 9 files changed, 361 insertions(+), 99 deletions(-)
 create mode 100644 src/kimchi/iscsi.py
 create mode 100644 tests/test_storagepool.py

-- 
1.7.11.7




More information about the Kimchi-devel mailing list