Synology_app_mover icon indicating copy to clipboard operation
Synology_app_mover copied to clipboard

Moving Container manager

Open leotzian opened this issue 10 months ago • 41 comments

Hi and sorry for posting here it is not related to your script. I have a 1821+ with 2 M2 ssd and I tried to move container manager from volume 1 to volume 2 ( M2 SSD ). Your script worked fine it made a docker backup first and the container manager was moved to volume 2. Now I stopped container manager as your instructions and I tried to move docker shared folder from volume 1 to volume 2, BUT DSM don't let me to do so. " This action cannot be performed due to the following reasons. Container Manager requires this shared folder. Before moving this shared folder unistall the package first" Why? Doing so I think all my conatiner data will be deleted am I correct? and I have 20 Containers. Is there another solution or am I doing something wrong? I run DSM 7.2.2 version Thanks in advance.

leotzian avatar Feb 03 '25 09:02 leotzian

You can safely uninstall and then reinstall Container Manager as long as you re-install it on volume 2 and you don't tick the delete option when uninstalling it.

Image

007revad avatar Feb 03 '25 16:02 007revad

Hi my friend thanks for the answer So with your script container manager is moved in volume 2, So you say I unistall it move the shared folder then in volume 2 and then install Container Manager again in volume 2 ALL MY container setting remain? Am Iunderstood correctly?

leotzian avatar Feb 03 '25 16:02 leotzian

So I had moved a bit. I unistalled Container manager and I DIDNOT tick the delete square, I unistalled container Manager Then I had moved The docket shared folder from volume 1 to volume 2 Then I had installed Container manager 24.0.2.1525, all of my conatiners that had volume settings had problems because they look in volume 1 and I had to correct the path to volume 2 , the easiest way is by using Portainer, but I cannot make it run I had the error Container manager API had failed and in the logs there is "Error,2025/02/03 19:11:23,Leonidas227981,Start container portainer failed: {"message":"failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/portainer": stat /portainer: no such file or directory: unknown"}.

Do you have any idea how to solve this? Thanks for all

leotzian avatar Feb 03 '25 17:02 leotzian

I've never been able to install Portainer from the Container Manager ui. It installs but won't start.

So I have a disabled User-defined Script Scheduled Task, set to run as root, to install Portainer and just run when I need to:

docker pull portainer/portainer-ce:latest
wait
docker run -d --name=portainer \
-p 19943:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /volume1/docker/portainer-ce:/data \
--restart=always \
portainer/portainer-ce

007revad avatar Feb 03 '25 23:02 007revad

I don't know what is going on, I moved the docker container in Volume 1 again all my containers are working except portainet , I always installed portainer using task sceduller in the past, But the error I get is the same, whatever I try to install

Task Scheduler has completed a scheduled task.

Task: Portainer Start time: Tue, 04 Feb 2025 07:36:18 +0200 Stop time: Tue, 04 Feb 2025 07:36:21 +0200 Current status: 127 (Interrupted) Standard output/error: latest: Pulling from portainer/portainer-ce Digest: sha256:bd8f7a6d98e2a512e18272c38914abd1e92d663451f3c925d502a8557a3b92d7 Status: Image is up to date for portainer/portainer-ce:latest docker.io/portainer/portainer-ce:latest 1fd7ea821fddd4b3e9abbfd6a551e0fdea123d09916494b472b465a05cc552e1 docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/portainer": stat /portainer: no such file or directory: unknown.

Look at the last 2 lines what is shim task and OCI
Whatever I try to do change the volume for 1 to 2 or install everything or modify I get this error, I have no idea what this means.

Thnaks again for you help

leotzian avatar Feb 04 '25 05:02 leotzian

stat /portainer: no such file or directory: unknown. is the important part of that error message. It's saying it can't find /volume1/docker/portainer (or /volume2/docker/portainer

Is there a folder named portainer in your docker shared folder? Maybe it's actually named portainer-ce or Portainer?

007revad avatar Feb 04 '25 08:02 007revad

Hi my friend finally I managed portainer to work after some effords , yes there was a folder portainer in volume 1. Now container manager is installed in volume 2 using your script, bur the docker folder is in volume 1 ( I moved it in volume 1 from volume 2 ) and all are working fine. Now I am afraid to move to volume 2 again ( M2 Drives ), because most of the containers has volume 1 settings and I must correct to volume 2 and I don't know if the system will allow me as yesterday, most of them were not working

leotzian avatar Feb 04 '25 08:02 leotzian

I prefer to keep the docker shared folder on volume 1 as it means I don't have to edit volume mapping in any containers.

007revad avatar Feb 04 '25 08:02 007revad

So I will keep it mine finally docker on volume 1 Another final question because I have bother you enough I think you have 1821+ unit I received mine with dsm 6.2.4-25556 and upgraded to 7.2.2.-72806 update 2 and using migration assistant I migrated from 416play to 1821+, but my system partition is 2.3GB instead if 7.9Gb and synology suggested me a Mode 2 reset, but this way I must start from scratch Do you have any knowledge on this?

leotzian avatar Feb 04 '25 08:02 leotzian

How many HDDs are in the DS1821+ and what size? And how much data do you have on volume 1?

007revad avatar Feb 04 '25 09:02 007revad

Ι have 4 brand new 6TB red as SHR with about 4.2TB of data.

leotzian avatar Feb 04 '25 09:02 leotzian

Do you have a backup of the 4.2TB of data?

007revad avatar Feb 04 '25 09:02 007revad

I have the 416playwith exact the same data and I have a spare 6tb and 3tb and I can put them in 1821 as raid 0 ( space 8,2Tb ) and made a hyper backup to this volume What are you thinkng? a way to increase system space from 2.9 to 7.9?

leotzian avatar Feb 04 '25 09:02 leotzian

I was thinking maybe:

  1. Export the system configuration from "Control Panel > Backup & Restore > System Configuration > Export".
  2. Shut down the DS1821+ and remove the HDDs and NVMe drives.
  3. Insert spare, empty, HDD.
  4. Setup DSM 7.
  5. Shut down the DS1821+ and insert the 4 HDDs and NVMe drives (so the NAS now has 5 HDDs).
  6. Boot the DS1821+ and let it do a drive migration.

But now I'm wondering if the drive migration would keep the 2.9 GB system partition.

Both your DS1821+ and DS416play support Migration Assistant. https://www.synology.com/en-uk/dsm/packages/MigrationAssistant

There are some limitations on when migration assistant won't work. https://kb.synology.com/en-uk/DSM/help/MigrationAssistant/migrationassistant?version=7

So assuming none of the limitations apply to your scenario I would:

  1. Delete the storage pool 1 and storage pool 2.
  2. Run migration assistant to migrate (clone) your volume and settings from the DS416play to the DS1821+.
  3. Then setup your NVMe volume etc.

007revad avatar Feb 04 '25 20:02 007revad

Thnanks for your help below are my questions and the answers from synolofy support it is easier for me to do a foctory reset and them migrate again from my 416Play ( it is working fine and I han not replaced by the 1821+ yet.

======

Thank you for the feedback.

  1. Now my 1821+ runs dsm 7.2.2-72806 Update 2 is there a way to make Mode 2 reset to gain the 7.9GB system partition and then repeat the migration procedure from 416Play to 1821+ It would be more easier for me, or with migration procedure, system partition will be 2.3GB again?

Answer: If a storage pool still exists, Mode 2 reset will not gain 7.9 GB system partition and you will need to perform a factory reset. Therefore, you can back up the data first, perform a factory reset and perform Migration Assistant again. The system partition of DS1821+ will remain 7.9GB.

  1. And something else I thought in the meantime, I have a spare 3TB and a 6TB, in the 1821+ I have 4 empty slots, If I put those 2 disks as raid 0 I will have a storage pool of 8.2TB, can I backup all my system in this storage pool, using hyper backup or with the reset and THIS storage pool will be deleted?

Answer: You can back up the data to the new RAID 0 storage pool, power off DS1821+ to remove the spare 3TB and 6TB disks, and power on DS1821+ to perform a factory reset (so the data in the RAID 0 storage pool will not be erased by factory reset).

Then insert the two disks back and go to Storage Manager to click Online Assemble to access the data. Create a new storage pool with other 6TB disks and restore the data from the RAID 0 storage pool to the new storage pool.

leotzian avatar Feb 05 '25 04:02 leotzian

So I will keep it mine finally docker on volume 1 Another final question because I have bother you enough I think you have 1821+ unit I received mine with dsm 6.2.4-25556 and upgraded to 7.2.2.-72806 update 2 and using migration assistant I migrated from 416play to 1821+, but my system partition is 2.3GB instead if 7.9Gb and synology suggested me a Mode 2 reset, but this way I must start from scratch Do you have any knowledge on this?

Did you've tried to export/import the Container configs? I moved my docker container some years before and I think i've made it like this:

  1. Export Container Configuration for every container (just the config without data)
  2. Open the json-Files and rename the Container -> For example: "name" : "jDownloader_New", (to keep the old containers)
  3. Move your docker folder to the new volume
  4. Import the configs to create the containers again
  5. If all went fine, you can delete the old containers

You dont have to change the path in the json files, as they are using symlinks. For this example: "host_volume_file" : "/docker/jDownloader",

Portainer is nice and I do use it too, but using Synologys Docker console and portainer at the same time, can cause some issues.

Riza-Aslan avatar Feb 11 '25 07:02 Riza-Aslan

The latest version of Syno_app_mover exports the json files when you select Moving Container Manager or Docker. I prefer the exported json files because, as you said, you don't have to change the volume paths. Also it exports json files for all containers. Doing a yaml backup only backs up running containers.

For those "volume_bindings" Container Manager would use synoshare --get-real-path docker to locate the the volume the docker share is on.

I have tried importing the json files and it only works if the image has already been downloaded.

I use Portainer 99% of the time.

007revad avatar Feb 14 '25 20:02 007revad

Hi @007revad whatever I had done so far I cannot move docker shared folder to volume2 at least in my case. The steps I had done, Docker container manager ( I have version 24.0.2-1525) had moved to volume 2 using your script. Then to move docker shared folder I have to unistall Docker container manager ( DSM 7.2 don't let me just stop it ). So I unistall it without checking to delete data etc. , then I move shared folder to Volume 2 . Then I install Docker container manager again to Volume 2. Most of the containers included portainer are stopped, not working due to volume binding ( containers look at volume 1 ) When I try to dublicate each container using the DSM container manager ( because portainer is still looking to volume 1 ) I have the message Container manager api had failed, I cannot do anything. If anyone had found a solution with DSM 7.2.2-72806 and docker version 24.0.2-1525 plaase explain the steps I have 18 containers running. Thanks in advance.

leotzian avatar Feb 15 '25 07:02 leotzian

I haven't tried docker version 24.0.2-1525 yet.

syno_app_mover exports the json config files before moving container manager. These are saved in the docker shared folder in a folder named app_mover_exports. The nice thing about container manager's json exports is they don't have the docker share hard coded.

So the following steps should fix your volume mapping issue while container manager is installed on volume 2.

  1. Move the docker shared folder to volume 2.
  2. Delete the containers in container manager but keep the images.
  3. Import the json backups that are in the docker shared folder which will create your containers with the correct volume 2 mapping.

Portainer is more complicated than regular docker containers so you may have to uninstall it then install it again.

To install portainer I use a user-defined scheduled task in task scheduler that runs as root and automatically detects which volume the docker share is on.

docker_share=$(/usr/syno/sbin/synoshare --get-real-path docker)
if [ ! -d $docker_share/portainer-ce ]; then
  echo "$docker_share/portainer-ce not found!"
  exit 1
fi
docker pull portainer/portainer-ce:latest
wait
docker run -d --name=portainer-ce \
-p 9943:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $docker_share/portainer-ce:/data \
--restart=always \
portainer/portainer-ce

I just posted about it on the German Synology forum today. https://www.synology-forum.de/threads/portier-installation-aber-wie.137674/post-1228609

007revad avatar Feb 15 '25 07:02 007revad

I will try all the above another strange think I cannot install the 20.10.23-1437 version afer unistallling and moving the docker shared folder I intall it and then it stops and tells contact developer only the beta 24.02-1525 I can install If I press Repair this version is downloaded again installs again and the same message again.

Image

When I try to import from Json file as you had mentioned before I get the error

Image

Perhaps it has to do with 24.02-1525 version BUT I cannot install the older one I ger this error in whatever containet I try to dublicate import etc The error in Container manager log is Start container Flame failed: {"message":"failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown"}.

leotzian avatar Feb 15 '25 12:02 leotzian

I will try all the above another strange think I cannot install the 20.10.23-1437 version afer unistallling and moving the docker shared folder I intall it and then it stops and tells contact developer only the beta 24.02-1525 I can install If I press Repair this version is downloaded again installs again and the same message again.

Image

When I try to import from Json file as you had mentioned before I get the error

Image

Perhaps it has to do with 24.02-1525 version BUT I cannot install the older one I ger this error in whatever containet I try to dublicate import etc The error in Container manager log is Start container Flame failed: {"message":"failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "docker-entrypoint.sh": executable file not found in $PATH: unknown"}.

Same here :(

Any Solution yet?

Bias84 avatar Mar 05 '25 13:03 Bias84

Yesterday, 5th March 2025, Synology quietly deleted 24.02-1525 then replaced it with a new 24.02-1525 version (with the same version number!?!?).

Try uninstalling 24.02-1525 then download the "new" spk file and do a manual install in package center. https://archive.synology.com/download/Package/ContainerManager/24.0.2-1535

Or install 20.10.23-1437 from here: https://archive.synology.com/download/Package/ContainerManager/20.10.23-1437

007revad avatar Mar 05 '25 19:03 007revad

Yesterday, 5th March 2025, Synology quietly deleted 24.02-1525 then replaced it with a new 24.02-1525 version (with the same version number!?!?).

Try uninstalling 24.02-1525 then download the "new" spk file and do a manual install in package center. https://archive.synology.com/download/Package/ContainerManager/24.0.2-1535

Or install 20.10.23-1437 from here: https://archive.synology.com/download/Package/ContainerManager/20.10.23-1437

I will try with the "new" spk file. Installing the older version is not possible. After manual installation it shows "repair" and install the new version out of the package center.

I can't see any differences between the both versions 24.0.2-1535 but will give it a try and give feedback

thx

Bias84 avatar Mar 06 '25 07:03 Bias84

Yesterday, 5th March 2025, Synology quietly deleted 24.02-1525 then replaced it with a new 24.02-1525 version (with the same version number!?!?). Try uninstalling 24.02-1525 then download the "new" spk file and do a manual install in package center. https://archive.synology.com/download/Package/ContainerManager/24.0.2-1535 Or install 20.10.23-1437 from here: https://archive.synology.com/download/Package/ContainerManager/20.10.23-1437

I will try with the "new" spk file. Installing the older version is not possible. After manual installation it shows "repair" and install the new version out of the package center.

I can't see any differences between the both versions 24.0.2-1535 but will give it a try and give feedback

thx

Unfortunately, the "new" spk file doesn't bring any improvement. The error message is identical. As previously described, installing the old spk file gets overwritten by a repair to the current version.

Bias84 avatar Mar 06 '25 08:03 Bias84

Yesterday, 5th March 2025, Synology quietly deleted 24.02-1525 then replaced it with a new 24.02-1525 version (with the same version number!?!?). Try uninstalling 24.02-1525 then download the "new" spk file and do a manual install in package center. https://archive.synology.com/download/Package/ContainerManager/24.0.2-1535 Or install 20.10.23-1437 from here: https://archive.synology.com/download/Package/ContainerManager/20.10.23-1437

I will try with the "new" spk file. Installing the older version is not possible. After manual installation it shows "repair" and install the new version out of the package center. I can't see any differences between the both versions 24.0.2-1535 but will give it a try and give feedback thx

Unfortunately, the "new" spk file doesn't bring any improvement. The error message is identical. As previously described, installing the old spk file gets overwritten by a repair to the current version.

I've now tested all possible options. Without success :( The Container Manager itself runs without any issues on the NVMe volume (Volume 3). I've also created a new shared folder "docker_neu" direct on this NVMe Volume 3 for testing purposes and tried to start a container there via "duplicate" from the running one on Volume 1. Without success. Even creating a container with adjusted data for the new volume 3 and the shared folder on volume 3 doesn't work. It seems as if the Container Manager simply doesn't want to allow storing the Dockerfiles on a different volume than the original volume 1...

Bias84 avatar Mar 06 '25 11:03 Bias84

I had the same problem whatever I had tried I cannot make docker run in a shared folder on NVMe Drive, Docker package is running in MVMe ( Volume 2 in my case ), but there is no way to make docker work using NVMe Drive as docker shared folder.
Using Docker Version 24.0.2-1535

leotzian avatar Mar 06 '25 11:03 leotzian

Has anyone reported the hardcoded /volume1/docker dependency to Synology yet? I am in the midst of a project to migrate all uses of /volume1 to /volume2, and this is an unexpected showstopper.

watou avatar Mar 16 '25 18:03 watou

Forgive my ignorance, I'm very new to the world of DSM. I read through the thread - does this mean moving the container manager app is currently broken across the board? Or is it only broken under a specific set of circumstances?

I have plex and a bunch of *arr containers running on volume1, which is also where my data is stored. I want to move all the containers to volume2 and have only my media data stored on volume1. Is it currently possible to do this? From what I gleaned, it seems like DSM only allows docker containers to run on volume1?

Many thanks for the help!

heylookltsme avatar Mar 17 '25 16:03 heylookltsme

It's only an issue if you move the latest container manager app AND move the docker shared folder.

007revad avatar Mar 17 '25 16:03 007revad

Welp, looks like I do have the latest container manager, version 24.0.2-1535 👎🏻

Not 100% sure what the docker shared folder is. Do you mean the folder where I store all the apps' data and mount in the containers? So like, I have /volume1/docker/appdata/plex, /volume1/docker/appdata/radarr, etc etc. This bug means I can't move that /volume1/docker folder?

heylookltsme avatar Mar 17 '25 17:03 heylookltsme