Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pure Cinder backend #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ suites:
pillars-from-files:
cinder.sls: tests/pillar/lefthand_single.sls

- name: pure_single
provisioner:
pillars-from-files:
cinder.sls: tests/pillar/pure_single.sls

- name: solidfire_single
provisioner:
pillars-from-files:
Expand Down
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=mitaka SUITE=gpfs-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=mitaka SUITE=hp3par-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=mitaka SUITE=lefthand-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=mitaka SUITE=pure-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=mitaka SUITE=solidfire-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=mitaka SUITE=storwize-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=mitaka SUITE=volume-single
Expand All @@ -37,19 +38,22 @@ env:
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=control-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=gpfs-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=lefthand-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=pure-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=storwize-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=volume-single-barbican
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=ceph-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=control-cluster
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=control-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=hp3par-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=pure-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=solidfire-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=volume-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=vsp-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=ceph-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=control-cluster
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=control-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=hp3par-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=pure-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=solidfire-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=volume-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=ocata SUITE=vsp-single
Expand All @@ -58,6 +62,7 @@ env:
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=pike SUITE=control-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=pike SUITE=gpfs-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=pike SUITE=lefthand-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=pike SUITE=pure-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=pike SUITE=storwize-single
- PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 OS_VERSION=pike SUITE=volume-single-barbican
# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 OS_VERSION=ocata SUITE=ceph-single
Expand Down
15 changes: 15 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,21 @@ Volume vmware related options:

cinder type-key normal-storage set hplh:data_pl=r-10-2 hplh:provisioning=full

* Cinder setup with PureStorage:

.. code-block:: yaml

cinder:
volume:
enabled: true
backend:
pure:
type_name: normal-storage
engine: pure
protocol: ISCSI
san_ip: 10.10.10.10
pure_api_token: 960e185a-255f-4bdb-3b03-3b9eb1e5cf1f

* Cinder setup with Solidfire:

.. code-block:: yaml
Expand Down
20 changes: 20 additions & 0 deletions cinder/files/backend/_pure.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

[{{ backend_name }}]
{%- if (pillar.cinder.get('volume', {}).get('version', '') == 'juno') or (pillar.cinder.get('controller', {}).get('version', '') == 'juno') %}
host={{ backend.get('host', grains.host) }}
{%- else %}
backend_host={{ backend.get('host', grains.host) }}
{%- endif %}
volume_backend_name={{ backend_name }}
san_ip={{ backend.san_ip }}
pure_api_token = {{ backend.pure_api_token' }}
{%- if backend.use_chap_auth is defined %}
use_chap_auth = {{ backend.use_chap_auth }}
{%- endif %}
{%- if backend.pure_eradicate_on_delete is defined %}
pure_eradicate_on_delete = {{ backend.get('pure_eradicate_on_delete', True) }}
{%- endif %}
{%- if backend.use_multipath_for_image_xfer is defined %}
use_multipath_for_image_xfer = {{ backend.get('use_multipath_for_image_xfer', True) }}
{%- endif %}
volume_driver=cinder.volume.drivers.pure.Pure{{ backend.get('protocol', ISCSI) }}Driver
15 changes: 15 additions & 0 deletions cinder/volume.sls
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,21 @@ hp3parclient:

{%- endif %}

{%- if backend.engine == 'pure' %}

pureclient:
pkg.installed:
- names:
- python-pip

purestorage:
pip.installed:
- name: purestorage
- require:
- pkg: pureclient

{%- endif %}

{%- if backend.engine == 'fujitsu' %}

cinder_driver_fujitsu_{{ loop.index }}:
Expand Down
140 changes: 140 additions & 0 deletions tests/pillar/pure_single.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
cinder:
controller:
enabled: true
version: liberty
backend:
pure_backend:
type_name: pure
engine: pure
backend: pure_backend
san_ip: 127.0.0.1
pure_api_token: 960e185a-255f-4bdb-3b03-3b9eb1e5cf1f
protocol: ISCSI
identity:
engine: keystone
host: 127.0.0.1
port: 35357
tenant: service
user: cinder
password: pwd
region: regionOne
osapi:
host: 127.0.0.1
osapi_max_limit: 500
glance:
host: 127.0.0.1
port: 9292
logging:
log_appender: false
log_handlers:
watchedfile:
enabled: true
fluentd:
enabled: false
ossyslog:
enabled: false
default_volume_type: 7k2SaS
message_queue:
engine: rabbitmq
host: 127.0.0.1
port: 5672
user: openstack
password: pwd
virtual_host: '/openstack'
database:
engine: mysql
host: 127.0.0.1
port: 3306
name: cinder
user: cinder
password: pwd
volume:
enabled: true
version: liberty
backend:
pure_backend:
type_name: pure
engine: pure
backend: pure_backend
san_ip: 127.0.0.1
pure_api_token: 960e185a-255f-4bdb-3b03-3b9eb1e5cf1f
protocol: ISCSI
identity:
engine: keystone
host: 127.0.0.1
port: 35357
tenant: service
user: cinder
password: pwd
region: regionOne
osapi:
host: 127.0.0.1
glance:
host: 127.0.0.1
port: 9292
logging:
log_appender: false
log_handlers:
watchedfile:
enabled: true
fluentd:
enabled: false
ossyslog:
enabled: false
default_volume_type: 7k2SaS
message_queue:
engine: rabbitmq
host: 127.0.0.1
port: 5672
user: openstack
password: pwd
virtual_host: '/openstack'
database:
engine: mysql
host: 127.0.0.1
port: 3306
name: cinder
user: cinder
password: pwd
apache:
server:
enabled: true
default_mpm: event
mpm:
prefork:
enabled: true
servers:
start: 5
spare:
min: 2
max: 10
max_requests: 0
max_clients: 20
limit: 20
site:
cinder:
enabled: false
available: true
type: wsgi
name: cinder
wsgi:
daemon_process: cinder-wsgi
processes: 5
threads: 1
user: cinder
group: cinder
display_name: '%{GROUP}'
script_alias: '/ /usr/bin/cinder-wsgi'
application_group: '%{GLOBAL}'
authorization: 'On'
host:
address: 127.0.0.1
name: 127.0.0.1
port: 8776
log:
custom:
format: >-
%v:%p %{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %D %O \"%{Referer}i\" \"%{User-Agent}i\"
error:
enabled: true
format: '%M'