Restoring backup to Docker container

I tried what the link mentioned.

Turned of the tmpfs on the full cmk server
Ran a backup.
Turned off the tmpfs on the docker container.
tried to run the restore from the web interface. Got the following error.

2022-01-27 17:14:18 --- Starting restore (bkup) ---
2022-01-27 17:14:28 Error while sending data to restore process: [Errno 32] Broken pipe
2022-01-27 17:14:28 Traceback (most recent call last):
  File "/omd/sites/cmk/bin/omd", line 60, in <module>
    omdlib.main.main()
  File "/omd/versions/2.0.0p17.cre/lib/python3/omdlib/main.py", line 4009, in main
    command.handler(version_info, site, global_opts, args, command_options)
  File "/omd/versions/2.0.0p17.cre/lib/python3/omdlib/main.py", line 2814, in main_restore
    prepare_restore_as_site_user(site, global_opts, options)
  File "/omd/versions/2.0.0p17.cre/lib/python3/omdlib/main.py", line 2911, in prepare_restore_as_site_user
    shutil.rmtree(path)
  File "/omd/versions/2.0.0p17.cre/lib/python3.8/shutil.py", line 722, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/omd/versions/2.0.0p17.cre/lib/python3.8/shutil.py", line 720, in rmtree
    os.rmdir(path)
OSError: [Errno 16] Device or resource busy: '/omd/sites/cmk/tmp'

Site restore failed

I tried to run the restore from the command line inside the docker container.
Got the following failure.

Deleting existing site data...Traceback (most recent call last):
  File "/omd/sites/cmk/bin/omd", line 60, in <module>
    omdlib.main.main()
  File "/omd/versions/2.0.0p17.cre/lib/python3/omdlib/main.py", line 4009, in main
    command.handler(version_info, site, global_opts, args, command_options)
  File "/omd/versions/2.0.0p17.cre/lib/python3/omdlib/main.py", line 2814, in main_restore
    prepare_restore_as_site_user(site, global_opts, options)
  File "/omd/versions/2.0.0p17.cre/lib/python3/omdlib/main.py", line 2911, in prepare_restore_as_site_user
    shutil.rmtree(path)
  File "/omd/versions/2.0.0p17.cre/lib/python3.8/shutil.py", line 722, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/omd/versions/2.0.0p17.cre/lib/python3.8/shutil.py", line 720, in rmtree
    os.rmdir(path)
OSError: [Errno 16] Device or resource busy: '/omd/sites/cmk/tmp'

The reason I am using docker is that I have multiple small linux web apps that I want to run. Currently I only have physical resources to run a single Linux VM (Very small IT shop). I want to keep the apps operating as independent as I can while operating on a single Linux VM.

Is it possible to restore a full install backup to docker container?

1 Like