linuxmuster / linuxmuster-webui7

Next generation web interface for linuxmuster.net v7.
https://www.linuxmuster.net
GNU General Public License v3.0
12 stars 8 forks source link

Support qcow2 linbo images #181

Closed HappyBasher closed 3 years ago

HappyBasher commented 3 years ago

Next Version of linuxmuster-linbo will use qcow2 image format. Please support the .qcow2 image file extension in linuxmuster-webui7.

kiarn commented 3 years ago

Hello @HappyBasher,

Does the additional files scheme stay the same ? I mean, do we have files named like :

ubuntu.qcow2
ubuntu.qcow2.desc
ubuntu.qcow2.info
ubuntu.qcow2.torrent
...

?

HappyBasher commented 3 years ago

Hi @kiarn !

Yep. And the additional files ubuntu.prestart ubuntu.postsync ubuntu.macct which appear in future without image extension. Note: You have to support also the old variant with extension.

Enjoy the heat! ;)

kiarn commented 3 years ago

Hello,

I pushed the new Linbo 4 plugin in the testing branch. I just need to add some restarts for the services. It's necessary to restart the torrent and the multicast service if I restore the backup, or if I rename an image ?

Duplicating image is not implemented, I don't see an use case for this, do we need it ?

Last question : should I prepare a button in the actual Linbo 2 plugin in order to convert images to qcow2 ? Or should the users do it only per CLI ?

Arnaud

dorianim commented 3 years ago

Hi @kiarn

I just updated to the latest testing and I get an internal server error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 968, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 915, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python3.6/dist-packages/aj/http.py", line 55, in dispatch
    content = self.handler.handle(http_context)
  File "/usr/local/lib/python3.6/dist-packages/aj/http.py", line 80, in handle
    output = middleware.handle(http_context)
  File "/usr/local/lib/python3.6/dist-packages/aj/gate/middleware.py", line 223, in handle
    raise WorkerError(resp.object)
aj.gate.worker.WorkerError: {"type": "http", "error": "[Errno 13] Keine Berechtigung: '/srv/linbo/images/ubuntu_test/ubuntu_test.qcow2.macct'", "exception": "PermissionError(13, 'Keine Berechtigung')"}
2021-10-27T08:06:37Z {'REMOTE_ADDR': '192.168.10.1', 'REMOTE_PORT': '49032', 'HTTP_HOST': '10.9.0.1', (hidden keys: 34)} failed with WorkerError

image

kiarn commented 3 years ago

Hi Dorian,

Thanks for the feedback. This is not finished, I made all my tests as root in the Webui, but without macct. What permissions does this file have ?

dorianim commented 3 years ago

Hi Aranud,

Please note that the error occurs even before logging in. The permissions are:

root@server:~# ls -l /srv/linbo/images/ubuntu_test/ubuntu_test.qcow2.macct
-rw------- 1 root root 4234 Sep 28 15:45 /srv/linbo/images/ubuntu_test/ubuntu_test.qcow2.macct
kiarn commented 3 years ago

Please note that the error occurs even before logging in.

Yes, it's normal, because there's now a service at starts from the Webui which handles all Linbo files. So this kind of error will be thrown at start.

I cannot reproduce the permission error, that's what I have :

/srv/linbo/images/ubuntu18:
total 2548784
drwxr-xr-x 3 root root       4096 oct.  27 11:43 .
drwxr-xr-x 5 root root       4096 oct.  24 11:51 ..
drwxr-xr-x 4 root root       4096 oct.   3 18:39 backups
-rw-r--r-- 1 root root         24 août  29 16:17 ubuntu18.prestart
-rw-rw-r-- 1 root root 2609718272 août  29 16:39 ubuntu18.qcow2
-rw-rw-r-- 1 root root         70 août  29 16:36 ubuntu18.qcow2.desc
-rw-rw-r-- 1 root root        143 août  29 16:39 ubuntu18.qcow2.info
-rw------- 1 root root          4 oct.  27 11:43 ubuntu18.qcow2.macct
-rw-rw-r-- 1 root root     199321 août  29 16:39 ubuntu18.qcow2.torrent

By the way, should the macct be editable in the Webui ?

kiarn commented 3 years ago

I just updated to the latest testing and I get an internal server error:

I did not publish anything since I merged Linbo 4 in testing : did you make your own package with buildpackage.sh ?

dorianim commented 3 years ago

By the way, should the macct be editable in the Webui ?

No, I don't think so. Probably you can simply ignore it.

I cannot reproduce the permission error, that's what I have :

Strange. I can fix it by setting chmod 666 and reproduce it by chmod 600.

did you make your own package with buildpackage.sh ?

Yes,

kiarn commented 3 years ago

Ok. You can confirm you have tested it as root in the Webui ? If the mod is 666, can you see in the Linbo 4 plugin the image and edit the extra files ? ( e.g. .reg ). /srv/linbo/images and /srv/linbo/images/ubuntu_test have permissions 755 ?

dorianim commented 3 years ago

Ok. You can confirm you have tested it as root in the Webui ?

What do you mean? I started the webui as root with /usr/bin/python3 /usr/local/bin/ajenti-panel --stock-plugins --plugins /usr/lib/linuxmuster-webui/plugins.

If the mod is 666, can you see in the Linbo 4 plugin the image and edit the extra files ?

Yes.

/srv/linbo/images and /srv/linbo/images/ubuntu_test have permissions 755 ?

Yes.

kiarn commented 3 years ago

I was able to reproduce the error, and it's not so simple to fix. I will think about it.

Duplicating image doesn't seem to be necessary, I will let it out.

kiarn commented 3 years ago

Should now work.

dorianim commented 3 years ago

Thanks, I'll try :)

kiarn commented 3 years ago

For your information, I just renamed testing --> lmn71.

dorianim commented 3 years ago

Seems to work :+1:

dorianim commented 3 years ago

Hi @kiarn

I just spotted another minor problem: When installing the latest lmn71 release on a lmn70 Server, an internal server error occurs:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 968, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 915, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python3.6/dist-packages/aj/http.py", line 55, in dispatch
    content = self.handler.handle(http_context)
  File "/usr/local/lib/python3.6/dist-packages/aj/http.py", line 80, in handle
    output = middleware.handle(http_context)
  File "/usr/local/lib/python3.6/dist-packages/aj/gate/middleware.py", line 223, in handle
    raise WorkerError(resp.object)
aj.gate.worker.WorkerError: {"type": "http", "error": "[Errno 2] Datei oder Verzeichnis nicht gefunden: '/srv/linbo/images'", "exception": "FileNotFoundError(2, 'Datei oder Verzeichnis nicht gefunden')"}
2021-11-08T08:44:32Z {'REMOTE_ADDR': '10.1.1.12', 'REMOTE_PORT': '49812', 'HTTP_HOST': 'av.makerlab-murnau.de', (hidden keys: 36)} failed with WorkerError

Executing mkdir -p /srv/linbo/images solves the issue.

Dorian

kiarn commented 3 years ago

Fixed, thanks ! i just show an info if the directory does not exist ( it will be automatic created by converting an image to qcow2 ).

kiarn commented 3 years ago

I will close this because the plugin development as feature request is quite finished. If there's more issues with the linbo 4 plugin, please open a new issue.