Backup lxc

rostma

Active Member
Jun 7, 2019
8
1
43
41
I welcome all!
I apologize for my English!
Prompt as it is correct to make the backup copy of lxc of a container in proxmox 5? Through web it is impossible to make the backup copy. In the log of reservation I see:

INFO: create storage snapshot 'vzdump'
Using default stripesize 64.00 KiB.
Logical volume «snap_vm-1002-disk-0_vzdump» created.
Using default stripesize 64.00 KiB.
Logical volume «snap_vm-1002-disk-1_vzdump» created.
INFO: resume vm
INFO: guest is online again after 1 seconds
INFO: creating archive '/var/lib/vz/dump/vzdump-lxc-1002-2019_06_06-13_38_02.tar.gz'
INFO: tar: ./opt/mlmmjadmin-1.9/settings.py: Cannot open: Permission denied
INFO: tar: ./opt/mlmmjadmin-1.9/settings.pyc: Cannot open: Permission denied
INFO: tar: ./opt/netdata/var/cache/netdata/system.swap: Cannot open: Permission denied
INFO: tar: ./opt/netdata/var/cache/netdata/groups.threads: Cannot open: Permission denied
INFO: tar: ./opt/netdata/var/cache/netdata/web_log_apache.http_method: Cannot open: Permission denied
.
.
.

And so on.
Probably there are no rights for reservation of disk (it on lvm)

It turns out to make the backup copy, only if to make a privilege container. If I correctly understand - it is not safe. How it is correct to make the backup copy not of an unprivilege container? It is desirable without its stop.

I will be very grateful for the help!
 
hi

It turns out to make the backup copy, only if to make a privilege container. If I correctly understand - it is not safe. How it is correct to make the backup copy not of an unprivilege container? It is desirable without its stop

i'm guessing your container can only be restored as privileged. did you try that? sometimes it's needed for specific setups. you can remove the device nodes in your container and try to restore as unprivileged
 
I cannot try to recover a container. At me it is impossible to create backup file for recovery from it
The backup file just is not created

Tasks every time come to an end with it:

INFO: tar: Exiting with failure status due to previous errors
ERROR: Backup of VM 102 failed - command 'set -o pipefail && lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' --one-file-system '--warning=no-file-ignored' '--directory=/var/lib/vz/dump/vzdump-lxc-102-2019_06_07-12_23_05.tmp' ./etc/vzdump/pct.conf '--directory=/var/lib/vz/dump/vzdump-lxc-102-2019_06_07-12_23_05.tmp' --no-anchored '--exclude=lost+found' --anchored '--exclude=./tmp/?*' '--exclude=./var/tmp/?*' '--exclude=./var/run/?*.pid' . | gzip >/var/lib/vz/dump/vzdump-lxc-102-2019_06_07-12_23_05.tar.dat' failed: exit code 2
INFO: Failed at 2019-06-07 12:26:55
INFO: Backup job finished with errors
TASK ERROR: job errors
 
how are you trying to recover your container? gui or command line?

if not command line, can you try as such:

Code:
pct restore CTID /path/to/vzdump/archive --storage your_storage

please post the full output of the command i've sent.
 
I do everything of gui
Unfortunately I cannot apply the "pct restore CTID/path/to/vzdump/archive-storage your_storage" command from cli because at me it is impossible to make archive.
The error which I described earlier appears during creation of the archive file.
 
then try:

Code:
vzdump CTID
 
thanks for the log.

can you send the output of `pct config CTID`?

what kind of storage are you using btw?
 
Yes of course, I attached the file of a configuration of a container.
And what such "btw"? I do not know that it.
Set proxmox from iso. The disks vm/ct are stored on lvm-local
Archives become in local (pve) or NFS storage.
It is impossible to make archive neither in local, nor in nfs
 

Attachments

hi again,

just guessing at this point but maybe you can try changing your tmpdir option in /etc/vzdump.conf and see if that helps
 
I read about it. But did not try. Today tried.
I changed in/etc/vzdump.conf
#tempdir: DIR
on
tempdir: / tmp
Unfortunately does not work.
 
hi,

i'm pretty sure you did something weird on your container or your host system.

try going into your container and doing an `ls -l` on some of those files that are in the error output. maybe you have incorrect owners for those files or something like that, could have happened if you mixed unpriv/priv containers or something
 
Such problem with one container (I made copies) on different nodes.
Probably you are right. I made one more unpriv a container for tests. At me it turned out to make it by vzdump and restore of gui without problems.
The rights and owners at files from the log different. On some of them I cannot look 'ls - l' without sudo
What did you mean "mixed unpriv/priv containers"?
I actually at first did to unpriv a container. After I could not recover a container from archive. Also made it by priv. Now if I do to unpriv a container again even the archive does not become.
Whether it is possible that with it to make that? Or now to use only priv a container?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!