]> git.proxmox.com Git - pve-container.git/commitdiff
add restart migration to lxc api
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 2 Dec 2016 10:42:51 +0000 (11:42 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 2 Dec 2016 11:09:24 +0000 (12:09 +0100)
this simply adds the restart flag and the optional timeout to the
lxc api required for the restart mode migration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/API2/LXC.pm

index 38b1feb3a19bf1010fe70c0a7b161fdaf0df83a2..423c90eb92194c2907fa14dfc1f5731bc3369850 100644 (file)
@@ -845,6 +845,17 @@ __PACKAGE__->register_method({
                description => "Use online/live migration.",
                optional => 1,
            },
+           restart => {
+               type => 'boolean',
+               description => "Use restart migration",
+               optional => 1,
+           },
+           timeout => {
+               type => 'integer',
+               description => "Timeout in seconds for shutdown for restart migration",
+               optional => 1,
+               default => 180,
+           },
            force => {
                type => 'boolean',
                description => "Force migration despite local bind / device" .
@@ -882,8 +893,8 @@ __PACKAGE__->register_method({
 
        # try to detect errors early
        if (PVE::LXC::check_running($vmid)) {
-           die "can't migrate running container without --online\n"
-               if !$param->{online};
+           die "can't migrate running container without --online or --restart\n"
+               if !$param->{online} && !$param->{restart};
        }
 
        if (PVE::HA::Config::vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {