{"id":23794,"library":"glance-store","title":"Glance Store","description":"OpenStack Image Service Store Library, providing a unified interface to store and retrieve virtual machine images in various backends (filesystem, Swift, Ceph/RBD, HTTP, etc.). Current version: 5.4.0. Python 3.10+ required. Released under Apache 2.0, maintained by the OpenStack community.","status":"active","version":"5.4.0","language":"python","source_language":"en","source_url":"https://github.com/openstack/glance_store","tags":["openstack","image-storage","glance","cloud","storage-backend"],"install":[{"cmd":"pip install glance-store","lang":"bash","label":"Install core library"},{"cmd":"pip install glance-store[rados]","lang":"bash","label":"Install with Ceph/RBD support"},{"cmd":"pip install glance-store[swift]","lang":"bash","label":"Install with Swift support"}],"dependencies":[{"reason":"Configuration management required by OpenStack services","package":"oslo.config","optional":false},{"reason":"Utility functions for time parsing, exception handling, etc.","package":"oslo.utils","optional":false},{"reason":"Internationalization support","package":"oslo.i18n","optional":false},{"reason":"Driver manager for backends (Cinder, Swift, etc.)","package":"stevedore","optional":false},{"reason":"Authentication for Swift and HTTP backends","package":"keystoneauth1","optional":true},{"reason":"Required for Swift store driver","package":"python-swiftclient","optional":true},{"reason":"Required for Ceph/RBD store driver","package":"python-cephclient","optional":true}],"imports":[{"note":"In older versions (pre-1.0) the module was glance.store; modern code uses glance_store","wrong":"from glance.store import GlanceStore","symbol":"GlanceStore","correct":"from glance_store import GlanceStore"},{"note":"BackendStore is in the backend module, not drivers.","wrong":"from glance_store.drivers import BackendStore","symbol":"BackendStore","correct":"from glance_store.backend import BackendStore"}],"quickstart":{"code":"import os\nfrom glance_store import GlanceStore\n\n# Configuration: must provide a config file or dict\nconfig_path = os.environ.get('GLANCE_CONFIG', '/etc/glance/glance-store.conf')\nif not os.path.exists(config_path):\n    # Minimal in-memory config for testing (filesystem backend)\n    from oslo_config import cfg\n    cfg.CONF([], project='glance', default_config_files=[])\n    cfg.CONF.set_override('filesystem_store_datadir', '/tmp/images', group='glance_store')\n\nstore = GlanceStore()\nstore.configure()\n\n# Example: get image location (assuming image ID exists)\nimage_id = 'some-image-uuid'\n# locations = store.get_locations(image_id)\nprint('Store initialized, ready to use.')","lang":"python","description":"Initialize GlanceStore with a config file or overrides. Requires oslo.config setup. Adjust paths and config as needed."},"warnings":[{"fix":"Upgrade to Python 3.10+. If stuck on Python 2/3.6, use glance-store 4.x.","message":"Python 2 support removed in Stein release (5.0.0). Requires Python 3.10+ from version 5.4.0.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Migrate to http store driver with swift endpoint configuration.","message":"The 'swift' store driver is deprecated in favor of 'http' store with swift authentication. Removal planned in future release.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Always call store.configure() with a valid configuration object or file path.","message":"Configuration must be explicitly loaded before any store operations. Forgot to call store.configure()? Common cause of 'ConfigNotFound' errors.","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":"Run 'pip install glance-store' in the correct environment (e.g., virtualenv, system Python 3.10+).","cause":"glance-store not installed or installed in wrong Python environment.","error":"ImportError: No module named glance_store"},{"fix":"Provide an alternative config file via GLANCE_CONFIG env var or pass config dict to store.configure().","cause":"GlanceStore requires a configuration file, but default path doesn't exist.","error":"oslo_config.cfg.ConfigFileNotFoundError: Unable to find configuration file: /etc/glance/glance-api.conf"},{"fix":"Verify image ID is correct and the backend (filesystem/Swift/RBD) contains the image. Check store.get_locations() for valid UUIDs.","cause":"Trying to access an image that doesn't exist in the backend (e.g., wrong image ID).","error":"glance_store.exception.NotFound: Image not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}