OpenVZ Forum


Home » General » Support » vzdump limitation? need work around large VPS
vzdump limitation? need work around large VPS [message #36914] Wed, 29 July 2009 21:31 Go to next message
tatawaki is currently offline  tatawaki
Messages: 3
Registered: December 2008
Junior Member
I have a large container that I'd like to use vzdump to backup. I'm currently tar'ing the home directory separately so I want to use the exclude-path option so I don't backup the /home/ dir.

problem:
it creates a full instance/copy (includes all directories) and ignores the flag --exclude-path '/home/.+' (22gb directory) until it creates the tar.

is it possible to set vzdump to exclude the path when creating the copy of the container?

My problem is my container is larger than my free disk space

output of log file on my smaller VPS:
Jul 29 15:24:01 INFO: Starting Backup of VM 1088 (openvz)
Jul 29 15:24:01 INFO: status = CTID 1088 exist mounted running
Jul 29 15:24:01 INFO: starting first sync /var/lib/vz/private/1088 to /home/vz/dump/vzdumptmp24851
Jul 29 15:50:56 INFO: Number of files: 198541
Jul 29 15:50:56 INFO: Number of files transferred: 184381
Jul 29 15:50:56 INFO: Total file size: 8618271791 bytes
Jul 29 15:50:56 INFO: Total transferred file size: 8615961405 bytes
Jul 29 15:50:56 INFO: Literal data: 8616827989 bytes
Jul 29 15:50:56 INFO: Matched data: 0 bytes
Jul 29 15:50:56 INFO: File list size: 5688958
Jul 29 15:50:56 INFO: File list generation time: 41.348 seconds
Jul 29 15:50:56 INFO: File list transfer time: 0.000 seconds
Jul 29 15:50:56 INFO: Total bytes sent: 8632032790
Jul 29 15:50:56 INFO: Total bytes received: 4158115
Jul 29 15:50:56 INFO: sent 8632032790 bytes received 4158115 bytes 5345831.57 bytes/sec
Jul 29 15:50:56 INFO: total size is 8618271791 speedup is 1.00
Jul 29 15:50:57 INFO: first sync finished (1616 seconds)
Jul 29 15:50:57 INFO: suspend vps
Jul 29 15:50:57 INFO: Setting up checkpoint...
Jul 29 15:50:57 INFO: suspend...
Jul 29 15:50:58 INFO: get context...
Jul 29 15:50:58 INFO: Checkpointing completed succesfully
Jul 29 15:50:58 INFO: final sync /var/lib/vz/private/1088 to /home/vz/dump/vzdumptmp24851
Jul 29 15:51:41 INFO: Number of files: 198584
Jul 29 15:51:41 INFO: Number of files transferred: 1343
Jul 29 15:51:41 INFO: Total file size: 8620442434 bytes
Jul 29 15:51:41 INFO: Total transferred file size: 390709087 bytes
Jul 29 15:51:41 INFO: Literal data: 1628380 bytes
Jul 29 15:51:41 INFO: Matched data: 389080707 bytes
Jul 29 15:51:41 INFO: File list size: 5690960
Jul 29 15:51:41 INFO: File list generation time: 5.730 seconds
Jul 29 15:51:41 INFO: File list transfer time: 0.000 seconds
Jul 29 15:51:41 INFO: Total bytes sent: 7804534
Jul 29 15:51:41 INFO: Total bytes received: 694115
Jul 29 15:51:41 INFO: sent 7804534 bytes received 694115 bytes 195371.24 bytes/sec
Jul 29 15:51:41 INFO: total size is 8620442434 speedup is 1014.33
Jul 29 15:51:41 INFO: final sync finished (43 seconds)
Jul 29 15:51:41 INFO: resume vps
Jul 29 15:51:41 INFO: Resuming...
Jul 29 15:51:41 INFO: vps is online again after 44 seconds
Jul 29 15:51:41 INFO: creating archive '/home/backups/working/vzdump-1088.dat' (/home/vz/dump/vzdumptmp24851/1088)
Jul 29 15:53:48 INFO: Total bytes written: 689653760 (658MiB, 5.3MiB/s)
Jul 29 15:53:48 INFO: file size 227MB
Jul 29 15:54:57 INFO: Finished Backup of VM 1088 (00:30:56)

vzdump creates an 8+GB copy to backup 227MB Shocked
Re: vzdump limitation? need work around large VPS [message #36924 is a reply to message #36914] Thu, 30 July 2009 15:05 Go to previous messageGo to next message
tatawaki is currently offline  tatawaki
Messages: 3
Registered: December 2008
Junior Member
ok, here's the work around:

my $rsyncopts = "--stats --numeric-ids --bwlimit=${opt_bwlimit}";

# changes
$rsyncopts = $rsyncopts." --exclude-from=/home/backups/exclude_vzdump.txt";

the txt file contains <VEID>/home/:

1094/home/

Re: vzdump limitation? need work around large VPS [message #41202 is a reply to message #36914] Sun, 12 December 2010 11:39 Go to previous messageGo to next message
prividen is currently offline  prividen
Messages: 1
Registered: December 2010
Location: RU, MSK, Korolev
Junior Member

See also git.altlinux.org/people/prividen/packages/?p=vzdump.git;a=co mmit;h=d52f7bcda5223549e54632fa4675eb77ecdfbac9
Re: vzdump limitation? need work around large VPS [message #51411 is a reply to message #36914] Fri, 16 May 2014 10:19 Go to previous messageGo to next message
gdsorin is currently offline  gdsorin
Messages: 1
Registered: May 2014
Location: Craiova, Romania
Junior Member

In debian 7 (wheezy) with VZDump 1.2.3-3 is following workaround,
In file "/usr/share/perl5/PVE/VZDump.pm"
after line 1077 "foreach my $task (@$tasklist) {"
i added:
if ($opts->{'exclude-path'}) {
$task->{'exclude-path'}=$opts->{'exclude-path'};
}
And in file "/usr/share/perl5/PVE/VZDump/OpenVZ.pm"
after line 147 "my $rsyncopts = "--stats -x --numeric-ids --bwlimit=$opts->{bwlimit}";"
i added:
my $excluds = " ";
foreach my $path (@{$task->{'exclude-path'}}){
my $pathu=substr($path, 1, length($path)-4);
$excluds = $excluds." --exclude '$pathu'";
}

$self->cmd ("rsync $rsyncopts -aH --delete --no-whole-file --inplace $excluds '$from' '$to'");
and commented with # $self->cmd ("rsync $rsyncopts -aH --delete --no-whole-file --inplace '$from' '$to'");

  • Attachment: VZDump.pm
    (Size: 26.06KB, Downloaded 642 times)
  • Attachment: OpenVZ.pm
    (Size: 9.34KB, Downloaded 642 times)
Re: vzdump limitation? need work around large VPS [message #51576 is a reply to message #51411] Mon, 04 August 2014 13:32 Go to previous message
votsalo is currently offline  votsalo
Messages: 26
Registered: December 2011
Location: Greece
Junior Member
You can also make a template of the container. Basically, stop the container and tar it, excluding whatever directories you want. For a proper template, you should truncate some files, like all the log files in /var/log and /etc/hostname, /etc/resolv.conf, but I think you can skip that and it will still work.
Previous Topic: Does x64 OpenVZ host support running x86 guest?
Next Topic: How to move large simfs directories from one container to another?
Goto Forum:
  


Current Time: Thu Apr 18 04:26:22 GMT 2024

Total time taken to generate the page: 0.01620 seconds