Skip to content

Commit f831618

Browse files
author
CDream
committed
Catch an exception in power off procedure
In libvirt driver, an exception of libvirt error may be thrown when calling shutdown method. This exception is caught by nobody, then the following retry logic and the destroy method will be missed, causing the power off procedure failure. Catch this exception (as the retry logic does) to make the procedure go on. Change-Id: Icf9b15207a7e13333cf5640a5bce0e1082ecf4ec
1 parent e537d90 commit f831618

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nova/virt/libvirt/driver.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3876,7 +3876,12 @@ def _clean_shutdown(self, instance, timeout, retry_interval):
38763876

38773877
LOG.debug("Shutting down instance from state %s", state,
38783878
instance=instance)
3879-
guest.shutdown()
3879+
try:
3880+
guest.shutdown()
3881+
except libvirt.libvirtError as e:
3882+
LOG.debug("Ignoring libvirt exception from shutdown request: %s",
3883+
encodeutils.exception_to_unicode(e),
3884+
instance=instance)
38803885
retry_countdown = retry_interval
38813886

38823887
for sec in range(timeout):

0 commit comments

Comments
 (0)