From 0b2337d9f7079cb93e30c7fd3d79f974a60969e4 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 8 Jan 2016 11:46:21 +0100 Subject: [PATCH] vm_stop: make sure the container is stopped using lxc-wait --- src/PVE/API2/LXC/Status.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PVE/API2/LXC/Status.pm b/src/PVE/API2/LXC/Status.pm index 5e5e116..91ad16e 100644 --- a/src/PVE/API2/LXC/Status.pm +++ b/src/PVE/API2/LXC/Status.pm @@ -316,6 +316,10 @@ __PACKAGE__->register_method({ run_command($cmd); } + # make sure container is stopped + $cmd = ['lxc-wait', '-n', $vmid, '-t', 5, '-s', 'STOPPED']; + run_command($cmd); + die $err if $err; return; -- 2.39.5