]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "Adding support for iSER transport protocol"
authorJenkins <jenkins@review.openstack.org>
Mon, 5 Aug 2013 21:40:53 +0000 (21:40 +0000)
committerGerrit Code Review <review@openstack.org>
Mon, 5 Aug 2013 21:40:53 +0000 (21:40 +0000)
1  2 
cinder/exception.py
cinder/tests/fake_flags.py
cinder/tests/test_volume.py
cinder/volume/driver.py
cinder/volume/drivers/lvm.py
etc/cinder/cinder.conf.sample

Simple merge
Simple merge
index e2cfa0e4eede926880a124626a65dcf2524b192a,71dab10bc85e8689089354197a9f1349b04f471a..512e17b1f6f59c2732b4e7336a60c45e1e5bf137
@@@ -30,8 -28,8 +30,9 @@@ import tempfil
  import mox
  from oslo.config import cfg
  
 +from cinder.brick.initiator import connector as brick_conn
  from cinder.brick.iscsi import iscsi
+ from cinder.brick.iser import iser
  from cinder import context
  from cinder import db
  from cinder import exception
@@@ -1800,22 -1301,37 +1801,50 @@@ class ISCSITestCase(DriverTestCase)
          self.assertEquals(stats['total_capacity_gb'], float('5.52'))
          self.assertEquals(stats['free_capacity_gb'], float('0.52'))
  
 +    def test_validate_connector(self):
 +        iscsi_driver = driver.ISCSIDriver()
 +        # Validate a valid connector
 +        connector = {'ip': '10.0.0.2',
 +                     'host': 'fakehost',
 +                     'initiator': 'iqn.2012-07.org.fake:01'}
 +        iscsi_driver.validate_connector(connector)
 +
 +        # Validate a connector without the initiator
 +        connector = {'ip': '10.0.0.2', 'host': 'fakehost'}
 +        self.assertRaises(exception.VolumeBackendAPIException,
 +                          iscsi_driver.validate_connector, connector)
 +
  
+ class ISERTestCase(ISCSITestCase):
+     """Test Case for ISERDriver."""
+     driver_name = "cinder.volume.drivers.lvm.LVMISERDriver"
+     def test_do_iscsi_discovery(self):
+         configuration = mox.MockObject(conf.Configuration)
+         configuration.iser_ip_address = '0.0.0.0'
+         configuration.append_config_values(mox.IgnoreArg())
+         iser_driver = driver.ISERDriver(configuration=configuration)
+         iser_driver._execute = lambda *a, **kw: \
+             ("%s dummy" % CONF.iser_ip_address, '')
+         volume = {"name": "dummy",
+                   "host": "0.0.0.0"}
+         iser_driver._do_iser_discovery(volume)
+     def test_get_iscsi_properties(self):
+         volume = {"provider_location": '',
+                   "id": "0",
+                   "provider_auth": "a b c"}
+         iser_driver = driver.ISERDriver()
+         iser_driver._do_iser_discovery = lambda v: "0.0.0.0:0000,0 iqn:iqn 0"
+         result = iser_driver._get_iser_properties(volume)
+         self.assertEquals(result["target_portal"], "0.0.0.0:0000")
+         self.assertEquals(result["target_iqn"], "iqn:iqn")
+         self.assertEquals(result["target_lun"], 0)
  class FibreChannelTestCase(DriverTestCase):
-     """Test Case for FibreChannelDriver"""
+     """Test Case for FibreChannelDriver."""
      driver_name = "cinder.volume.driver.FibreChannelDriver"
  
      def test_initialize_connection(self):
index 7b0e9c4e0644dc4c70ebd70a4f553e6f46b2b044,cfd13403f06f0e1b8d9177ad42e13231bf343c68..086725f89e02cea9d209139956883feba244d990
@@@ -59,13 -56,25 +60,29 @@@ volume_opts = 
      cfg.IntOpt('iscsi_port',
                 default=3260,
                 help='The port that the iSCSI daemon is listening on'),
+     cfg.IntOpt('num_iser_scan_tries',
+                default=3,
+                help='The maximum number of times to rescan iSER target'
+                     'to find volume'),
+     cfg.IntOpt('iser_num_targets',
+                default=100,
+                help='The maximum number of iser target ids per host'),
+     cfg.StrOpt('iser_target_prefix',
+                default='iqn.2010-10.org.iser.openstack:',
+                help='prefix for iser volumes'),
+     cfg.StrOpt('iser_ip_address',
+                default='$my_ip',
+                help='The IP address that the iSER daemon is listening on'),
+     cfg.IntOpt('iser_port',
+                default=3260,
+                help='The port that the iSER daemon is listening on'),
      cfg.StrOpt('volume_backend_name',
                 default=None,
 -               help='The backend name for a given driver implementation'), ]
 +               help='The backend name for a given driver implementation'),
 +    cfg.BoolOpt('use_multipath_for_image_xfer',
 +                default=False,
 +                help='Do we attach/detach volumes in cinder using multipath '
 +                     'for volume to image and image to volume transfers?'), ]
  
  CONF = cfg.CONF
  CONF.register_opts(volume_opts)
Simple merge
index c605266efdd7e1ebfc2b6de0c18d98b12e9edb9c,7de087149b9dbe782d9d2e9f3c1fa91f66f1020e..d91d7506b6c594dfce152f06556c213f9b64c834
  #
  
  # Driver to use for volume creation (string value)
- #volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver
+ #volume_driver=cinder.volume.drivers.lvm.LVMISCSIDriver,cinder.volume.drivers.lvm.LVMISERDriver
  
 -# Total option count: 300
 +#
 +# Options defined in cinder.volume.drivers.gpfs
 +#
 +
 +# Path to the directory on GPFS mount point where
 +# volumes are stored (string value)
 +# gpfs_mount_point_base=$state_path/mnt
 +
 +# Path to GPFS Glance repository as mounted on
 +# Nova nodes (string value)
 +# gpfs_images_dir=None
 +
 +# Set this if Glance image repo is on GPFS as well
 +# so that the image bits can be transferred efficiently
 +# between Glance and Cinder.  Valid values are copy or
 +# copy_on_write. copy performs a full copy of the image,
 +# copy_on_write efficiently shares unmodified blocks of
 +# the image. (string value)
 +# gpfs_images_share_mode=None
 +
 +# A lengthy chain of copy-on-write snapshots or clones
 +# could have impact on performance.  This option limits
 +# the number of indirections required to reach a specific
 +# block. 0 indicates unlimited. (integer value)
 +# gpfs_max_clone_depth=0
 +
 +# Create volumes as sparse files which take no space.
 +# If set to False volume is created as regular file.
 +# In this case volume creation may take a significantly
 +# longer time. (boolean value)
 +# gpfs_sparse_volumes=True
 +
 +# Total option count: 305