This patch will include storage asynchronous replication.

It is possible to synchronise a volume to an other node in a defined interval.
So if a node fail there will be an copy of the volumes from a VM
on an other node.
With this copy it is possible to start the VM on this node.
This commit is contained in:
Wolfgang Link
2017-04-24 17:15:31 +02:00
committed by Wolfgang Bumiller
parent f189504ccb
commit 663510b86d
8 changed files with 868 additions and 3 deletions

View File

@ -0,0 +1,49 @@
package PVE::API2::StorageReplication;
use warnings;
use strict;
use PVE::JSONSchema qw(get_standard_option);
use PVE::ReplicationTools;
use PVE::RESTHandler;
use base qw(PVE::RESTHandler);
__PACKAGE__->register_method ({
name => 'list',
path => 'list',
method => 'GET',
description => "List of all replication jobs.",
permissions => {
user => 'all',
},
protected => 1,
proxyto => 'node',
parameters => {
additionalProperties => 0,
properties => {
node => get_standard_option('pve-node'),
nodes => get_standard_option('pve-node-list' ,
{description => "Notes where the jobs is located.",
optional => 1}),
},
},
returns => { type => 'object' },
code => sub {
my ($param) = @_;
if ($param->{nodes}) {
foreach my $node (PVE::Tools::split_list($param->{nodes})) {
die "Node: $node does not exists.\n" if
!PVE::Cluster::check_node_exists($node);
}
}
my $nodes = $param->{nodes} ?
$param->{nodes} : $param->{node};
return PVE::ReplicationTools::get_all_jobs($nodes);
}});
1;