Add nexentastore backend support

This patch adds posibility to configure nexenta
config options.

Change-Id: Ib1badc1b87f9ffa30209514a64ddd3551d5dae36
Related-Prod: PROD-18093
diff --git a/.kitchen.yml b/.kitchen.yml
index 7923057..05c9827 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -70,5 +70,15 @@
             common:
               version: <%= ENV['OS_VERSION'] || 'pike' %>
 
+  - name: share_nexenta
+    provisioner:
+      pillars-from-files:
+        manila.sls: tests/pillar/share_nexenta.sls
+      pillars:
+        release.sls:
+          manila:
+            common:
+              version: <%= ENV['OS_VERSION'] || 'pike' %>
+
 # vim: ft=yaml sw=2 ts=2 sts=2 tw=125
 
diff --git a/.travis.yml b/.travis.yml
index 0308d00..b9d198d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,8 +19,10 @@
 env:
   - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=pike SUITE=server_cluster
   - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=pike SUITE=server_single
+  - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2016.3 OS_VERSION=pike SUITE=share_nexenta
   - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=server_cluster
   - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=server_single
+  - PLATFORM=epcim/salt-formulas:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=share_nexenta
 
 before_script:
   - set -o pipefail
diff --git a/README.rst b/README.rst
index 9b9dcbd..0b47c0b 100644
--- a/README.rst
+++ b/README.rst
@@ -43,6 +43,27 @@
           host: 10.20.0.102
 
 
+Backend configuration
+=====================
+
+
+Nexenta backend
+
+.. code-block:: yaml
+
+    manila:
+      share:
+        enabled_share_backends:
+          nexenta:
+            name: nexenta
+            type: nexenta
+            enabled: true
+            dhss: false
+            nexenta_host: 1.2.3.4
+            nexenta_password: secretpassword
+            nexenta_user: nonexistent
+            nexenta_volume: volume1
+
 More information
 ================
 
diff --git a/manila/files/pike/_backend_nexenta.conf b/manila/files/pike/_backend_nexenta.conf
new file mode 100644
index 0000000..02926ac
--- /dev/null
+++ b/manila/files/pike/_backend_nexenta.conf
@@ -0,0 +1,42 @@
+{%- if backend.nexenta_host is defined %}
+nexenta_host = {{ backend.nexenta_host }}
+{%- endif %}
+{%- if backend.nexenta_rest_port is defined %}
+nexenta_rest_port = {{ backend.nexenta_rest_port }}
+{%- endif %}
+{%- if backend.nexenta_retry_count is defined %}
+nexenta_retry_count = {{ backend.nexenta_retry_count }}
+{%- endif %}
+{%- if backend.nexenta_rest_protocol is defined %}
+nexenta_rest_protocol = {{ backend.nexenta_rest_protocol }}
+{%- endif %}
+{%- if backend.nexenta_user is defined %}
+nexenta_user = {{ backend.nexenta_user }}
+{%- endif %}
+{%- if backend.nexenta_password is defined %}
+nexenta_password = {{ backend.nexenta_password }}
+{%- endif %}
+{%- if backend.nexenta_volume is defined %}
+nexenta_volume = {{ backend.nexenta_volume }}
+{%- endif %}
+{%- if backend.nexenta_pool is defined %}
+nexenta_pool = {{ backend.nexenta_pool }}
+{%- endif %}
+{%- if backend.nexenta_nfs is defined %}
+nexenta_nfs = {{ backend.nexenta_nfs }}
+{%- endif %}
+{%- if backend.nexenta_nfs_share is defined %}
+nexenta_nfs_share = {{ backend.nexenta_nfs_share }}
+{%- endif %}
+{%- if backend.nexenta_dataset_compression is defined %}
+nexenta_dataset_compression = {{ backend.nexenta_dataset_compression }}
+{%- endif %}
+{%- if backend.nexenta_dataset_dedupe is defined %}
+nexenta_dataset_dedupe = {{ backend.nexenta_dataset_dedupe }}
+{%- endif %}
+{%- if backend.nexenta_thin_provisioning is defined %}
+nexenta_thin_provisioning = {{ backend.nexenta_thin_provisioning }}
+{%- endif %}
+{%- if backend.nexenta_mount_point_base is defined %}
+nexenta_mount_point_base = {{ backend.nexenta_mount_point_base }}
+{%- endif %}
diff --git a/tests/pillar/share_nexenta.sls b/tests/pillar/share_nexenta.sls
new file mode 100644
index 0000000..7d6dc28
--- /dev/null
+++ b/tests/pillar/share_nexenta.sls
@@ -0,0 +1,76 @@
+manila:
+  common:
+    identity:
+      engine: keystone
+      host: 127.0.0.1
+      port: 35357
+      tenant: service
+      user: manila
+      password: misterio
+      endpoint_type: internalURL
+    database:
+      engine: mysql
+      host: 127.0.0.1
+      port: 3306
+      name: manila
+      user: manila
+      password: misterio
+    message_queue:
+      engine: rabbitmq
+      host: '127.0.0.1'
+      port: 5672
+      user: openstack
+      password: workshop
+      virtual_host: '/openstack'
+  share:
+    version: pike
+    enabled: true
+    enabled_share_backends:
+      nexenta:
+        name: nexenta
+        type: nexenta
+        enabled: true
+        dhss: false
+        nexenta_host: 1.2.3.4
+        nexenta_password: secretpassword
+        nexenta_user: nonexistent
+        nexenta_volume: volume1
+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:
+      manila:
+        enabled: false
+        available: true
+        type: wsgi
+        name: manila
+        host:
+          name: manila.ci.local
+          address: 127.0.0.1
+          port: 8041
+        log:
+          custom:
+            format: >-
+              %v:%p %{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %D %O \"%{Referer}i\" \"%{User-Agent}i\"
+        wsgi:
+          daemon_process: manila-api
+          processes: 2
+          threads: 10
+          user: manila
+          group: manila
+          display_name: '%{GROUP}'
+          script_alias: '/ /usr/bin/manila-api'
+          application_group: '%{GLOBAL}'
+          authorization: 'On'