LINBIT / linstor-client

Python client for LINSTOR
https://docs.linbit.com/docs/linstor-guide/
GNU General Public License v3.0
22 stars 10 forks source link

ModuleNotFoundError: No module named 'linstor' #31

Closed volkerjaenisch closed 4 years ago

volkerjaenisch commented 4 years ago

Just for completeness : Having the same trouble as in issue #30 under Debian Buster

The fix is quite easy, but please read on, the fix is at the end of this post.

The linstore debian modules drop the python files in /usr/lib/python3.5/dist-packages, making them Python minor-version dependent.


root@hydra3:/etc/drbd.d# dpkg -S linstor | grep python-linstor
python-linstor: /usr/lib/python3.5/dist-packages/linstor/resource.py
python-linstor: /usr/lib/python3.5/dist-packages/linstor/__init__.py
python-linstor: /usr/lib/python3.5/dist-packages/linstor/__pycache__/linstorapi.cpython-35.pyc
python-linstor: /usr/lib/python3.5/dist-packages/linstor/sharedconsts.py
python-linstor: /usr/lib/python3.5/dist-packages/linstor/__pycache__/properties.cpython-35.pyc
python-linstor: /usr/lib/python3.5/dist-packages/python_linstor-1.0.14.egg-info

/usr/lib/python3.5/dist-packages is not in the python path for Buster which comes with python 3.7.

root@hydra3:/etc/drbd.d# python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages']

I may note that it is possible to build minor-version independend python (debian) packages. Simply drop the files in '/usr/lib/python3/dist-packages' and be good for the next years.

DRBDmanage was easier to install than LINSTOR. I can't understand why LINBIT dumped the python based DRBDmanage to bring up a new JAVA Solution LINSTORE which in turm utilizes Python for its client and does not work on standard systems. In addition I have to maintain a Java installation as well as Python making the setup more complex.

Don't get me wrong: With DRBD we not missed a bit in more than ten years of extensive usage in our DCs. We utilize DRBD over Infiniband and achieve a performance that is incredible. But the user space tools are a pain.

And here the fix for this issue on debian buster:

ln -s /usr/lib/python3.5/dist-packages/linstor /usr/lib/python3/dist-packages/ which is quite softer than to give a customer the devastating advice

You will have to build packages yourself or install from source.

30

Cheers, Volker

rck commented 4 years ago

https://wiki.debian.org/DontBreakDebian

raltnoeder commented 4 years ago

I thought I'll add my perspective, maybe it will explain why we made certain decisions.

I can't understand why LINBIT dumped the python based DRBDmanage to bring up a new JAVA Solution LINSTORE which in turm utilizes Python for its client and does not work on standard systems. In addition I have to maintain a Java installation as well as Python making the setup more complex.

With DRBDmanage , there were 3 major problems:

For this reason, it was decided to abandon the project and start from scratch again, this time with a strong focus and fault tolerance, so that LINSTOR would be able to either compensate for most failures in the environment surrounding it, such as external utility programs or buggy kernel modules, or at least provide detailed reports on what failed and why.

Java was chosen because

My original intention for this project was for it to have a completely new client written from scratch, and not written in Python. Unfortunately, this was never realized, simply due to limited developer time - there were other priorities, and the client was not deemed as important, since LINSTOR is mostly used as a backend, connected to other interfaces via drivers/connectors. Most people do not use the client often, they use OpenNebula's / OpenStack's / Kubernetes' / etc. web user interface.

As someone who constantly complains about the generally awful usability, lack of consistency, standards and detailed status and error reporting, and bad reliability of virtually everything in Unix-like operating systems, I can understand your point about the user-space utilities, and I am constantly pushing towards more intuitive, more logical and more consistent tools. Apart from the installation process, we have hopefully at least succeeded in making LINSTOR easier to use than drbdmanage - especially, easier to troubleshoot with much better error reporting - but I agree we do not yet provide a really comfortable user interface.

We are currently also working on a LINSTOR appliance that will add a web-interface for two standard use cases, ISCSI and NFS servers. Web-based monitoring is being developed by one of our partner companies.

I cannot promise it, but maybe we will also get that new client some day - and if that is going to be one of my projects as well, I can assure you, it won't be written in Python.