I installed LXD on a server and another LXD in my own workstation. I’m looking to use the LXD on the server to store some LXC project (images; configs; containers; …) and get those from my workstation.
I have install the server same as the rpi used in the video. And on my workstation, I have installed the remote with the providing token (same as the dakara in the video). I have restricted my worksation user to use only a test project.
When I run lxc remote switch rpi I’m allowed to only show the lxc project.
When I run lxc image list I show the image aliased as debian11
But when I run lxc remote switch local to return on my local remote and then run lxc image list rpi: I don’t show any image.
This is the same problem with or without restricting my workstation to a project.
My goal is to be able to easly get or push image and containers from the workstation. And be able to provide those to other computer as well.
If you have any idea what is wrong for me.
EDIT. Something strange is I don’t see any tokens on the rpi remote using lxc config trust list-tokens but I added the workstation with a given one
It is probably not a good pratice at all to want copy a project. Probably is better to create a project on the worksation to consume ressources given by the remote. As a local working project…
If I well understand the concept. In this use case, the remote can be used as a sources/backup repository. Right?
…
Also with this method I have an issue. Now I can copy a fresh downloaded image stored in my remote (rpi) using the command lxc image copy rpi:myimage --project myproject locale --alias myimage-dev.
The issue is when I try to init or launch container from this myimage-dev from commands lxc init myimage-dev c1 or lxc launch myimage-dev c1. I get the error:
Creating c1
Error: Failed creating instance record: Failed initialising instance: Invalid devices: Failed detecting root disk device: No root device could be found
I fix that after deleted my remote rpi project and recreating it without the profiles feature. And deleted the workstation project and recreating it with the network feature enable.
If you look in your default profile on the default project you’ll see a device like;
root:
path: /
pool: default
size: 30GB
type: disk
This default profile is attached to instances if profiles aren’t specified on creation and a result instances inheret their “root” disk device from this profile.
When you created a local project with the profiles feature flag enabled it doesn’t use the default profile (containing the root disk) from the default project. Its expected you’ll recreate a new “default” profile defining a root disk in the new project.
I think I’m a bit confused because I has no instance. Just an aliased image copied from images:
But in state, at the issue time. I created a new project with profile feature enable. Switch on it to copy the image. After that. I go on my home worksation to create a profile with all features on. Switch on this project to get the image from the other machine. Then the error appear when running the: lxc launch local:my_imported_image c1. And same result appear when I switch back to the default project to run the same command
So images inherit things like devices from profile when I download it? Or the problem is more on my workstation and I don’t understand the problem ?
Ok. It is the source of my error. So after some reads here I found the answer to retrieve the same settings for the profile of the new project to be the same as the default project one.