"Fossies" - the Fresh Open Source Software Archive

Member "cinder-14.0.2/cinder/volume/drivers/nec/volume.py" (4 Oct 2019, 4567 Bytes) of package /linux/misc/openstack/cinder-14.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "volume.py" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 14.0.2_vs_15.0.0.

    1 #
    2 # Copyright (c) 2016 NEC Corporation.
    3 # All Rights Reserved.
    4 #
    5 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    6 #    not use this file except in compliance with the License. You may obtain
    7 #    a copy of the License at
    8 #
    9 #         http://www.apache.org/licenses/LICENSE-2.0
   10 #
   11 #    Unless required by applicable law or agreed to in writing, software
   12 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   13 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   14 #    License for the specific language governing permissions and limitations
   15 #    under the License.
   16 
   17 """Drivers for M-Series Storage."""
   18 
   19 from cinder import interface
   20 from cinder.volume import driver
   21 from cinder.volume.drivers.nec import volume_common
   22 from cinder.volume.drivers.nec import volume_helper
   23 from cinder.zonemanager import utils as fczm_utils
   24 
   25 
   26 @interface.volumedriver
   27 class MStorageISCSIDriver(volume_helper.MStorageDSVDriver,
   28                           driver.ISCSIDriver):
   29     """M-Series Storage Snapshot iSCSI Driver."""
   30 
   31     VERSION = '1.10.3'
   32     WIKI_NAME = 'NEC_Cinder_CI'
   33 
   34     def __init__(self, *args, **kwargs):
   35         super(MStorageISCSIDriver, self).__init__(*args, **kwargs)
   36         self._set_config(self.configuration, self.host,
   37                          self.__class__.__name__)
   38 
   39     @staticmethod
   40     def get_driver_options():
   41         return volume_common.mstorage_opts
   42 
   43     def create_export(self, context, volume, connector):
   44         return self.iscsi_do_export(context, volume, connector)
   45 
   46     def ensure_export(self, context, volume):
   47         pass
   48 
   49     def get_volume_stats(self, refresh=False):
   50         return self.iscsi_get_volume_stats(refresh)
   51 
   52     def initialize_connection(self, volume, connector):
   53         return self.iscsi_initialize_connection(volume, connector)
   54 
   55     def terminate_connection(self, volume, connector, **kwargs):
   56         return self.iscsi_terminate_connection(volume, connector)
   57 
   58     def create_export_snapshot(self, context, snapshot, connector):
   59         return self.iscsi_do_export_snapshot(context, snapshot, connector)
   60 
   61     def initialize_connection_snapshot(self, snapshot, connector, **kwargs):
   62         return self.iscsi_initialize_connection_snapshot(snapshot,
   63                                                          connector,
   64                                                          **kwargs)
   65 
   66     def terminate_connection_snapshot(self, snapshot, connector, **kwargs):
   67         return self.iscsi_terminate_connection_snapshot(snapshot,
   68                                                         connector,
   69                                                         **kwargs)
   70 
   71 
   72 @interface.volumedriver
   73 class MStorageFCDriver(volume_helper.MStorageDSVDriver,
   74                        driver.FibreChannelDriver):
   75     """M-Series Storage Snapshot FC Driver."""
   76 
   77     VERSION = '1.10.3'
   78     WIKI_NAME = 'NEC_Cinder_CI'
   79 
   80     def __init__(self, *args, **kwargs):
   81         super(MStorageFCDriver, self).__init__(*args, **kwargs)
   82         self._set_config(self.configuration, self.host,
   83                          self.__class__.__name__)
   84 
   85     @staticmethod
   86     def get_driver_options():
   87         return volume_common.mstorage_opts
   88 
   89     def create_export(self, context, volume, connector):
   90         return self.fc_do_export(context, volume, connector)
   91 
   92     def ensure_export(self, context, volume):
   93         pass
   94 
   95     def get_volume_stats(self, refresh=False):
   96         return self.fc_get_volume_stats(refresh)
   97 
   98     def initialize_connection(self, volume, connector):
   99         conn_info = self.fc_initialize_connection(volume, connector)
  100         fczm_utils.add_fc_zone(conn_info)
  101         return conn_info
  102 
  103     def terminate_connection(self, volume, connector, **kwargs):
  104         conn_info = self.fc_terminate_connection(volume, connector)
  105         fczm_utils.remove_fc_zone(conn_info)
  106         return conn_info
  107 
  108     def create_export_snapshot(self, context, snapshot, connector):
  109         return self.fc_do_export_snapshot(context, snapshot, connector)
  110 
  111     def initialize_connection_snapshot(self, snapshot, connector, **kwargs):
  112         return self.fc_initialize_connection_snapshot(snapshot,
  113                                                       connector,
  114                                                       **kwargs)
  115 
  116     def terminate_connection_snapshot(self, snapshot, connector, **kwargs):
  117         return self.fc_terminate_connection_snapshot(snapshot,
  118                                                      connector,
  119                                                      **kwargs)