VMware: Enable VMware inspector to support any port

If vCenter is configured to use any port other than 443,
the inspector fails to connect to vCenter.
This patch adds a configurable parameter host_port in
ceilometer config under vmware section.

DocImpact
Change-Id: I9035b32ffbc58bb1801b02abdce4bc83a3427308
Closes-Bug: #1387050
This commit is contained in:
Kishore Juigil 2014-10-30 17:45:46 +05:30
parent f856d3c915
commit c5e9d74b7a
3 changed files with 7 additions and 2 deletions

View File

@ -31,6 +31,9 @@ OPTS = [
cfg.StrOpt('host_ip',
default='',
help='IP address of the VMware Vsphere host.'),
cfg.IntOpt('host_port',
default=443,
help='Port of the VMware Vsphere host.'),
cfg.StrOpt('host_username',
default='',
help='Username of VMware Vsphere.'),
@ -72,7 +75,8 @@ def get_api_session():
cfg.CONF.vmware.host_password,
cfg.CONF.vmware.api_retry_count,
cfg.CONF.vmware.task_poll_interval,
wsdl_loc=cfg.CONF.vmware.wsdl_location)
wsdl_loc=cfg.CONF.vmware.wsdl_location,
port=cfg.CONF.vmware.host_port)
return api_session

View File

@ -29,7 +29,7 @@ class TestVsphereInspection(base.BaseTestCase):
def setUp(self):
api_session = api.VMwareAPISession("test_server", "test_user",
"test_password", 0, None,
create_session=False)
create_session=False, port=7443)
vsphere_inspector.get_api_session = mock.Mock(
return_value=api_session)
self._inspector = vsphere_inspector.VsphereInspector()

View File

@ -144,6 +144,7 @@ Parameter Default Note
host_ip "" (Str) IP address of the VMware Vsphere host.
host_password "" (Str) Password of VMware Vsphere.
host_username "" (Str) Username of VMware Vsphere.
host_port 443 (Int) Listening Port of VMware Vsphere host.
api_retry_count 10 (Int) Number of times a VMware Vsphere API must be retried.
task_poll_interval 0.5 (Float) Sleep time in seconds for polling an ongoing async task.
wsdl_location None (Str) Optional vim Service WSDL location