Red Hat Bugzilla – Bug 795656
destroyFlags should raise exception with proper error code
Last modified: 2013-02-28 23:54:07 EST
Description of problem: For now destroyFlags(VIR_DOMAIN_DESTROY_GRACEFUL) raise libvirt.libvirtError exception when failed. In this case error code is VIR_ERR_INTERNAL_ERROR and message is "failed to kill qemu process with SIGTERM". The problem is that VIR_ERR_INTERNAL_ERROR is too general. Please consider to change it to something more meaningful Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Upstream patch proposed: https://www.redhat.com/archives/libvir-list/2012-February/msg00940.html
Bare minimum backport in POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-February/msg01316.html However, we have the bigger question of whether we should also be backporting graceful destroy.
Upstream has a graceful timeout on destroy, which is the probably primary reason that you would hit this error in the first place. Should we widen the scope of this bug to also include backporting the VIR_DOMAIN_DESTROY_GRACEFUL flag and implementation?
In my opinion, there is no need to backport VIR_DOMAIN_DESTROY_GRACEFUL to rhel-6.2 unless we receive a clear customer request. RHEV-3.0 has its guest-agent-assisted graceful destruction; if it was not used, the customer probably care less about his data.
# rpm -q libvirt qemu-kvm libvirt-0.9.10-3.el6.x86_64 qemu-kvm-0.12.1.2-2.225.el6.x86_64 1. prepare a running domain # virsh list Id Name State ---------------------------------------------------- 2 rhel6u2 running 2. hung the domain process # pidof qemu-kvm 25933 # kill -STOP 25933 3. destroy domain with graceful # virsh destroy rhel6u2 --graceful error: Failed to destroy domain rhel6u2 error: operation failed: failed to kill qemu process with SIGTERM In libvirtd.log 2012-03-01 04:06:39.889+0000: 21282: warning : qemuProcessKill:3592 : Timed out waiting after SIGTERM to process 25933 2012-03-01 04:06:39.889+0000: 21282: error : qemuDomainDestroyFlags:1796 : operation failed: failed to kill qemu process with SIGTERM So this is fixed.
check with python # python Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) [GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn = libvirt.open(None) >>> dom = conn.lookupByName("rhel6u2") >>> dom.destroyFlags(1) libvir: QEMU error : operation failed: failed to kill qemu process with SIGTERM Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.6/site-packages/libvirt.py", line 683, in destroyFlags if ret == -1: raise libvirtError ('virDomainDestroyFlags() failed', dom=self) libvirt.libvirtError: operation failed: failed to kill qemu process with SIGTERM
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html