Commit 0289e725 authored by Dietmar Maurer's avatar Dietmar Maurer

use -mode instead of -snapshot, -suspend and -stop

parent 7d0b305b
......@@ -427,7 +427,7 @@ sub new {
check_bin ('cstream');
check_bin ('ionice');
if ($opts->{snapshot}) {
if ($opts->{mode} && $opts->{mode} eq 'snapshot') {
check_bin ('lvcreate');
check_bin ('lvs');
check_bin ('lvremove');
......@@ -444,10 +444,6 @@ sub new {
}
}
$opts->{mode} = 'stop' if $opts->{stop};
$opts->{mode} = 'suspend' if $opts->{suspend};
$opts->{mode} = 'snapshot' if $opts->{snapshot};
$opts->{dumpdir} =~ s|/+$|| if ($opts->{dumpdir});
$opts->{tmpdir} =~ s|/+$|| if ($opts->{tmpdir});
......@@ -1048,20 +1044,12 @@ my $confdesc = {
optional => 1,
default => 0,
},
stop => {
type => 'boolean',
description => "Stop/Restart VM when running.",
optional => 1,
},
snapshot => {
type => 'boolean',
description => "Try to use (LVM) snapshots when running.",
optional => 1,
},
suspend => {
type => 'boolean',
description => "Suspend/resume VM when running",
mode => {
type => 'string',
description => "Backup mode.",
optional => 1,
default => 'stop',
enum => [ 'snapshot', 'suspend', 'stop' ],
},
exclude => {
type => 'string', format => 'pve-vmid-list',
......@@ -1136,6 +1124,11 @@ my $confdesc = {
},
};
sub option_exists {
my $key = shift;
return defined($confdesc->{$key});
}
# add JSON properties for create and set function
sub json_config_properties {
my $prop = shift;
......
......@@ -56,7 +56,7 @@ machines (VMs). It basically creates a tar archive of the VM private area,
which also includes the VM configuration files. vzdump currently
supports OpenVZ and QemuServer VMs.
There are several ways to provide consistency:
There are several ways to provide consistency (option C<mode>):
=over 2
......@@ -157,15 +157,15 @@ Simply dump VM 777 - no snapshot, just archive the VM private area and configura
Use rsync and suspend/resume to create an snapshot (minimal downtime).
# vzdump 777 --suspend
# vzdump 777 --mode suspend
Backup all VMs and send notification mails to root and admin.
# vzdump --all --suspend --mailto root --mailto admin
# vzdump --all --mode suspend --mailto root --mailto admin
Use LVM2 to create snapshots (no downtime).
# vzdump 777 --dumpdir /mnt/backup --snapshot
# vzdump 777 --dumpdir /mnt/backup --mode snapshot
Backup more than one VM (selectively)
......@@ -173,7 +173,7 @@ Backup more than one VM (selectively)
Backup all VMs excluding VM 101 and 102
# vzdump --suspend --exclude 101,102
# vzdump --mode suspend --exclude 101,102
Restore an OpenVZ machine to VM 600
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment