Commit 9b2f5473 authored by Dietmar Maurer's avatar Dietmar Maurer

run openvz destroy_vm as background task

parent 3ae33cce
...@@ -454,7 +454,9 @@ __PACKAGE__->register_method({ ...@@ -454,7 +454,9 @@ __PACKAGE__->register_method({
vmid => get_standard_option('pve-vmid'), vmid => get_standard_option('pve-vmid'),
}, },
}, },
returns => { type => 'null' }, returns => {
type => 'string',
},
code => sub { code => sub {
my ($param) = @_; my ($param) = @_;
...@@ -467,11 +469,13 @@ __PACKAGE__->register_method({ ...@@ -467,11 +469,13 @@ __PACKAGE__->register_method({
# test if VM exists # test if VM exists
my $conf = PVE::OpenVZ::load_config($param->{vmid}); my $conf = PVE::OpenVZ::load_config($param->{vmid});
my $cmd = ['vzctl', 'destroy', $vmid ]; my $realcmd = sub {
my $cmd = ['vzctl', 'destroy', $vmid ];
PVE::Tools::run_command($cmd); PVE::Tools::run_command($cmd);
};
return undef; return $rpcenv->fork_worker('vzdestroy', $vmid, $user, $realcmd);
}}); }});
my $sslcert; my $sslcert;
......
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