Summary: Quiet erroneous stopVM failures on kvm

Detail: Cloudstack tries to stop VMs all the time, for all sorts of reasons,
but usually just to get into a known state.  Libvirt throws an exception of
'Domain not found' when attempting to stop a VM that doesn't exist. This causes
problems for troubleshooting real issues. Domain not found should equate
to success if trying to stop.

BUG-ID: CLOUDSTACK-4011
Bugfix-for: 4.2
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1375825281 -0600
This commit is contained in:
Marcus Sorensen 2013-08-06 15:41:21 -06:00
parent 4d43fe13ce
commit 016fe3ecb8
1 changed files with 4 additions and 0 deletions

View File

@ -4365,6 +4365,10 @@ ServerResource {
}
}
} catch (LibvirtException e) {
if (e.getMessage().contains("Domain not found")) {
s_logger.debug("VM " + vmName + " doesn't exist, no need to stop it");
return null;
}
s_logger.debug("Failed to stop VM :" + vmName + " :", e);
return e.getMessage();
} catch (InterruptedException ie) {