CERTIFICATE_VERIFY_FAILED for VMware driver
Description of Issue/Question
Unable to create VM using VMware driver because of SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581). But able to connect to vcenter using salt-cloud -f test_vcenter_connection vcenter
Setup
$cat /etc/salt/cloud.providers
vcenter:
driver: vmware
password: <password>
port: 443
protocol: https
url: <vcenter-ip>
user: <vcenter-user>
$cat /etc/salt/cloud.profiles
vm_profile:
provider: vcenter
clonefrom: Win2008R2
num_cpus: 4
memory: 8GB
datastore: Test-cntr0
cluster: Test-Cluster
folder: Test-VMs
domain: test.com
devices:
disk:
Hard disk 1:
size: 5
Hard disk 2:
size: 2
scsi:
SCSI controller 1:
type: lsilogic
SCSI controller 2:
type: lsilogic_sas
bus_sharing: virtual
SCSI controller 3:
type: paravirtual
Steps to Reproduce Issue
Pull latest code from Salt Git hub repo
- Test Vcenter connection:
root@localhost:/# salt-cloud -f test_vcenter_connection vcenter
[INFO ] salt-cloud starting
[INFO ] Starting new HTTPS connection (1): 10.XX.XX.XX
[INFO ] Starting new HTTPS connection (1): 10.XX.XX.XX
vcenter:
----------
vmware:
connection successful
- Create New VM
root@localhost:/# salt-cloud -p vn_profile vM-q123 -l debug
[DEBUG ] Missing configuration file: /etc/salt/cloud
[DEBUG ] Missing configuration file: /etc/salt/master
[DEBUG ] Key 'file_ignore_glob' with value None has an invalid type of NoneType, a list is required for this value
[DEBUG ] Reading configuration from /etc/salt/cloud.providers
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles
[DEBUG ] Missing configuration file: /etc/salt/master
[DEBUG ] Please install 'virt-what' to improve results of the 'virtual' grain.
[DEBUG ] Configuration file path: /etc/salt/master
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO ] salt-cloud starting
[DEBUG ] Could not LazyLoad parallels.avail_sizes
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy
[DEBUG ] Could not LazyLoad saltify.avail_sizes
[DEBUG ] Could not LazyLoad saltify.avail_images
[DEBUG ] Could not LazyLoad saltify.avail_locations
[DEBUG ] LazyLoaded rackspace.reboot
[DEBUG ] LazyLoaded openstack.list_locations
[DEBUG ] LazyLoaded rackspace.list_locations
[DEBUG ] Could not LazyLoad vmware.optimize_providers
[DEBUG ] The 'vmware' cloud driver is unable to be optimized.
[DEBUG ] Could not LazyLoad parallels.avail_sizes
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy
[DEBUG ] Could not LazyLoad saltify.avail_sizes
[DEBUG ] Could not LazyLoad saltify.avail_images
[DEBUG ] Could not LazyLoad saltify.avail_locations
[DEBUG ] LazyLoaded rackspace.reboot
[DEBUG ] LazyLoaded openstack.list_locations
[DEBUG ] LazyLoaded rackspace.list_locations
[INFO ] Starting new HTTPS connection (1): 10.XX.XX.XX
[DEBUG ] "GET //sdk/vimServiceVersions.xml HTTP/1.1" 200 429
[INFO ] Starting new HTTPS connection (1): 10.XX.XX.XX
[DEBUG ] "GET //sdk/vimServiceVersions.xml HTTP/1.1" 200 429
[DEBUG ] Generating minion keys for 'vM-q123'
[DEBUG ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG ] Sending event - data = {'profile': 'vm_profile', 'event': 'starting create', '_stamp': '2016-04-06T07:39:30.729131', 'name': 'vM-q123', 'provider': 'vcenter:vmware'}
[INFO ] Starting new HTTPS connection (1): 10.XX.XX.XX
[DEBUG ] "GET //sdk/vimServiceVersions.xml HTTP/1.1" 200 429
[INFO ] Starting new HTTPS connection (1): 10.XX.XX.XX
[DEBUG ] "GET //sdk/vimServiceVersions.xml HTTP/1.1" 200 429
[ERROR ] There was a profile error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/salt-2016.3.0-py2.7.egg/salt/cloud/cli.py", line 284, in run
self.config.get('names')
File "/usr/local/lib/python2.7/dist-packages/salt-2016.3.0-py2.7.egg/salt/cloud/__init__.py", line 1445, in run_profile
ret[name] = self.create(vm_)
File "/usr/local/lib/python2.7/dist-packages/salt-2016.3.0-py2.7.egg/salt/cloud/__init__.py", line 1280, in create
output = self.clouds[func](vm_)
File "/usr/local/lib/python2.7/dist-packages/salt-2016.3.0-py2.7.egg/salt/cloud/clouds/vmware.py", line 2293, in create
cluster_ref = salt.utils.vmware.get_mor_by_property(_get_si(), vim.ClusterComputeResource, cluster, container_ref=container_ref)
File "/usr/local/lib/python2.7/dist-packages/salt-2016.3.0-py2.7.egg/salt/utils/vmware.py", line 482, in get_mor_by_property
object_list = get_mors_with_properties(service_instance, object_type, property_list=[property_name], container_ref=container_ref)
File "/usr/local/lib/python2.7/dist-packages/salt-2016.3.0-py2.7.egg/salt/utils/vmware.py", line 510, in get_mors_with_properties
content = get_content(service_instance, object_type, property_list=property_list, container_ref=container_ref)
File "/usr/local/lib/python2.7/dist-packages/salt-2016.3.0-py2.7.egg/salt/utils/vmware.py", line 416, in get_content
container_ref = service_instance.content.rootFolder
File "/usr/local/lib/python2.7/dist-packages/pyVmomi/VmomiSupport.py", line 560, in __call__
return self.f(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyVmomi/VmomiSupport.py", line 383, in _InvokeAccessor
return self._stub.InvokeAccessor(self, info)
File "/usr/local/lib/python2.7/dist-packages/pyVmomi/StubAdapterAccessorImpl.py", line 42, in InvokeAccessor
options=self._pcType.RetrieveOptions(maxObjects=1))
File "/usr/local/lib/python2.7/dist-packages/pyVmomi/VmomiSupport.py", line 566, in <lambda>
self.f(*(self.args + (obj,) + args), **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyVmomi/VmomiSupport.py", line 375, in _InvokeMethod
return self._stub.InvokeMethod(self, info, args)
File "/usr/local/lib/python2.7/dist-packages/pyVmomi/SoapAdapter.py", line 1254, in InvokeMethod
conn.request('POST', self.path, req, headers)
File "/usr/lib/python2.7/httplib.py", line 1001, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 812, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1212, in connect
server_hostname=server_hostname)
File "/usr/lib/python2.7/ssl.py", line 350, in wrap_socket
_context=self)
File "/usr/lib/python2.7/ssl.py", line 566, in __init__
self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 788, in do_handshake
self._sslobj.do_handshake()
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
Versions Report
root@localhost:/# salt --versions-report
Salt Version:
Salt: 2016.3.0
Dependency Versions:
Jinja2: 2.8
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
RAET: Not Installed
Tornado: 4.3
ZMQ: 4.0.5
cffi: 1.5.2
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: Not Installed
pycparser: 2.10
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: debian 8.3
machine: x86_64
release: 3.10.0-229.20.1.el7.x86_64
system: Linux
version: debian 8.3
pyvmomi Version
root@localhost:/# pip show pyvmomi requests six
---
Name: pyvmomi
Version: 5.5.0.2014.1.1
Location: /usr/local/lib/python2.7/dist-packages
Requires: requests, six
---
Name: requests
Version: 2.4.3
Location: /usr/lib/python2.7/dist-packages
Requires:
---
Name: six
Version: 1.8.0
Location: /usr/lib/python2.7/dist-packages
Requires:
@anandxoriant, thanks for reporting.
Ping @nmadhok
@anandxoriant There's no information provided here? Version of Salt? Debug log? Exact error you are seeing?
Looks like some Github issues/PRs have had data corruption issues:
https://status.github.com/messages
@nmadhok Due to some github issue information was not visible. Could you please check now?
Getting the same issue, on Debian 8.4.
same issue here, debian 8.4, salt==2015.8.10, pyvmomi==6.0.0.2016.4 (as well as 5.5.0.2014.1.1), verify_ssl: False in provider config
salt-cloud --versions-report
Salt Version:
Salt: 2015.8.10
Dependency Versions:
Apache Libcloud: 0.20.0
Jinja2: 2.7.3
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.4.0
Python: 2.7.9 (default, Mar 1 2015, 12:57:24)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: 0.8.6
cherrypy: Not Installed
dateutil: 2.2
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.2
mysql-python: 1.2.3
pycparser: 2.10
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: 0.8.2
timelib: Not Installed
System Versions:
dist: debian 8.4
machine: x86_64
release: 3.16.0-4-amd64
system: debian 8.4
/etc/salt/cloud.providers.d/vmware.conf
vmware_provider:
verify_ssl: False
driver : vmware
user: '[scrubbed]'
password: '[scrubbed]'
url: '[scrubbed]'
protocol: 'https'
port: '443'
/etc/salt/cloud.profiles.d/general.conf
pgpool_std:
verify_ssl: False
provider: vmware_provider
clonefrom: jessie_vlan12
num_cpus: 2
memory: 4GB
resourcepool: Prod
cluster: Cluster01
datastore: Datastore01
folder: New_VMs
domain: [scrubbed]
template: False
power_on: True
deploy: True
ssh_username: root
password: [scrubbed]
minion:
master: [scrubbed]
startup_states: sls
sls_list:
- cloud.provision
pip show pyvmomi requests six
---
Metadata-Version: 2.0
Name: pyvmomi
Version: 6.0.0.2016.4
Summary: VMware vSphere Python SDK
Home-page: https://github.com/vmware/pyvmomi
Author: VMware, Inc.
Author-email: [email protected]
Installer: pip
License: License :: OSI Approved :: Apache Software License
Location: /usr/local/lib/python2.7/dist-packages
Requires: six, requests
Classifiers:
Development Status :: 5 - Production/Stable
License :: OSI Approved :: Apache Software License
Intended Audience :: Information Technology
Intended Audience :: System Administrators
Intended Audience :: Developers
Environment :: No Input/Output (Daemon)
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.2
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Topic :: Software Development :: Libraries :: Python Modules
Topic :: System :: Distributed Computing
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
---
Metadata-Version: 2.0
Name: requests
Version: 2.10.0
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: [email protected]
Installer: pip
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires:
Classifiers:
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Natural Language :: English
License :: OSI Approved :: Apache Software License
Programming Language :: Python
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
---
Metadata-Version: 2.0
Name: six
Version: 1.10.0
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: [email protected]
Installer: pip
License: MIT
Location: /usr/local/lib/python2.7/dist-packages
Requires:
Classifiers:
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Topic :: Software Development :: Libraries
Topic :: Utilities
ZD-787
This is probably the same error documented in #29537.
This issue was referenced in this pull request: https://github.com/saltstack/salt/pull/33698
Verified that this PR fixes this issue: https://github.com/saltstack/salt/pull/33698
I verified this issue. Now everything working as expected. Thanks