How openstacksdk Version Selection Impacts OpenStack API Compatibility

The specific openstacksdk version you deploy determines which OpenStack API micro-versions and service features are available, with mismatches causing either missing functionality or runtime AttributeError and HTTP 404 failures.

The call518/mcp-openstack-ops repository demonstrates how Python-based OpenStack automation tools must carefully manage their SDK dependencies to ensure reliable operations across different cloud generations. Because OpenStack evolves through named releases like Wallaby, Xena, and Zed—each introducing new REST endpoints and deprecating legacy ones—the openstacksdk version you select directly dictates which API capabilities your code can leverage safely.

Version Mapping: SDK Releases to OpenStack Clouds

OpenStack releases follow a six-month cadence, and the Python SDK mirrors these changes through semantic versioning. The mcp-openstack-ops project targets specific SDK ranges to align with upstream API stability.

  • SDK >=3.1.0, <4.0.0 corresponds to OpenStack releases up to Wallaby (2022). These versions support legacy APIs but lack newer services such as Placement v2 or Octavia load-balancer listeners.
  • SDK >=4.1.0, <=4.9.0 covers Xena through Zed (2023–2025). This range provides full support for modern micro-versions and features like Quality-of-Service (QoS) policies and network-level APIs.
  • SDK >=5.0.0 (future) targets 2026+ OpenStack releases and introduces breaking changes that remove support for older micro-versions.

In pyproject.toml at line 10, the dependency is declared as openstacksdk>=4.1.0,<=4.10.0, while the uv.lock file at lines 754-826 pins the exact tested artifact to openstacksdk-4.9.0.

Compatibility Risks of Version Mismatches

Deploying an incorrect SDK version against your target cloud creates four distinct failure modes.

Feature Availability Gaps

Newer SDK releases expose additional service methods unavailable in older clouds. For example, calling conn.network.create_qos_policy() requires SDK 4.x and a cloud supporting the QoS extension. If the target cloud runs Wallaby with SDK 3.x, the method simply does not exist, raising AttributeError before the request reaches the API.

Micro-version Negotiation Failures

OpenStack services use microversion headers to expose incremental features. The SDK automatically negotiates the highest supported version during connection initialization. When you use SDK 4.x against a pre-Xena cloud, the client may request micro-versions the service does not implement, resulting in HTTP 400 Bad Request responses for valid-looking code.

Breaking API Signatures

Major SDK releases introduce breaking changes that alter Python interfaces. In SDK 4.x, list_servers() returns a generator instead of a list, and several authentication flows changed defaults. Code written against SDK 3.x requires refactoring to run under 4.x, as documented in the README.md at line 55 which shows the 3.1.1 pinning for legacy environments.

Testing and CI Drift

The repository's CI pipeline validates against the locked 4.9.0 version. Upgrading the SDK without updating integration tests that exercise src/mcp_openstack_ops/services/* wrappers leads to false confidence, as unit tests may pass while live API calls fail against production clouds.

How mcp-openstack-ops Manages SDK Constraints

The project centralizes OpenStack connectivity logic in src/mcp_openstack_ops/connection.py, which relies on openstacksdk to authenticate and route requests. Service-specific wrappers in src/mcp_openstack_ops/services/* call SDK methods assuming the 4.x API surface.

To prevent runtime surprises, the project uses dual-layer dependency control:

  1. Version Range Declarationpyproject.toml enforces >=4.1.0,<=4.10.0, preventing accidental installation of 5.x breaking changes or 3.x legacy code.
  2. Exact Version Lockinguv.lock records the cryptographically verified openstacksdk-4.9.0 wheel, ensuring reproducible deployments across development and production environments.

This strategy guarantees that the codebase runs against the OpenStack API surface that existed up to the Zed release.

Practical Code Examples

The following examples illustrate behavioral differences between SDK generations when managing OpenStack resources.

Modern SDK 4.x usage with QoS policies:

from openstack import connection

# Build connection using clouds.yaml or environment variables

conn = connection.from_config(cloud='mycloud')

# Create QoS policy - requires SDK >=4.1 and Neutron v2 QoS extension

policy = conn.network.create_qos_policy(
    name="high-bandwidth",
    description="QoS for high-throughput workloads",
    shared=True
)
print(f"Created QoS policy {policy.id}")

Legacy SDK 3.x compatible server listing:

from openstack import connection

conn = connection.from_config(cloud='oldcloud')

# Returns a concrete list in 3.x; returns a generator in 4.x

servers = conn.compute.servers()
for srv in servers:
    print(srv.id, srv.status)

Version Selection Guidelines

Choose your openstacksdk version based on the OpenStack release deployed in your environment.

  • For Xena through Zed clouds: Pin to >=4.1.0,<=4.9.0 as shown in pyproject.toml. This maximizes feature availability while maintaining stability against the Zed API surface.
  • For Wallaby and earlier clouds: Use SDK 3.1.x as demonstrated in the README.md example at line 55. Attempting to use 4.x features against these clouds results in HTTP 404 errors for missing endpoints.
  • When upgrading: Bump the version constraint in pyproject.toml, run uv sync --upgrade-package openstacksdk, then execute pytest against a live or simulated OpenStack environment to catch micro-version incompatibilities in the service wrappers.

Summary

  • The openstacksdk version determines which OpenStack API micro-versions and service endpoints are accessible to your automation code.
  • mcp-openstack-ops pins to 4.9.0 to ensure compatibility with Xena through Zed releases while avoiding breaking changes in 5.x.
  • Using SDK 3.x against modern clouds misses critical features like QoS policies and Octavia listeners.
  • Using SDK 5.x against older clouds risks HTTP 400 errors due to unsupported micro-version negotiation.
  • Always validate SDK upgrades by running the full test suite against the target OpenStack release's API surface.

Frequently Asked Questions

What happens if I use openstacksdk 5.x with an older OpenStack cloud?

SDK 5.x drops support for legacy micro-versions present in Wallaby and earlier releases. When connecting to these clouds, you will encounter AttributeError exceptions for removed methods or HTTP 404 responses when the SDK attempts to use endpoints that no longer exist in the target cloud's API catalog.

How do I check which openstacksdk version is locked in my installation?

Inspect the uv.lock file in the repository root. Lines 754-826 contain the locked entry for openstacksdk, showing the exact version (currently 4.9.0) and cryptographic hash that the package manager will install. Alternatively, run uv pip show openstacksdk in your activated environment to view the runtime version.

Can I use openstacksdk 3.x with modern OpenStack releases like Zed?

While basic authentication and compute operations may function, SDK 3.x lacks client-side support for newer API micro-versions introduced in Xena and later. Features like network QoS policies, advanced Octavia load-balancer configurations, and newer Cinder volume types will be unavailable, causing AttributeError when your code attempts to access conn.network.create_qos_policy() or similar 4.x methods.

Why does mcp-openstack-ops use an upper bound of 4.10.0 instead of allowing 5.x?

The upper bound in pyproject.toml (<=4.10.0) prevents automatic installation of SDK 5.x, which introduces intentional breaking changes aligned with the 2026 OpenStack release cycle. By capping at 4.10.0, the maintainers ensure that dependency updates do not inadvertently pull in API signatures that remove support for the micro-versions still prevalent in production Zed clouds, protecting against runtime failures in src/mcp_openstack_ops/connection.py and service wrappers.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →