A plugin to enable storage provisioning/management from Chef knife CLI
Ruby Shell
Latest commit 8413067 Nov 21, 2016 @KCKecheng committed on GitHub Merge pull request #5 from KCKecheng/unity
Unity
Permalink
Failed to load latest commit information.
lib/chef/knife
.gitignore
LICENSE
README.md
knife-storage.gemspec
knife.rb.sample
sanity_test.sh

README.md

knife-storage

DESCRIPTION

A plugin to enable storage provisioning/management from Chef knife CLI

INSTALLATION

gem build knife-storage.gemspec
gem install ./knife-storage-<version>.gem

CONFIGURATION

For some arrays, commands are implemented through their REST API, which involes https communications. This requires the existence of a client key, a client certificaiton and a passphase. They can be generated as below:

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem

After generating required key/certification/passphase, they should be configured in your knife.rb as below:

current_dir = File.dirname(__FILE__)
knife[:array_client_key] = "#{current_dir}/xio_key.pem"
knife[:array_client_cert] = "#{current_dir}/xio_cert.pem"
knife[:array_client_key_pass] = 'Y0urpassword!'

Several other parameters, which can be specified throug either CLI options or knife.rb configuration, are also required to run the plugin.

CLI Options:

--array-host HOST            Storage Array Hostname or IP Address
--array-user USERNAME        The user name for the storage array
--array-pass PASSWORD        The password for the storage array
--array-type TYPE            Storage array type: XtremIO/VMAX/VNX/etc.

knife.rb:

knife[:array_host] = '192.168.1.1'
knife[:array_user] = 'admin'
knife[:array_pass] = 'Credent1al!'
knife[:array_type] = 'XtremIO'

USAGE INSTRUCTION

Below are current available commands:

knife storage initiator group add
knife storage initiator group list
knife storage initiator group remove
knife storage initiator group rename
knife storage initiator group show
knife storage initiator add
knife storage initiator list
knife storage initiator remove
knife storage initiator show
knife storage mapping add
knife storage mapping list
knife storage mapping remove
knife storage mapping show
knife storage target list
knife storage target show
knife storage volume add
knife storage volume list
knife storage volume remove
knife storage volume show

FUTURE

Only XtremIO is supported for now. Support for other arrays, such as Unity, VMAX, will be added later.

TEST

./sanity_test.sh

CONTRIBUTION

Create a fork of the project into your own reposity. Make all your necessary changes and create a pull request with a description on what was added or removed and details explaining the changes in lines of code. If approved, project owners will merge it.

LICENSE

The project is licensed under the MIT License - refer to LICENSE for details.

KNOWN PROBLEM

  1. We currently do not support multi-cluster XtremIO configuration (multiple clusters under the same XMS). This limitation may be fixed in future releases.