]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Set the concurrent connections on the 3PAR array
authorKurt Martin <kurt.f.martin@hp.com>
Mon, 5 Aug 2013 21:23:52 +0000 (14:23 -0700)
committerKurt Martin <kurt.f.martin@hp.com>
Tue, 6 Aug 2013 14:59:04 +0000 (07:59 -0700)
Currently, the 3PAR backend has a limit to the number of concurrent
connections that can be made to the WS API Server. This patch is
setting this limit to 15 connections, the highest possible.

Change-Id: Ibb8618c2fc896e0164a5f6a151d6a870cd662527

cinder/tests/test_hp3par.py
cinder/volume/drivers/san/hp/hp_3par_common.py

index 7b562a7c6e0c4f6481b20a02d8d96966e09e54ba..38ce3de63a1fecfe1e125e4bcdad60a7f36279a1 100644 (file)
@@ -376,6 +376,8 @@ class HP3PARBaseDriver():
     def setup_fakes(self):
         self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_create_client",
                        self.fake_create_client)
+        self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_set_connections",
+                       self.fake_set_connections)
         self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_get_3par_host",
                        self.fake_get_3par_host)
         self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_delete_3par_host",
@@ -396,6 +398,9 @@ class HP3PARBaseDriver():
     def fake_create_client(self):
         return FakeHP3ParClient(self.driver.configuration.hp3par_api_url)
 
+    def fake_set_connections(self):
+        return
+
     def fake_get_cpg(self, volume):
         return HP3PAR_CPG
 
@@ -606,6 +611,8 @@ class TestHP3PARFCDriver(HP3PARBaseDriver, test.TestCase):
 
         self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_create_client",
                        self.fake_create_client)
+        self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_set_connections",
+                       self.fake_set_connections)
         self.driver.do_setup(None)
 
     def fake_create_3par_fibrechan_host(self, hostname, wwn,
@@ -803,6 +810,8 @@ class TestHP3PARISCSIDriver(HP3PARBaseDriver, test.TestCase):
             self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "get_ports",
                            self.fake_get_ports)
 
+        self.stubs.Set(hpdriver.hpcommon.HP3PARCommon, "_set_connections",
+                       self.fake_set_connections)
         self.driver.do_setup(None)
 
     def fake_create_3par_iscsi_host(self, hostname, iscsi_iqn,
index 6f20a65895109f870644ec4d5d88bcc50568ab73..8f04efa911f1819cc8db8f413b68ad349112daa2 100644 (file)
@@ -170,6 +170,7 @@ class HP3PARCommon(object):
         try:
             # make sure the default CPG exists
             self.validate_cpg(self.config.hp3par_cpg)
+            self._set_connections()
         finally:
             self.client_logout()
 
@@ -181,6 +182,14 @@ class HP3PARCommon(object):
             LOG.error(err)
             raise exception.InvalidInput(reason=err)
 
+    def _set_connections(self):
+        """Set the number of concurrent connections.
+
+        The 3PAR WS API server has a limit of concurrent connections.
+        This is setting the number to the highest allowed, 15 connections.
+        """
+        self._cli_run("setwsapi -sru high", None)
+
     def get_domain(self, cpg_name):
         try:
             cpg = self.client.getCPG(cpg_name)