Search code examples
pythonopenstacksdkopenstack-shade

How do I move from openstack shade to openstacksdk?


I have written a set of automation tools that interact with an openstack based service. The tools are relying on the openstack shade library. That client library says

shade has been superceded by openstacksdk and no longer takes new features.

since 2017.

Now I am simply wondering:

  • is there a specific approach for converting my existing code base?
  • how much effort is to be expected?

Solution

  • Of course, no two projects are the same, but I consider it appropriate to state: moving forward is most likely a swift and quick exercise!

    In our case, the only change that was necessary was to replace:

     my_connection = shade.openstack_cloud(cloud='cloudX', **auth_data)
    

    with

    my_connection = openstack.connection.from_config(cloud='cloudX', **auth_data)
    

    All other code that uses that my_connection object works exactly the same as before. In other words: the APIs for shade and openstack client objects, and methods, and parameters are the same, as far as I could observe.

    Therefore updating to openstacksdk was almost completely transparent for the client code in our project.

    As said, this might not apply to all projects, but given meaningful abstractions were put in place, the potential costs of this move are insignificant.