]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Adds FC and ISCSI Cinder drivers for Lenovo Storage Arrays
authornikeshm <Nikesh.Mahalaka@dothill.com>
Wed, 3 Jun 2015 03:19:45 +0000 (08:49 +0530)
committernikeshm <Nikesh.Mahalaka@dothill.com>
Tue, 16 Jun 2015 23:58:28 +0000 (05:28 +0530)
These drivers depend upon DotHill Cinder drivers.
Using inheritance, we are able to reuse a lot of
DotHill cinder drivers source code.

Change-Id: Ica8631d6954898dbd90a71cc78625bb2aa3b5632
Co-Authored-By: Gauvain Pocentek<gauvain.pocentek@objectif-libre.com>
Implements: blueprint lenovo-fc-iscsi-cinder-driver

cinder/volume/drivers/lenovo/__init__.py [new file with mode: 0644]
cinder/volume/drivers/lenovo/lenovo_client.py [new file with mode: 0644]
cinder/volume/drivers/lenovo/lenovo_common.py [new file with mode: 0644]
cinder/volume/drivers/lenovo/lenovo_fc.py [new file with mode: 0644]
cinder/volume/drivers/lenovo/lenovo_iscsi.py [new file with mode: 0644]

diff --git a/cinder/volume/drivers/lenovo/__init__.py b/cinder/volume/drivers/lenovo/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/cinder/volume/drivers/lenovo/lenovo_client.py b/cinder/volume/drivers/lenovo/lenovo_client.py
new file mode 100644 (file)
index 0000000..1518f53
--- /dev/null
@@ -0,0 +1,23 @@
+#    Copyright 2014 Objectif Libre
+#    Copyright 2015 DotHill Systems
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+#
+
+from cinder.volume.drivers.dothill import dothill_client
+
+
+class LenovoClient(dothill_client.DotHillClient):
+
+    def __init__(self, host, login, password, protocol):
+        super(LenovoClient, self).__init__(host, login, password, protocol)
diff --git a/cinder/volume/drivers/lenovo/lenovo_common.py b/cinder/volume/drivers/lenovo/lenovo_common.py
new file mode 100644 (file)
index 0000000..9b38783
--- /dev/null
@@ -0,0 +1,57 @@
+#    Copyright 2014 Objectif Libre
+#    Copyright 2015 DotHill Systems
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+#
+
+from oslo_config import cfg
+
+from cinder.volume.drivers.dothill import dothill_common
+from cinder.volume.drivers.lenovo import lenovo_client
+
+common_opt = [
+    cfg.StrOpt('lenovo_backend_name',
+               default='OpenStack',
+               help="VDisk or Pool name to use for volume creation."),
+    cfg.StrOpt('lenovo_backend_type',
+               choices=['linear', 'realstor'],
+               help="linear (for VDisk) or realstor (for Pool)."),
+    cfg.StrOpt('lenovo_wbi_protocol',
+               choices=['http', 'https'],
+               help="Lenovo web interface protocol."),
+]
+
+iscsi_opt = [
+    cfg.ListOpt('lenovo_iscsi_ips',
+                default=[],
+                help="List of comma separated target iSCSI IP addresses."),
+]
+
+CONF = cfg.CONF
+CONF.register_opts(common_opt)
+CONF.register_opts(iscsi_opt)
+
+
+class LenovoCommon(dothill_common.DotHillCommon):
+    VERSION = "1.0"
+
+    def __init__(self, config):
+        self.config = config
+        self.vendor_name = "Lenovo"
+        self.backend_name = self.config.lenovo_backend_name
+        self.backend_type = self.config.lenovo_backend_type
+        self.wbi_protocol = self.config.lenovo_wbi_protocol
+        self.client = lenovo_client.LenovoClient(self.config.san_ip,
+                                                 self.config.san_login,
+                                                 self.config.san_password,
+                                                 self.wbi_protocol)
diff --git a/cinder/volume/drivers/lenovo/lenovo_fc.py b/cinder/volume/drivers/lenovo/lenovo_fc.py
new file mode 100644 (file)
index 0000000..aa33bf4
--- /dev/null
@@ -0,0 +1,36 @@
+#    Copyright 2014 Objectif Libre
+#    Copyright 2015 DotHill Systems
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+#
+
+from cinder.volume.drivers.dothill import dothill_fc
+from cinder.volume.drivers.lenovo import lenovo_common
+
+
+class LenovoFCDriver(dothill_fc.DotHillFCDriver):
+    """OpenStack Fibre Channel cinder drivers for Lenovo Storage arrays.
+
+    Version history:
+        1.0    - Inheriting from DotHill cinder drivers.
+
+    """
+
+    VERSION = "1.0"
+
+    def __init__(self, *args, **kwargs):
+        super(LenovoFCDriver, self).__init__(*args, **kwargs)
+        self.configuration.append_config_values(lenovo_common.common_opt)
+
+    def _init_common(self):
+        return lenovo_common.LenovoCommon(self.configuration)
diff --git a/cinder/volume/drivers/lenovo/lenovo_iscsi.py b/cinder/volume/drivers/lenovo/lenovo_iscsi.py
new file mode 100644 (file)
index 0000000..0fb99a8
--- /dev/null
@@ -0,0 +1,38 @@
+#    Copyright 2014 Objectif Libre
+#    Copyright 2015 DotHill Systems
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+#
+
+from cinder.volume.drivers.dothill import dothill_iscsi
+from cinder.volume.drivers.lenovo import lenovo_common
+
+
+class LenovoISCSIDriver(dothill_iscsi.DotHillISCSIDriver):
+    """OpenStack iSCSI cinder drivers for Lenovo Storage arrays.
+
+    Version history:
+        1.0    - Inheriting from DotHill cinder drivers.
+
+    """
+
+    VERSION = "1.0"
+
+    def __init__(self, *args, **kwargs):
+        super(LenovoISCSIDriver, self).__init__(*args, **kwargs)
+        self.configuration.append_config_values(lenovo_common.common_opt)
+        self.configuration.append_config_values(lenovo_common.iscsi_opt)
+        self.iscsi_ips = self.configuration.lenovo_iscsi_ips
+
+    def _init_common(self):
+        return lenovo_common.LenovoCommon(self.configuration)