VMware:Config option for http connection pool size
Adding config option 'vmware_connection_pool_size' to specify the maximum number of connections in the http connection pool. Change-Id: I4bc2ac61d95c9fc8894503dade6b215c394f0733
This commit is contained in:
parent
c9900ad38b
commit
2fce7a3d0c
@ -58,6 +58,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
||||
VMDK_DRIVER = vmdk.VMwareVcVmdkDriver
|
||||
CLUSTERS = ["cls-1", "cls-2"]
|
||||
DEFAULT_VC_VERSION = '5.5'
|
||||
POOL_SIZE = 20
|
||||
|
||||
VOL_ID = 'abcdefab-cdef-abcd-efab-cdefabcdefab'
|
||||
DISPLAY_NAME = 'foo'
|
||||
@ -89,6 +90,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
||||
self._config.vmware_insecure = False
|
||||
self._config.vmware_cluster_name = self.CLUSTERS
|
||||
self._config.vmware_host_version = self.DEFAULT_VC_VERSION
|
||||
self._config.vmware_connection_pool_size = self.POOL_SIZE
|
||||
|
||||
self._db = mock.Mock()
|
||||
self._driver = vmdk.VMwareVcVmdkDriver(configuration=self._config,
|
||||
@ -2687,17 +2689,19 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
||||
|
||||
self._driver.session()
|
||||
|
||||
config = self._driver.configuration
|
||||
apiSession.assert_called_once_with(
|
||||
self._config.vmware_host_ip,
|
||||
self._config.vmware_host_username,
|
||||
self._config.vmware_host_password,
|
||||
self._config.vmware_api_retry_count,
|
||||
self._config.vmware_task_poll_interval,
|
||||
wsdl_loc=self._config.safe_get('vmware_wsdl_location'),
|
||||
config.vmware_host_ip,
|
||||
config.vmware_host_username,
|
||||
config.vmware_host_password,
|
||||
config.vmware_api_retry_count,
|
||||
config.vmware_task_poll_interval,
|
||||
wsdl_loc=config.safe_get('vmware_wsdl_location'),
|
||||
pbm_wsdl_loc=None,
|
||||
port=self._config.vmware_host_port,
|
||||
cacert=self._config.vmware_ca_file,
|
||||
insecure=self._config.vmware_insecure)
|
||||
port=config.vmware_host_port,
|
||||
cacert=config.vmware_ca_file,
|
||||
insecure=config.vmware_insecure,
|
||||
pool_size=config.vmware_connection_pool_size)
|
||||
|
||||
@mock.patch.object(VMDK_DRIVER, 'volumeops')
|
||||
@mock.patch.object(VMDK_DRIVER, '_extend_backing')
|
||||
|
@ -128,6 +128,9 @@ vmdk_opts = [
|
||||
cfg.MultiStrOpt('vmware_cluster_name',
|
||||
help='Name of a vCenter compute cluster where volumes '
|
||||
'should be created.'),
|
||||
cfg.IntOpt('vmware_connection_pool_size',
|
||||
default=10,
|
||||
help='Maximum number of connections in http connection pool.'),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -219,9 +222,10 @@ class VMwareVcVmdkDriver(driver.VolumeDriver):
|
||||
# 1.4.0 - support for volume retype
|
||||
# 1.5.0 - restrict volume placement to specific vCenter clusters
|
||||
# 1.6.0 - support for manage existing
|
||||
VERSION = '1.6.0'
|
||||
# 1.7.0 - new config option 'vmware_connection_pool_size'
|
||||
VERSION = '1.7.0'
|
||||
|
||||
# ThirdaPartySystems wiki page
|
||||
# ThirdPartySystems wiki page
|
||||
CI_WIKI_NAME = "VMware_CI"
|
||||
|
||||
# Minimum supported vCenter version.
|
||||
@ -1814,6 +1818,7 @@ class VMwareVcVmdkDriver(driver.VolumeDriver):
|
||||
pbm_wsdl = self.pbm_wsdl if hasattr(self, 'pbm_wsdl') else None
|
||||
ca_file = self.configuration.vmware_ca_file
|
||||
insecure = self.configuration.vmware_insecure
|
||||
pool_size = self.configuration.vmware_connection_pool_size
|
||||
self._session = api.VMwareAPISession(ip, username,
|
||||
password, api_retry_count,
|
||||
task_poll_interval,
|
||||
@ -1821,7 +1826,8 @@ class VMwareVcVmdkDriver(driver.VolumeDriver):
|
||||
pbm_wsdl_loc=pbm_wsdl,
|
||||
port=port,
|
||||
cacert=ca_file,
|
||||
insecure=insecure)
|
||||
insecure=insecure,
|
||||
pool_size=pool_size)
|
||||
return self._session
|
||||
|
||||
def _get_vc_version(self):
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
upgrade:
|
||||
- Added config option ``vmware_connection_pool_size`` in the
|
||||
VMware VMDK driver to specify the maximum number of connections
|
||||
(to vCenter) in the http connection pool.
|
Loading…
Reference in New Issue
Block a user