Disabling SSL Verification in pyVmomi with Python

Working with self-signed vCenter certificates in an enterprise environment (such as RHEL 6 running mixed Python 2.6/2.7 and pyvmomi 5.5+) often leads to this error: File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 447, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [Errno 1] _ssl.c:492: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed If you need a quick workaround to bypass certificate verification in development scripts: import ssl import requests from pyVim.connect import SmartConnect context = None try: # Disable SSL certificate verification via standard library context = ssl.SSLContext(ssl.PROTOCOL_SSLv3) context.verify_mode = ssl.CERT_NONE except AttributeError: # Fallback monkey-patch for older Python/requests environments rget = requests.get requests.get = lambda obj, *args, **kwargs: rget(obj, verify=False) requests.packages.urllib3.disable_warnings() # Connect to ESXi / vCenter si = SmartConnect( host=args.host, user=user, pwd=args.password, port=int(args.port), sslContext=context ) This bypasses certificate validation issues so you can get back to writing your automation scripts. ...

March 31, 2016 · 1 min

Linux Hosts That Use the evdev Driver for Keyboards Do Not Map Keys Correctly in Any Guest in VMware

Some of the newer Linux distributions use Xorg 1.4, where the new evdev driver manages all input devices, including keyboards. The evdev driver causes the keyboard to send different keycodes. For example, the down arrow sends keycode 116, which other drivers interpret as Win+R. Consequently, keyboard mapping problems occur in all guest operating systems running in VMware. Solution: VMware Knowledge Base Article 1007439

November 21, 2008 · 1 min