{"id":24183,"library":"oslo-vmware","title":"Oslo VMware","description":"The Oslo VMware library provides common VMware-related utilities and API interaction patterns for OpenStack projects. It wraps the pyVmomi library for vSphere API access, offering simplified authentication, session management, and operations like VM creation, datastore management, and network configuration. Current version 4.9.0 requires Python >=3.10. Release cadence is tied to OpenStack releases, typically one per cycle.","status":"active","version":"4.9.0","language":"python","source_language":"en","source_url":"https://opendev.org/openstack/oslo.vmware","tags":["openstack","vmware","vsphere","oslo","cloud"],"install":[{"cmd":"pip install oslo.vmware","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core vSphere API binding","package":"pyvmomi","optional":false},{"reason":"Thread-safe operations","package":"oslo.concurrency","optional":false},{"reason":"Logging configuration","package":"oslo.log","optional":false},{"reason":"Utility functions","package":"oslo.utils","optional":false}],"imports":[{"note":"Import uses underscore, not dot, after oslo prefix. The Python package is oslo_vmware.","wrong":"from oslo.vmware import VMwareAPISession","symbol":"VMwareAPISession","correct":"from oslo_vmware import VMwareAPISession"},{"note":"Same dot vs underscore confusion.","wrong":"from oslo.vmware import get_http","symbol":"get_http","correct":"from oslo_vmware import get_http"}],"quickstart":{"code":"import os.environ\nfrom oslo_vmware import VMwareAPISession\n\nsession = VMwareAPISession(\n    host=os.environ.get('VSPHERE_HOST', ''),\n    username=os.environ.get('VSPHERE_USER', ''),\n    password=os.environ.get('VSPHERE_PASSWORD', ''),\n    api_retry_count=5,\n    task_poll_interval=1.0\n)\nprint('Connected to vSphere')","lang":"python","description":"Initialize a VMware API session using environment variables for credentials. Replace VSPHERE_HOST, VSPHERE_USER, VSPHERE_PASSWORD with actual values."},"warnings":[{"fix":"Replace 'from oslo.vmware import ...' with 'from oslo_vmware import ...'.","message":"In oslo_vmware 4.x, the import path changed from oslo.vmware to oslo_vmware. Code using the old dotted import will raise ModuleNotFoundError.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade Python to 3.10 or later.","message":"The minimum required Python version is now 3.10. Older Python versions are unsupported.","severity":"breaking","affected_versions":">=4.9.0"},{"fix":"Replace 'insecure=True' with 'ca_file=\"/path/to/ca.crt\"' or set the corresponding environment variable.","message":"Support for the 'insecure' parameter in VMwareAPISession is deprecated. Use the 'ca_file' parameter with a CA bundle instead.","severity":"deprecated","affected_versions":">=4.7.0"},{"fix":"Check that environment variables are defined or provide arguments to VMwareAPISession.","message":"Session creation fails without proper credentials. Ensure VSPHERE_HOST, VSPHERE_USER, and VSPHERE_PASSWORD are set in the environment, or pass them directly.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install 'oslo.vmware' via pip and import using 'oslo_vmware' (e.g., 'from oslo_vmware import VMwareAPISession').","cause":"Package name changed from dotted to underscore notation in version 4.0.0.","error":"ModuleNotFoundError: No module named 'oslo.vmware'"},{"fix":"Run 'pip install oslo.vmware' (with a dot, not a hyphen) to install the package, then import as 'oslo_vmware'.","cause":"Library not installed or installed as 'oslo-vmware' on PyPI but the importable package is 'oslo_vmware'.","error":"ModuleNotFoundError: No module named 'oslo_vmware'"},{"fix":"Double-check credentials host, username, password and ensure the user has the necessary vSphere privileges.","cause":"The VSphere API returned None for a managed object due to invalid credentials or missing permissions.","error":"AttributeError: 'NoneType' object has no attribute 'xxx'"},{"fix":"Verify the VSPHERE_HOST URL (e.g., 'https://vcsa.domain.com/sdk') and ensure network connectivity.","cause":"Network unreachable or vCenter not running at the given host.","error":"ConnectionError: Failed to connect to vCenter"},{"fix":"Replace 'insecure=True' with 'ca_file=None' or provide a proper CA bundle path.","cause":"Using the deprecated 'insecure' parameter removed in newer versions.","error":"ValueError: Invalid argument 'insecure'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}