PenningLabs / lxconsole

LXD Graphical Web Console
GNU Affero General Public License v3.0
161 stars 19 forks source link

Using LXConsole for Both LXD & Incus - LXConsole does not list available LXD images but can list all available Incus images #17

Open bmullan opened 7 months ago

bmullan commented 7 months ago

On an Ubuntu 22.04 desktop machine I installed LXConsole nested in an Incus container. Everything works great so far with Incus container/vm management.

However, I'm having a problem with LXConsole and LXD container/vm management. I am attaching a PDF I wrote to describe the problem I have with trying to use LXD "images"

See the following PDF for details...

LXConsole vs CLI - LXD available images list problem.pdf

Thanks for any ideas or tips to fix this. Brian

matthewalanpenning commented 7 months ago

Brian, Here is a link to an article on the Linuxcontainers images being phased out for LXD. https://discuss.linuxcontainers.org/t/important-notice-for-lxd-users-image-server/18479

I am guessing that the images you are trying to download on your LXD servers are not actually being downloaded as a result of them being phased out. I see that Canonical has their own image repository and I do have a fix for LXConsole that will have LXD servers list images and pull images from Canonical's repo and then Incus doing the same from LinuxContainers' repo.

I will try to get this update pushed out later this week in version 0.4.8

bmullan commented 7 months ago

Thanks but yes I already knew about that (re LXD Image repo leaving linuxcontainers.org)

Last week Tom Parrot (LXD Dev Team) announced the Release/Availability of the New Canonical LXD Image repo/Server.

I am already using that new LXD Image repository: //images.lxd.canonical.com --protocol=simplestreams

image

bmullan commented 7 months ago

@matthewalanpenning

That does lead me to a couple related Question regarding LXConsole, LXD and Incus.

On my system I when I did "lxd init" or "incus admin init" when I got to the question about what PORT to use for remote access to the LXD or Incus server I assigned LXD Port=8443 and Incus Port=8444

So in my LXConsole Server's "Info screen":

LXD Server, IP Addresses information (LXD using Port 8443)

192.168.12.96:8443

10.43.18.1:8443

10.244.114.1:8443

Incus Server, IP Addresses Information (Incus using Port 8444)

192.168.12.96:8444

10.43.18.1:8444

10.244.114.1:8444

so both are reachable at the Same IP but on Different Ports.


I've been wondering about the following.

I don't know how LXConsole currently differentiates between between when to "speak" LXD API and when it needs to "speak" Incus API.

Up till now the API for LXD & Incus have not had much divergence but I think that's going to quickly change starting with the just announced Release/Availability of Incus 6.0 LTS last week also.

If no other than a simple checkbox or something when an Admin adds a New Server they can specify its LXD or Incus as a flag that could be checked in LXConsole so the appropriate API (LXD or Incus) can be used used for Actions.

Lastly, on the form where an Admin defines a New Server there should either be a "note" that they can add a Port # to the IP address of the New Server -or- an extra "entry" box in the Server definition form to enable entering the Port # (if one) for the Server being defined.

Thanks for you efforts with LXConsole.

Brian

matthewalanpenning commented 7 months ago

Brian, I just updated the code to version 0.4.8. Now when you go to add a new image from the images page, the catalog will dynamically populate the available images based on whether the server is incus or lxd. I believe this will solve your issue and download images. When I was testing adding in a new simplestreams repo I used "https://images.lxd.canonical.com" for the URL, not adding the --protocol. This would then allow me to download images using the form option on LXConosle. But now the catalog option will allow you to download from there as well.

Let me know if this works for you, Matt

matthewalanpenning commented 7 months ago

Also I do run both Incus and LXD on the same server for testing, doing the same setup where I use port 8444 for incus. When adding servers to LXConsole you can add the port needed but I did notice that it may be difficult to easily select between the two when using the dropdown option in the header because it does not list the port. I may look at adding the port number to the IP address in parenthesis to make it easier for this. I use the API to make changes to both Incus and LXD and you are right, as the two diverge I will have to have separate functions for each. Using the API I can determine which type of server it is running and then call the appropriate function. This is what I did for populating the images catalog.

bmullan commented 7 months ago

When I added each server I did include the port# for each & to ID each the server names are

On Mon, Apr 8, 2024, 10:52 AM Matthew Penning @.***> wrote:

Also I do run both Incus and LXD on the same server for testing, doing the same setup where I use port 8444 for incus. When adding servers to LXConsole you can add the port needed but I did notice that it may be difficult to easily select between the two when using the dropdown option in the header because it does not list the port. I may look at adding the port number to the IP address in parenthesis to make it easier for this. I use the API to make changes to both Incus and LXD and you are right, as the two diverge I will have to have separate functions for each. Using the API I can determine which type of server it is running and then call the appropriate function. This is what I did for populating the images catalog.

— Reply to this email directly, view it on GitHub https://github.com/PenningLabs/lxconsole/issues/17#issuecomment-2042970172, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM23J6YKE4GMSAPQLPDIFDY4KVLPAVCNFSM6AAAAABF2PCNMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSHE3TAMJXGI . You are receiving this because you authored the thread.Message ID: @.***>

bmullan commented 7 months ago

Two questions...

First is, you stated:

Also I do run both Incus and LXD on the same server for testing,

Mathew do you run the Docker LXConsole in the "Host" or "Nested" in a Container or VM?

Second question is a curiosity, If LXConsole is an application to implement a Management and Orchestration (MANO) for both LXD and Incus... why Docker? Again not a problem, but just wondered

Thanks again, I'll give the updated version 0.4.8 a spin.

bmullan commented 7 months ago

@matthewalanpenning

OK here are results of LXConsole v.04.8

Host Server

Baseline Test

From a terminal on the Host Server both LXD and Incus work as expected for both Container & VM management !

From the CLI all of the following commands displayed correct list(s) of images available for use.

Test 1

Installed & configured the Docker LXConsole 'nested' in an Incus Container. In LXConsole I added the New LXD Image Server to the available "Simplestreams'

Test 1 results

LXConsole worked as expected for management of Incus Containers & VMs

But LXConsole has a problem finding LXD Images and when trying to Create a Container or VM.

Using the 'Add Image' on 'Images Tab' lets you pick say Ubuntu but there are only 3 choices of Ubuntu Versions listed - Focal, Jammy, Mantic

Then... using the 'Instance Tab' when I click on 'Add Server' it displays 'none' for image selection.

Test 2

Everything installed & configured the same except installation was in an LXD container!

Test 2 Results

Exactly the same as Test 1 with LXConsole still not finding/displaying LXD Images.

Test 3

I installed the Docker LXConsole directly onto the Host Server (not nested in an LXD or Incus Container)

Test 3 Results

Same as Test 1 & Test 2 Results !

Final Test

I installed LXConsole on the Host Server using the Non-Docker install instructions on Github:

Use the following instructions to setup this software on a linux server:

Clone the git repository (git clone https://github.com/PenningLabs/lxconsole.git)
Install the python packages found in requirements.txt. (pip3 install -r requirements.txt)
Using python, run the run.py file. (python3 run.py)
Using your browser, visit http://youripaddress:5000/

Final Test Results

Identical to Test 1, 2, 3

My conclusion is that LXConsole's current problem with LXD must be due to the introduction of the new LXD Image
Server somehow !

Again, using a Terminal & the CLI both LXD and Incus correctly display their respective full list of available Images ! Also, LXConsole does work correctly with Incus Containers & VMs !

So I guess I just wait a few weeks & let the dust settle regarding the intro of the New LXD Image server & LXConsole.

Thanks for LXConsole. It will be a good tool to compliment the CLI for Container & VM management.

Brian

bmullan commented 6 months ago

@matthewalanpenning

Mathew... finally figured out what is going on.
I found out the LXD Image list doesn't look right due to a design decision for LXD regarding lxd images servers named images: and ubuntu:

$ lxc image list images:
now lists only Ubuntu Desktop VM images & only for these Ubuntu versions (focal, jammy, mautic, noble). This image server does not serve any Ubuntu Container images now!

$ lxc image list ubuntu: now lists all Ubuntu Container & VM images across more Ubuntu Versions.

Tom Parrot provided the explanation in response to a question I asked on the Canonical LXD Discourse:

https://discourse.ubuntu.com/t/lxc-image-list-images-only-4-ubuntu-versions-listed-all-4-are-vm-images-no-container-images/44553

Tom's comment was:

The LXD team’s images remote only provides Ubuntu desktop VMs so as not to cause confusion with the cloud (CPC) team’s official Ubuntu images from the ubuntu remote.

Right now we aren’t providing Ubuntu images on this remote so as not to cause confusion with the official ones.

We are planning to add support for Ubuntu desktop images though (as these are not available from the ubuntu remote currently).

So I think this means that LXConsole may need to use the ubuntu: image server instead of images: image server and instead use the ubuntu: image server? Or perhaps both, when dealing with LXD now.