From: Kurt Martin Date: Mon, 5 Aug 2013 21:23:52 +0000 (-0700) Subject: Set the concurrent connections on the 3PAR array X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=21b7fbdc657966b8e7085a00afafa39052dfc203;p=openstack-build%2Fcinder-build.git Set the concurrent connections on the 3PAR array 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 --- diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/test_hp3par.py index 7b562a7c6..38ce3de63 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/test_hp3par.py @@ -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, diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index 6f20a6589..8f04efa91 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -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)