Repository navigation
Closed
Labels
P1Priority 1RIoTRelates to integration with cloud providers, hypervisors, API-based services, etc.bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
pyVmomi 6.0 is now available in PyPi. The check that we're doing in salt.utils.vmware.get_service_instance to handle SSL errors works very well for pyVmomi version 5.5.x, but pyVmomi 6.0 does not enter the if block where we're handling SSL errors.
We need to amend this function so that SSL errors are handled both for pyVmomi 5.5.x and pyVmomi 6.0.
The error I get on 6.0 is:
[INFO ] Starting new HTTPS connection (1): <redacted>
[WARNING ] /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:100: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
[DEBUG ] [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
[INFO ] Starting new HTTPS connection (1): <redacted>
[WARNING ] /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:100: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
[DEBUG ] [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
[WARNING ] Stopping the Salt Proxy Minion
[ERROR ] Cannot complete login due to an incorrect user name or password.
[INFO ] The proxy minion is shut down
Versions report:
# salt --versions
Salt Version:
Salt: 2015.8.3-29-g55589f8
Dependency Versions:
Jinja2: 2.7.2
M2Crypto: Not Installed
Mako: 0.9.1
PyYAML: 3.10
PyZMQ: 14.4.0
Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.4
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.5
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.3.0
mysql-python: 1.2.3
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: 0.8.2
timelib: Not Installed
System Versions:
dist: Ubuntu 14.04 trusty
machine: x86_64
release: 3.13.0-66-generic
system: Ubuntu 14.04 trusty
Metadata
Metadata
Assignees
Labels
P1Priority 1RIoTRelates to integration with cloud providers, hypervisors, API-based services, etc.bugbroken, incorrect, or confusing behaviorfixed-pls-verifyfix is linked, bug author to confirm fixseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
rallytime commentedon Dec 9, 2015
@nmadhok You might be interested in this one. I can take a look in a couple of days, but thought you'd like to be aware of it. I don't think pyVmomi 6.0 was out until only recently.
nmadhok commentedon Dec 10, 2015
@rallytime I'll take a look at it.
skandyla commentedon Jan 8, 2016
Hi,
also have this issue.
salt-cloud -f list_nodes my-vmware -l debugVersions report:
Temporary solution:
nmadhok commentedon Jan 8, 2016
@skandyla I'm working on fixing this. pyVmomi 5.5 is old. Please uninstall it and reinstall pyVmomi 5.5.0-2014.1.1.
nmadhok commentedon Jan 8, 2016
@skandyla Would it be possible for you to install pyvmomi 6.0.0 and test it with the PR referenced above? I have tested it to work but just want to make sure it works for others.
nmadhok commentedon Jan 8, 2016
@rallytime After merging #30231, you won't see the SSL issue. The SSL issue will only appear when pyVmomi >= 6.0.0 is installed on systems using Python < 2.7. I will submit another PR to mention this in the docs that pyVmomi >= 6.0.0 is only supported on systems using Python >= 2.7 and for systems using Python < 2.7, they should use pyVmomi 5.5.0-2014.1.1 by doing
pip install pyvmomi==5.5.0-2014.1.1skandyla commentedon Jan 8, 2016
@nmadhok I've tested your PR - seems all working good (under Centos7).
I've setuped virtualenv, and installed pyvmomi (6.0.0)
also
Thanks!
nmadhok commentedon Jan 8, 2016
@skandyla Not a problem. Glad it's working for you now. Should be merged into develop and 2015.8 branch very soon.
rallytime commentedon Jan 8, 2016
@nmadhok Awesome! Thanks for submitting that, and thanks @skandyla for testing. I'll test that out today.
rallytime commentedon Jan 8, 2016
@nmadhok Hrm...After applying these changes to the 2015.8 and upgrading my version of pyVmomi to 6.0, the proxy minion stops with these errors:
I am running this on an Ubuntu 14 machine.
10 remaining items
nmadhok commentedon Jan 11, 2016
@skandyla it is going to work but a lot of features won't work as expected because of the difference in features between versions.
nmadhok commentedon Jan 12, 2016
@rallytime @cro @skandyla
From https://urllib3.readthedocs.org/en/latest/security.html#pyopenssl and https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning
On Ubuntu, you may run into trouble installing
pyopenssl, you'll need these dependencies:Please install/upgrade required dependencies if they're already installed and try this PR again.
Can you also post the output of
pip show pyopensslandpip show pyasn1cro commentedon Jan 12, 2016
Well, Salt already deps on PyOpenSSL, so we're OK there. I'll give this a
try.
On Mon, Jan 11, 2016 at 5:23 PM, Nitin Madhok [email protected]
wrote:
--cro
C. R. Oldham, Platform Engineer, SaltStack
[email protected] / 801-564-4673
cro commentedon Jan 12, 2016
Sorry, this didn't work. :-(
I checked out your PR and made sure the right items were installed with pip.
where get_si.py just contains two lines:
nmadhok commentedon Jan 12, 2016
@cro Looking at the error you got, I don't see you got any SSL related errors. You're getting a different error I think. You can also use https://docs.saltstack.com/en/latest/ref/clouds/all/salt.cloud.clouds.vmware.html#salt.cloud.clouds.vmware.test_vcenter_connection to test connection to vcenter using salt-cloud in debug mode:
jbfriedrich commentedon Apr 17, 2016
Not sure if my problem is related or not, but I still have issues connecting to a vSphere vCSA 6.0u2 with a self-signed certificate. As far as I understand from this thread, my python version should work fine. I even added the self-signed CA to the the operating system's keystore.
Do I have to add the CA somewhere else as well? Maybe in a keystore of a python library? Or to the keystore of salt itself?
Python version
Salt version report
Pip versions
nmadhok commentedon Apr 17, 2016
@jbfriedrich Can you install previous version of pyVmomi and see if you get the same error? I'll have to test this on Debian 8.4. I will be working on rewriting the SSL certification check code sometime soon.
jbfriedrich commentedon Apr 17, 2016
@nmadhok I will test with pyvmomi 5.x but my vsphere environment is 6.x so I am not sure if it will work. I have edited the '/salt/utils/vmware.py' file and it works now for me. Would it be worth it for me to create a pull request so you can take a look at my changes? Might not be the prettiest solution but seems to work for me ;)
nmadhok commentedon Apr 18, 2016
@jbfriedrich I'll take a look at your commit when I get a chance. You can create a Pull request for it but it'll be reviewed before it gets merged in. I don't have time at the moment to work on this since I'm too swamped at work.
jbfriedrich commentedon Apr 18, 2016
@nmadhok Sure thing, take your time. Of course it needs to be reviewed first :). I will prepare the pull request tonight after work (I am not doing this all too often). Thanks!
jbfriedrich commentedon Apr 21, 2016
@nmadhok Sorry for my late reply, had some busy days at work. I have tested with pyVmomi 5.5.0-2014.1.1 and my unmodified salt installation worked fine with that version. When switched back to PyVmomi 6.0.0 the SSL error from above came up again.
I then applied my fix (see pull request) to my local salt installation and the connectivity test succeeded. I could use pyVmomi 6.0.0 just fine with my vSphere 6.0U2 cluster. I also tested pyVmomi 5.5.0-2014.1.1 with my modified salt version, which also seems to work correctly.
Fix issue where pyVmomi 6.0.0 raises SSL errors on Debian 8.3 (#32760)
nishantdh commentedon Oct 3, 2017
Hi guys, I am very new to Python world. My goal is to collect VMs info (like CPU, RAM usage) from ESXi and was using this link as reference https://virtualwires.wordpress.com/2016/07/25/using-pyvmomi-to-collect-esxi-info
I have both python 2.7 and 3.5 running on Ubuntu box:
When I run the script using Python 2.7, it gives "SSL: CERTIFICATE_VERIFY_FAILED" error like below:
When I run using Python3 I get syntax error:
The script is the same as shown in the article -
https://virtualwires.wordpress.com/2016/07/25/using-pyvmomi-to-collect-esxi-info
How do I make it work?