lxc move mycontainer mycontainer --project default --target-project backups
Just getting started with LXD projects. Tried the above command after creating a project named backups.
I expected it to run really fast, just updating the project association configs.
But instead it took a while to run. That was because the above command literally copies the container and deletes the original (and the container was 10GB). I watched, while refreshing zfs list, as
serverpool/lxd/containers/mycontainer
was copied to
serverpool/lxd/containers/backups_mycontainer
Then the original was deleted.
This move was using my laptop, on the default storage. Nothing was configured for the backups project to use anything different than what the default project uses. The storage volume for both should also be the same. To setup the project I used:
lxc project create backups -c features.images=false -c features.profiles=false
As instructed in the tutorial at Introduction to LXD projects | Ubuntu
I’m curious why moving between projects is a “copy” then “delete” type function, rather than simply renaming the container & updating some sort of project associations.
Just as a comparison, imagine having a 100GB file and you move filename.tar.gz from your current folder into ./subfolder/filename.tar.gz Linux doesn’t copy the file into ./subfolder/filename.tar.gz then delete the original. It just renames the file to the new location.
Why doesn’t (or why can’t) moving containers between LXD projects work like that?
There’s probably a good reason for it being this way. I’m just trying to understand this better.